From nobody Tue Apr 7 01:36:55 2026 Received: from smtpout-02.galae.net (smtpout-02.galae.net [185.246.84.56]) (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 B088F3CFF45 for ; Fri, 3 Apr 2026 16:10:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.246.84.56 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775232607; cv=none; b=X+INe/GV8/dmeSb9JFEcZDw4fWwwDU/Gg/YzZfSFsDk0QcbdR2FhpU0AvOGfwrycmjLWNx5nUBhlY7/OmyGAtYAxxeeOPnUBUmziYQtVXgMiBiz/LZ5NaBjZoMbHyDcTmdUp6UMkMm2NeTeVXrdbAc/6fSuTrJzN4pJXXu3JPr4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775232607; c=relaxed/simple; bh=+rienJCiJ/b99Px67gdPRlY+7XR/5LML7t7ieMvxoSE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=HhgX0zQJHpTb2kamOwjwUY0Yk0o9KNrvnD77kDxHPcTdYyD9MtM/9v8Xd313qV+AVyZXUpURkDlMYriPIpxjn+Us9GIC8CnTq7kuDlgtmhFtp3V3Hs/dq4XCbF6C3XZ1fApD8oxrQEorLNr2jiorcauRbu69BH6xyQDtMGp3ggI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=Zoq8ydzG; arc=none smtp.client-ip=185.246.84.56 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="Zoq8ydzG" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-02.galae.net (Postfix) with ESMTPS id 7AF501A312E; Fri, 3 Apr 2026 16:10:05 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 505D4603C1; Fri, 3 Apr 2026 16:10:05 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id B3AB6104500FA; Fri, 3 Apr 2026 18:10:02 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1775232604; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=AtDuaW75HQVabGFbw4yfNgUHQh/r6FDMUHlhTNsHi9I=; b=Zoq8ydzGBO39ExDCZ4mO6pVU+QgDyeIx0qjTXWxWK3D7poKE2FUu9uQ63FFSQYkY42EVTn zM80Sd31Wq32YLiI+d/YIKkyHnuDNaLB4b4tPT2y54KrKrOFbh0t/RXOMY0H47VzLI1S+J EZNRLBnyT9liXdhn8bVrqEKHSL55QDR58LH49P1AMt/KqlTlfLBVcJAQQdjgs1ygPYbsin zk1QxZEdseEt6hUGyKdD5PeFFime4UJ/wi7Dp6RON5wbYbZv880pLcAOpQXli2RXwHwtPe pX/DVuVO8d4uPqAy3edNaDAZAWC+xlOBT53S2tLmHjRm1hyLtx2TwQdZ2faePQ== From: Miquel Raynal Date: Fri, 03 Apr 2026 18:09:30 +0200 Subject: [PATCH v4 12/27] mtd: spi-nor: swp: Create a TB intermediate variable Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260403-winbond-v6-18-rc1-spi-nor-swp-v4-12-833dab5e7288@bootlin.com> References: <20260403-winbond-v6-18-rc1-spi-nor-swp-v4-0-833dab5e7288@bootlin.com> In-Reply-To: <20260403-winbond-v6-18-rc1-spi-nor-swp-v4-0-833dab5e7288@bootlin.com> To: Pratyush Yadav , Michael Walle , Takahiro Kuwano , Richard Weinberger , Vignesh Raghavendra , Jonathan Corbet Cc: Sean Anderson , Thomas Petazzoni , Steam Lin , linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, Miquel Raynal X-Mailer: b4 0.14.3 X-Last-TLS-Session-Version: TLSv1.3 Ease the future reuse of the tb (Top/Bottom) boolean by creating an intermediate variable. Signed-off-by: Miquel Raynal --- drivers/mtd/spi-nor/swp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/mtd/spi-nor/swp.c b/drivers/mtd/spi-nor/swp.c index 66f85826ba0d..f068cb9c8f6d 100644 --- a/drivers/mtd/spi-nor/swp.c +++ b/drivers/mtd/spi-nor/swp.c @@ -60,6 +60,7 @@ static void spi_nor_get_locked_range_sr(struct spi_nor *n= or, const u8 *sr, loff_ u8 bp_mask =3D spi_nor_get_sr_bp_mask(nor); u8 tb_mask =3D spi_nor_get_sr_tb_mask(nor); u8 bp, val =3D sr[0] & bp_mask; + bool tb =3D (nor->flags & SNOR_F_HAS_SR_TB) ? sr[0] & tb_mask : 0; =20 if (nor->flags & SNOR_F_HAS_SR_BP3_BIT6 && val & SR_BP3_BIT6) val =3D (val & ~SR_BP3_BIT6) | SR_BP3; @@ -79,7 +80,7 @@ static void spi_nor_get_locked_range_sr(struct spi_nor *n= or, const u8 *sr, loff_ if (*len > nor->params->size) *len =3D nor->params->size; =20 - if (nor->flags & SNOR_F_HAS_SR_TB && sr[0] & tb_mask) + if (tb) *ofs =3D 0; else *ofs =3D nor->params->size - *len; --=20 2.53.0