From: Benjamin Tissoires <benjamin.tissoires@redhat.com>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Jiri Kosina <jkosina@suse.cz>,
Mika Westerberg <mika.westerberg@linux.intel.com>,
Antonio Borneo <borneo.antonio@gmail.com>,
Jean-Baptiste Maneyrol <jmaneyrol@invensense.com>,
Andrew Duggan <aduggan@synaptics.com>,
Gwendal Grignou <gwendal@chromium.org>,
"Rafael J. Wysocki" <rafael.j.wysocki@intel.com>,
linux-input@vger.kernel.org, kernel-janitors@vger.kernel.org,
Joe Perches <joe@perches.com>
Subject: Re: [patch] HID: i2c-hid: fix harmless test_bit() issue
Date: Thu, 14 May 2015 10:17:05 -0400 [thread overview]
Message-ID: <20150514141705.GB23647@mail.corp.redhat.com> (raw)
In-Reply-To: <20150514083330.GB1665@mwanda>
On May 14 2015 or thereabouts, Dan Carpenter wrote:
> These defines are used like this:
>
> if (test_bit(I2C_HID_STARTED, &ihid->flags))
>
> The intent was to use bits 0, 1, and 2 but because of the extra shifts
> we're using bits 1, 2, and 4. It's harmless becuase it's done
> consistently but it's not the intent and static checkers will complain.
>
> Fixes: 4a200c3b9a40 ('HID: i2c-hid: introduce HID over i2c specification implementation')
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Same as the other one:
Oops. Looks good to me:
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Cheers,
Benjamin
>
> diff --git a/drivers/hid/i2c-hid/i2c-hid.c b/drivers/hid/i2c-hid/i2c-hid.c
> index 92d6cdf..cadec6a 100644
> --- a/drivers/hid/i2c-hid/i2c-hid.c
> +++ b/drivers/hid/i2c-hid/i2c-hid.c
> @@ -42,9 +42,9 @@
> #include <linux/i2c/i2c-hid.h>
>
> /* flags */
> -#define I2C_HID_STARTED (1 << 0)
> -#define I2C_HID_RESET_PENDING (1 << 1)
> -#define I2C_HID_READ_PENDING (1 << 2)
> +#define I2C_HID_STARTED 0
> +#define I2C_HID_RESET_PENDING 1
> +#define I2C_HID_READ_PENDING 2
>
> #define I2C_HID_PWR_ON 0x00
> #define I2C_HID_PWR_SLEEP 0x01
next prev parent reply other threads:[~2015-05-14 14:17 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-14 8:33 [patch] HID: i2c-hid: fix harmless test_bit() issue Dan Carpenter
2015-05-14 14:17 ` 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=20150514141705.GB23647@mail.corp.redhat.com \
--to=benjamin.tissoires@redhat.com \
--cc=aduggan@synaptics.com \
--cc=borneo.antonio@gmail.com \
--cc=dan.carpenter@oracle.com \
--cc=gwendal@chromium.org \
--cc=jkosina@suse.cz \
--cc=jmaneyrol@invensense.com \
--cc=joe@perches.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-input@vger.kernel.org \
--cc=mika.westerberg@linux.intel.com \
--cc=rafael.j.wysocki@intel.com \
/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).