From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f47.google.com (mail-pj1-f47.google.com [209.85.216.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4DC5A483825 for ; Thu, 23 Jul 2026 18:46:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.47 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784832420; cv=none; b=QaQoW+mu9EV1n4m7mV43KjqHQxWSxcWWaoEnlhy/FZ/EiKHIPLBvpzfDyLXKOR1qepyxuFwOBVxslFwlSL040gYKmrX+Rer/Y2W/Ay5gl7+LFcAhEJldQ541rDx20C8AKiqTJoJREHd1RLorM2uWntPhVliJMbK6chFsZXYKGIQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784832420; c=relaxed/simple; bh=nW6MrRHHWnzwdABJGwvCPzIc7iuIrbsXtzd8lLHRzF0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=g5Cm+thIcLx55uKRtiyTRQmAZcifL/gRFkquUgSE6gfUPqcw7eIopmIv6fRy/TZHYCu+662QZoPp5SyUPe7mOHrrEgL8VrmQP9gG1rL/R6jOgixgm7nWazHpzjZNyMIu2ePmPySoNNsqC8RWRQZIo8Zbhyu8A3grbI5QZXPhZ2Y= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=FmYczvoy; arc=none smtp.client-ip=209.85.216.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="FmYczvoy" Received: by mail-pj1-f47.google.com with SMTP id 98e67ed59e1d1-38dcbade417so1041738a91.1 for ; Thu, 23 Jul 2026 11:46:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1784832411; x=1785437211; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=wDObpA7RQnlY6KsOhvuFRPLttcc0bMB5PHs3ILqM3SU=; b=FmYczvoyHn21U0Gbb5wLNp4iN9lk+/+wJecEllmw6ZrNRNaMIZnoB8uQUx3Rx9E8VQ 8RH2C89/vPSYNjYFDa6NYr1o0PRzEiljit/3+M9ZaW/3oT3dctU54coZ7aWbtfpDXFPd 9hW3sbnahCHKckF1Xg6UjD/uQ2KPWLWyyAzFVwWIuHhYhpqlAvRNeETmUVgOv2YL9XoG 5qXiZwfkx+tCV+VIVqpR2bDLjTOiWpS9sI8hK6lXwSs+yH287lPVkAwOkJCg9jTidIc+ E6CxBXJ3VHxQAmLtIOz6ykbDCV84lM8X1xYNqwTebYxlaJGay18P7bdn5KuFPWIYHc+8 3dmw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784832411; x=1785437211; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=wDObpA7RQnlY6KsOhvuFRPLttcc0bMB5PHs3ILqM3SU=; b=sstm5f2+4t6A4NYfNKM1bqWxdq4VQfEaLZrN5hRPvznu/Vlm09xl80Za57GycDlvxt whgK3bWtOmoJ5CKaKOWV5TYhOF0/Y8z1x50q5J6LOumqQTkl45eCc2oHy8Phocr8vxnF 5bms5D8IM8dy9OnXIk6HtbqPgBEmUwOvLoUpu4ey3m9ZqvZM7BUow3AwHSIav4QLXQo3 n4GPyQ09ZnojRVRIi1rrGxb52cguyZmlhROAW2zpPiUow4A1NH3TvAP9ELclX/WyVNmW MgGPLQhDjItDInyP/pEsSzCGenVv0qUPifdHhR/9+FVxRBVgmr9DcrHoD7greR+TIQTx uApQ== X-Forwarded-Encrypted: i=1; AHgh+RoqCnDubIpWG9tDKnypf7dqD31DIg8Erl6Z9BtNhXgUddZWJ/MikPD7Cvq9heZlv4cfl9QvxNk0qoXwiw8=@vger.kernel.org X-Gm-Message-State: AOJu0YzwjpmMbqGER8qQWFrNcqLAFS65xAJDbpw8F9QUNh+u7iNATvUW XAMzMYoSbnNBF1CMu2GlsQK/92JHkfHqbDa9KBOOFAJmmU9gYDQaHkUp X-Gm-Gg: AR+sD12VelMygxzsNWCUR6CY3LpJOfRpbusR5FnnTsheyLlrMBuwHG493/hF6jk9V3A 51FnAWxdWpgptnpzA2lP6fYl88wcM5OxufuwrXUYmWrPTcIEsTe0emaZq3ME3mCtjTLt0ulzmDX B8R9SWw/omUsutHxehezUDMalRjryxm/6LG4GLjNS89ehu788RKAVOzZ4Aljf+Ojpb9pNgIHsrj haahPmQhQmMVQq/l2cFzBv9jFb33b7vQyc6Ux2V13DE5K7n0z711UMmlHTzYdapFJAaL5LWzomj JPnXbh/OThYsK75vdWrjt3rptmk8vsbx821TglKLfFx2JNwndzzQBRp/fHJf+tVPpieF+2bpRGB 2a0UABCBgnxpDaonLYmhGLscPJSK3yKJX9IiPD6NdwJo3WnINGKPbQZTohM7NK9B+LKMgaWFUsn 3ojyC5fD8= X-Received: by 2002:a17:90b:1cc7:b0:381:f7a:2e0d with SMTP id 98e67ed59e1d1-38ec66379c9mr3820244a91.33.1784832410845; Thu, 23 Jul 2026 11:46:50 -0700 (PDT) Received: from ubuntu.. ([110.9.142.4]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-38f03af8a45sm308155a91.10.2026.07.23.11.46.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Jul 2026 11:46:50 -0700 (PDT) From: Sang-Heon Jeon To: Julia.Lawall@inria.fr, Alexander Shishkin , Maxime Coquelin , Alexandre Torgue Cc: cocci@inria.fr, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com Subject: [PATCH 20/36] stm class: remove conditional return with no effect Date: Fri, 24 Jul 2026 03:45:22 +0900 Message-ID: <20260723184538.3888637-21-ekffu200098@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260723184538.3888637-1-ekffu200098@gmail.com> References: <20260723184538.3888637-1-ekffu200098@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Both branches of the check return the same value, so the check has no effect. Remove it and return the value directly. This is the result of running the Coccinelle script from scripts/coccinelle/misc/cond_return_no_effect.cocci. Signed-off-by: Sang-Heon Jeon --- drivers/hwtracing/stm/core.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/drivers/hwtracing/stm/core.c b/drivers/hwtracing/stm/core.c index f48c6a8a0654..edf3d69a84a9 100644 --- a/drivers/hwtracing/stm/core.c +++ b/drivers/hwtracing/stm/core.c @@ -602,17 +602,11 @@ static ssize_t notrace stm_write(struct stm_device *stm, struct stm_output *output, unsigned int chan, const char *buf, size_t count, struct stm_source_data *source) { - int err; - /* stm->pdrv is serialized against policy_mutex */ if (!stm->pdrv) return -ENODEV; - err = stm->pdrv->write(stm->data, output, chan, buf, count, source); - if (err < 0) - return err; - - return err; + return stm->pdrv->write(stm->data, output, chan, buf, count, source); } static ssize_t stm_char_write(struct file *file, const char __user *buf, -- 2.43.0