From: Benjamin Tissoires <benjamin.tissoires@redhat.com>
To: kbuild test robot <lkp@intel.com>
Cc: kbuild-all@01.org, Jiri Kosina <jikos@kernel.org>,
linux-input@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] HID: lg: fix noderef.cocci warnings
Date: Mon, 21 Nov 2016 15:17:30 +0100 [thread overview]
Message-ID: <20161121141730.GI2119@mail.corp.redhat.com> (raw)
In-Reply-To: <20161121120531.GA65643@xian.lkp.intel.com>
On Nov 21 2016 or thereabouts, kbuild test robot wrote:
> drivers/hid/hid-lg.c:780:47-53: ERROR: application of sizeof to pointer
>
> sizeof when applied to a pointer typed expression gives the size of
> the pointer
>
> Generated by: scripts/coccinelle/misc/noderef.cocci
>
> CC: Benjamin Tissoires <benjamin.tissoires@redhat.com>
> Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
> ---
>
> hid-lg.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> --- a/drivers/hid/hid-lg.c
> +++ b/drivers/hid/hid-lg.c
> @@ -777,8 +777,10 @@ static int lg_probe(struct hid_device *h
> buf[1] = 0xB2;
> get_random_bytes(&buf[2], 2);
>
> - ret = hid_hw_raw_request(hdev, buf[0], buf, sizeof(buf),
> - HID_FEATURE_REPORT, HID_REQ_SET_REPORT);
> + ret = hid_hw_raw_request(hdev, buf[0], buf,
> + sizeof(*buf),
This is wrong. I messed up and should have used "sizeof(cbuf)", but the
coccinelle script failed at detecting the correct solution (I guess it
couldn't).
Jiri, do you want me to send a v2 of the series or will you just amend
the patch while applying?
Cheers,
Benjamin
> + HID_FEATURE_REPORT,
> + HID_REQ_SET_REPORT);
> }
> kfree(buf);
> }
next prev parent reply other threads:[~2016-11-21 14:17 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-21 10:48 [PATCH 0/4] HID: fix few non-DMA capable HID transfers Benjamin Tissoires
2016-11-21 10:48 ` [PATCH 1/4] HID: cp2112: make transfer buffers DMA capable Benjamin Tissoires
2016-11-21 10:48 ` [PATCH 2/4] HID: lg: " Benjamin Tissoires
2016-11-21 12:05 ` [PATCH] HID: lg: fix noderef.cocci warnings kbuild test robot
2016-11-21 14:17 ` Benjamin Tissoires [this message]
2016-11-22 10:44 ` Jiri Kosina
2016-11-23 2:22 ` Fengguang Wu
2016-11-23 7:03 ` Julia Lawall
2016-11-21 12:05 ` [PATCH 2/4] HID: lg: make transfer buffers DMA capable kbuild test robot
2016-11-21 10:48 ` [PATCH 3/4] HID: magicmouse: " Benjamin Tissoires
2016-11-21 10:48 ` [PATCH 4/4] HID: rmi: " Benjamin Tissoires
2016-11-23 16:44 ` [PATCH 0/4] HID: fix few non-DMA capable HID transfers 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=20161121141730.GI2119@mail.corp.redhat.com \
--to=benjamin.tissoires@redhat.com \
--cc=jikos@kernel.org \
--cc=kbuild-all@01.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lkp@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).