diff mbox series

pinctrl: renesas: remove checker warnings: x | !y

Message ID 20230613021643.3330661-1-gongruiqi@huaweicloud.com
State New
Headers show
Series pinctrl: renesas: remove checker warnings: x | !y | expand

Commit Message

GONG, Ruiqi June 13, 2023, 2:16 a.m. UTC
Eliminate the following Sparse reports when building with C=1:

drivers/pinctrl/renesas/pinctrl-rzn1.c:187:52: warning: dubious: x | !y
drivers/pinctrl/renesas/pinctrl-rzn1.c:193:52: warning: dubious: x | !y

Signed-off-by: GONG, Ruiqi <gongruiqi@huaweicloud.com>
---
 drivers/pinctrl/renesas/pinctrl-rzn1.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/drivers/pinctrl/renesas/pinctrl-rzn1.c b/drivers/pinctrl/renesas/pinctrl-rzn1.c
index 374b9f281324..2391a316d5c5 100644
--- a/drivers/pinctrl/renesas/pinctrl-rzn1.c
+++ b/drivers/pinctrl/renesas/pinctrl-rzn1.c
@@ -184,13 +184,15 @@  static void rzn1_hw_set_lock(struct rzn1_pinctrl *ipctl, u8 lock, u8 value)
 	 * address | 1.
 	 */
 	if (lock & LOCK_LEVEL1) {
-		u32 val = ipctl->lev1_protect_phys | !(value & LOCK_LEVEL1);
+		u32 val = ipctl->lev1_protect_phys |
+			(value & LOCK_LEVEL1 ? 0 : 1);
 
 		writel(val, &ipctl->lev1->status_protect);
 	}
 
 	if (lock & LOCK_LEVEL2) {
-		u32 val = ipctl->lev2_protect_phys | !(value & LOCK_LEVEL2);
+		u32 val = ipctl->lev2_protect_phys |
+			(value & LOCK_LEVEL2 ? 0 : 1);
 
 		writel(val, &ipctl->lev2->status_protect);
 	}