mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Peng Fan (OSS)" <peng.fan@oss.nxp.com>
To: Andrew Lunn <andrew@lunn.ch>,
	Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>,
	Gregory Clement <gregory.clement@bootlin.com>,
	Russell King <linux@armlinux.org.uk>
Cc: linux-kernel@vger.kernel.org, Peng Fan <peng.fan@nxp.com>,
	linux-arm-kernel@lists.infradead.org
Subject: [PATCH] ARM: orion/gpio: use __assign_bit() where applicable
Date: Sun, 20 Sep 2026 10:25:50 +0800	[thread overview]
Message-ID: <20260920022551.3145595-1-peng.fan@oss.nxp.com> (raw)

From: Peng Fan <peng.fan@nxp.com>

Convert open-coded if/else with __set_bit/__clear_bit to the
__assign_bit API.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
 arch/arm/plat-orion/gpio.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/arch/arm/plat-orion/gpio.c b/arch/arm/plat-orion/gpio.c
index 49e29b7894a3..a8412dba97f0 100644
--- a/arch/arm/plat-orion/gpio.c
+++ b/arch/arm/plat-orion/gpio.c
@@ -275,15 +275,9 @@ void __init orion_gpio_set_valid(unsigned pin, int mode)
 	if (mode == 1)
 		mode = GPIO_INPUT_OK | GPIO_OUTPUT_OK;
 
-	if (mode & GPIO_INPUT_OK)
-		__set_bit(pin, &ochip->valid_input);
-	else
-		__clear_bit(pin, &ochip->valid_input);
+	__assign_bit(pin, &ochip->valid_input, mode & GPIO_INPUT_OK);
 
-	if (mode & GPIO_OUTPUT_OK)
-		__set_bit(pin, &ochip->valid_output);
-	else
-		__clear_bit(pin, &ochip->valid_output);
+	__assign_bit(pin, &ochip->valid_output, mode & GPIO_OUTPUT_OK);
 }
 
 void orion_gpio_set_blink(unsigned pin, int blink)
-- 
2.51.0


             reply	other threads:[~2026-09-20  2:28 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-20  2:25 Peng Fan (OSS) [this message]
2026-09-30 19:57 ` Gregory CLEMENT

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260920022551.3145595-1-peng.fan@oss.nxp.com \
    --to=peng.fan@oss.nxp.com \
    --cc=andrew@lunn.ch \
    --cc=gregory.clement@bootlin.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=peng.fan@nxp.com \
    --cc=sebastian.hesselbarth@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®