From mboxrd@z Thu Jan 1 00:00:00 1970 From: kbuild test robot Subject: [PATCH] HID: lg: fix noderef.cocci warnings Date: Mon, 21 Nov 2016 20:05:31 +0800 Message-ID: <20161121120531.GA65643@xian.lkp.intel.com> References: <201611211942.OoqNaSxL%fengguang.wu@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <1479725322-30863-3-git-send-email-benjamin.tissoires@redhat.com> Sender: linux-kernel-owner@vger.kernel.org To: Benjamin Tissoires Cc: kbuild-all@01.org, Jiri Kosina , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org List-Id: linux-input@vger.kernel.org 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 Signed-off-by: Fengguang Wu --- 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), + HID_FEATURE_REPORT, + HID_REQ_SET_REPORT); } kfree(buf); }