From: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
To: Fabian Frederick <fabf@skynet.be>
Cc: linux-kernel@vger.kernel.org,
"Rafael J. Wysocki" <rjw@rjwysocki.net>,
Len Brown <lenb@kernel.org>,
linux-acpi@vger.kernel.org
Subject: Re: [PATCH 1/1 linux-next] ACPI / SBS: fix sparse warning
Date: Mon, 29 Sep 2014 11:10:04 +0530 [thread overview]
Message-ID: <20140929054004.GA4144@sudip-PC> (raw)
In-Reply-To: <1411929887-2440-1-git-send-email-fabf@skynet.be>
On Sun, Sep 28, 2014 at 08:44:47PM +0200, Fabian Frederick wrote:
> Adding parentheses around expression to avoid:
> drivers/acpi/sbs.c:444:28: warning: dubious: !x & y
>
> Signed-off-by: Fabian Frederick <fabf@skynet.be>
> ---
> drivers/acpi/sbs.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/acpi/sbs.c b/drivers/acpi/sbs.c
> index 32aecea..a7a3edd 100644
> --- a/drivers/acpi/sbs.c
> +++ b/drivers/acpi/sbs.c
> @@ -441,7 +441,7 @@ static int acpi_ac_get_present(struct acpi_sbs *sbs)
> * The spec requires that bit 4 always be 1. If it's not set, assume
> * that the implementation doesn't support an SBS charger
> */
> - if (!(status >> 4) & 0x1)
> + if (!((status >> 4) & 0x1))
i think the logic changed over here.
it was !x & y , but now it has become !(x & y)
! is having higher priority than & so !x & y will mean ((!x) & y)
thanks
sudip
> return -ENODEV;
>
> sbs->charger_present = (status >> 15) & 0x1;
> --
> 1.9.1
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
next prev parent reply other threads:[~2014-09-29 5:40 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-28 18:44 [PATCH 1/1 linux-next] ACPI / SBS: fix sparse warning Fabian Frederick
2014-09-29 5:40 ` Sudip Mukherjee [this message]
2014-09-29 16:30 ` Fabian Frederick
2014-09-29 23:49 ` Rafael J. Wysocki
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=20140929054004.GA4144@sudip-PC \
--to=sudipm.mukherjee@gmail.com \
--cc=fabf@skynet.be \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rjw@rjwysocki.net \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.