* [PATCH] firmware: arm_scmi: Do not use !! on boolean when setting msg->flags
@ 2023-09-21 8:52 Sudeep Holla
2023-09-27 11:00 ` Cristian Marussi
2023-09-27 13:12 ` Sudeep Holla
0 siblings, 2 replies; 3+ messages in thread
From: Sudeep Holla @ 2023-09-21 8:52 UTC (permalink / raw)
To: linux-arm-kernel; +Cc: Sudeep Holla, Cristian Marussi
Both pc->async_powercap_cap_set and ignore_dresp are already boolean.
Use of !! on them is obviously dubious.
Sparse reports:
drivers/firmware/arm_scmi/powercap.c:363:17: warning: dubious: x & !y
drivers/firmware/arm_scmi/powercap.c:363:17: warning: dubious: x & !y
Remove the unnecessary !! and get rid of the warning.
Cc: Cristian Marussi <cristian.marussi@arm.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
---
drivers/firmware/arm_scmi/powercap.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/firmware/arm_scmi/powercap.c b/drivers/firmware/arm_scmi/powercap.c
index 244929cb4f3e..cb5617443a14 100644
--- a/drivers/firmware/arm_scmi/powercap.c
+++ b/drivers/firmware/arm_scmi/powercap.c
@@ -360,8 +360,8 @@ static int scmi_powercap_xfer_cap_set(const struct scmi_protocol_handle *ph,
msg = t->tx.buf;
msg->domain = cpu_to_le32(pc->id);
msg->flags =
- cpu_to_le32(FIELD_PREP(CAP_SET_ASYNC, !!pc->async_powercap_cap_set) |
- FIELD_PREP(CAP_SET_IGNORE_DRESP, !!ignore_dresp));
+ cpu_to_le32(FIELD_PREP(CAP_SET_ASYNC, pc->async_powercap_cap_set) |
+ FIELD_PREP(CAP_SET_IGNORE_DRESP, ignore_dresp));
msg->value = cpu_to_le32(power_cap);
if (!pc->async_powercap_cap_set || ignore_dresp) {
--
2.42.0
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] firmware: arm_scmi: Do not use !! on boolean when setting msg->flags
2023-09-21 8:52 [PATCH] firmware: arm_scmi: Do not use !! on boolean when setting msg->flags Sudeep Holla
@ 2023-09-27 11:00 ` Cristian Marussi
2023-09-27 13:12 ` Sudeep Holla
1 sibling, 0 replies; 3+ messages in thread
From: Cristian Marussi @ 2023-09-27 11:00 UTC (permalink / raw)
To: Sudeep Holla; +Cc: linux-arm-kernel
On Thu, Sep 21, 2023 at 09:52:57AM +0100, Sudeep Holla wrote:
> Both pc->async_powercap_cap_set and ignore_dresp are already boolean.
> Use of !! on them is obviously dubious.
>
> Sparse reports:
> drivers/firmware/arm_scmi/powercap.c:363:17: warning: dubious: x & !y
> drivers/firmware/arm_scmi/powercap.c:363:17: warning: dubious: x & !y
>
Hi,
LGTM, indeed I was seeing that report too since a while, just I did not
realize why.
Reviewed-by: Cristian Marussi <cristian.marussi@arm.com>
Thanks,
Cristian
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] firmware: arm_scmi: Do not use !! on boolean when setting msg->flags
2023-09-21 8:52 [PATCH] firmware: arm_scmi: Do not use !! on boolean when setting msg->flags Sudeep Holla
2023-09-27 11:00 ` Cristian Marussi
@ 2023-09-27 13:12 ` Sudeep Holla
1 sibling, 0 replies; 3+ messages in thread
From: Sudeep Holla @ 2023-09-27 13:12 UTC (permalink / raw)
To: linux-arm-kernel, Sudeep Holla; +Cc: Cristian Marussi
On Thu, 21 Sep 2023 09:52:57 +0100, Sudeep Holla wrote:
> Both pc->async_powercap_cap_set and ignore_dresp are already boolean.
> Use of !! on them is obviously dubious.
>
> Sparse reports:
> drivers/firmware/arm_scmi/powercap.c:363:17: warning: dubious: x & !y
> drivers/firmware/arm_scmi/powercap.c:363:17: warning: dubious: x & !y
>
> [...]
Applied to sudeep.holla/linux (for-next/scmi/updates), thanks!
[1/1] firmware: arm_scmi: Do not use !! on boolean when setting msg->flags
https://git.kernel.org/sudeep.holla/c/a10aa2584ef5
--
Regards,
Sudeep
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-09-27 13:13 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-21 8:52 [PATCH] firmware: arm_scmi: Do not use !! on boolean when setting msg->flags Sudeep Holla
2023-09-27 11:00 ` Cristian Marussi
2023-09-27 13:12 ` Sudeep Holla
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).