From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-183.mta0.migadu.com (out-183.mta0.migadu.com [91.218.175.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1FC973C73DE for ; Fri, 8 May 2026 14:47:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.183 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778251677; cv=none; b=gJ7djkRfNXO2jvxVNLBIktDSDhImUcsRuXvqFWfkuuu9JVGnH/ShUE5kT1Dj/roXWouM8estWcWWospaopdf14kJDxlcbckDCsQUphJ71RAcHajQp/LZP8t9PunfQWkqJkzlA3ZBdorf+qBEwjS+mrRuwCZsL8NSbeB2On7o44U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778251677; c=relaxed/simple; bh=P3hDAVGYf1ro96mztOFERL4LIB4pYkOesBhTpoOtog4=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=qohE9y9AufkF9GjG/e1dDOYRR2Rdkjx/UKpw/ZItbPf2tmQPQ1FbKG5UB7lVjySpTI14SW+bLKcaneIlTfTyyR9csLHlddnzaNtnvBFaZuNXIp3EBo6ioayRVxfmyFqRhtVRNtgIsTYaCaL2DCuGNzAxgLQayVhOZN1sIzqByqM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=lAHo75R+; arc=none smtp.client-ip=91.218.175.183 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="lAHo75R+" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1778251673; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=L7c94zjHt1bNKMcE6C2ppqxs3cIZ/nVdUVOcHMFeI7c=; b=lAHo75R+QoYZI82YbQMcMGb15hVNWXgWNf4azy2zUL/JDFYN+CjLPtPeRuztsVaaW3YyXy scWI2fLEQMMQNCy1abPGVa8fESoJcHuYotameeWV5sVtdZUHffxl8HjO4ae6Ckbi3uER1e asU6KfQafUFiRPR6+iUlfGVpSOECw/E= From: Thorsten Blum To: Alexander Shishkin , Maxime Coquelin , Alexandre Torgue Cc: Thorsten Blum , linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH RESEND] stm class: remove unnecessary local variable in stm_write Date: Fri, 8 May 2026 16:47:06 +0200 Message-ID: <20260508144705.3940-3-thorsten.blum@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1036; i=thorsten.blum@linux.dev; h=from:subject; bh=DprM5VsbFWom/d4IuDl2ijqlm6zvA0JIDercFKGcau4=; b=owGbwMvMwCUWt7pQ4caZUj3G02pJDJl/v2d6q29SOBoVUOAZKRvNqntv49/Vy63urny5M1zz7 FM3N4UZHaUsDGJcDLJiiiwPZv2Y4VtaU7nJJGInzBxWJpAhDFycAjAR5e+MDJszmnNPBVwKe8IT ETlN21VFnev69SunZrL7FZ3R2LbkHAcjw475XPUH9TUPfgzLDyi/sifC9M5llsx5Sjtu5ajpLIj /zA4A X-Developer-Key: i=thorsten.blum@linux.dev; a=openpgp; fpr=1D60735E8AEF3BE473B69D84733678FD8DFEEAD4 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT The local error variable and the corresponding if check in stm_write() are unnecessary. Remove them. Signed-off-by: Thorsten Blum --- 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,