From: Benjamin Tissoires <benjamin.tissoires@redhat.com>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Jiri Kosina <jkosina@suse.cz>,
Henrik Rydberg <rydberg@bitmath.org>,
linux-input@vger.kernel.org, kernel-janitors@vger.kernel.org,
Joe Perches <joe@perches.com>
Subject: Re: [patch] HID: rmi: fix some harmless BIT() mistakes
Date: Thu, 14 May 2015 10:16:34 -0400 [thread overview]
Message-ID: <20150514141634.GA23647@mail.corp.redhat.com> (raw)
In-Reply-To: <20150514083256.GA1665@mwanda>
On May 14 2015 or thereabouts, Dan Carpenter wrote:
> These defines are used like this:
>
> if (!(test_bit(RMI_STARTED, &hdata->flags)))
>
> So the intent was to use bits 0, 1 and 2 but because of the extra BIT()
> shifts we're actually using 1, 2 and 4. It's harmless because it's done
> consistently but static checkers will complain.
>
> Fixes: 9fb6bf02e3ad ('HID: rmi: introduce RMI driver for Synaptics touchpads')
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Oops. Looks good to me:
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Cheers,
Benjamin
>
> diff --git a/drivers/hid/hid-rmi.c b/drivers/hid/hid-rmi.c
> index 368ffdf..2f3e51d 100644
> --- a/drivers/hid/hid-rmi.c
> +++ b/drivers/hid/hid-rmi.c
> @@ -29,9 +29,9 @@
> #define RMI_SET_RMI_MODE_REPORT_ID 0x0f /* Feature Report */
>
> /* flags */
> -#define RMI_READ_REQUEST_PENDING BIT(0)
> -#define RMI_READ_DATA_PENDING BIT(1)
> -#define RMI_STARTED BIT(2)
> +#define RMI_READ_REQUEST_PENDING 0
> +#define RMI_READ_DATA_PENDING 1
> +#define RMI_STARTED 2
>
> /* device flags */
> #define RMI_DEVICE BIT(0)
next prev parent reply other threads:[~2015-05-14 14:16 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-14 8:32 [patch] HID: rmi: fix some harmless BIT() mistakes Dan Carpenter
2015-05-14 14:16 ` Benjamin Tissoires [this message]
2015-05-18 9:24 ` Jiri Kosina
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=20150514141634.GA23647@mail.corp.redhat.com \
--to=benjamin.tissoires@redhat.com \
--cc=dan.carpenter@oracle.com \
--cc=jkosina@suse.cz \
--cc=joe@perches.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-input@vger.kernel.org \
--cc=rydberg@bitmath.org \
/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;
as well as URLs for NNTP newsgroup(s).