Thread (3 messages) 3 messages, 3 authors, 2021-01-22

Re: [PATCH] pinctrl: qcom: spmi-gpio: Assign boolean values to a bool variable

From: Linus Walleij <hidden>
Date: 2021-01-22 13:18:03
Also in: linux-arm-msm, lkml

On Thu, Jan 21, 2021 at 4:19 AM Bjorn Andersson
[off-list ref] wrote:
On Wed 20 Jan 01:29 CST 2021, Jiapeng Zhong wrote:
quoted
Fix the following coccicheck warnings:

./drivers/pinctrl/qcom/pinctrl-ssbi-gpio.c:340:3-15: WARNING:
Assignment of 0/1 to bool variable.

Reported-by: Abaci Robot <redacted>
Signed-off-by: Jiapeng Zhong <redacted>
Reviewed-by: Bjorn Andersson <redacted>

Although we're mixing bool/int on line 417 and 637 as well, with:

        val |= pin->disable;

and

        pin->disable = val & BIT(0);

respectively. The latter could be dealt with using !!(val & BIT(0)); I
guess the appropriate for for the prior is:

        if (pin->disable)
                val |= BIT(0);

If you would like to update your patch with these as well I'd be happy
to review this.
I would opt for a respin with the above when we are anyways at it,
no hurry as it is no regression anyway.

Yours,
Linus Walleij
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help