From mboxrd@z Thu Jan 1 00:00:00 1970 From: Fengguang Wu Subject: Re: [PATCH] HID: fix noderef.cocci warnings Date: Mon, 20 Jun 2016 18:02:06 +0800 Message-ID: <20160620100206.GA19261@wfg-t540p.sh.intel.com> References: <201606182012.7NLmbFhz%fengguang.wu@intel.com> <20160618121314.GA95633@lkp-ib04> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Return-path: Received: from mga09.intel.com ([134.134.136.24]:8356 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751964AbcFTKED (ORCPT ); Mon, 20 Jun 2016 06:04:03 -0400 Content-Disposition: inline In-Reply-To: Sender: linux-input-owner@vger.kernel.org List-Id: linux-input@vger.kernel.org To: Masaki Ota Cc: "kbuild-all@01.org" , "linux-input@vger.kernel.org" , "linux-usb@vger.kernel.org" , Jiri Kosina Hi Masaki, On Mon, Jun 20, 2016 at 09:45:02AM +0000, Masaki Ota wrote: > Hi, fengguang, >=20 > ret =3D hid_hw_raw_request(hdev, U1_FEATURE_REPORT_ID, input, > - sizeof(input), HID_FEATURE_REPORT, HID_REQ_SET_REPORT); > + sizeof(*input), HID_FEATURE_REPORT, > + HID_REQ_SET_REPORT); >=20 > I tested this code, but our device cannot work on it. > So, I think we should modify the code as below. >=20 > ret =3D hid_hw_raw_request(hdev, U1_FEATURE_REPORT_ID, input, > sizeof(u8)*U1_FEATURE_REPORT_LEN, > HID_FEATURE_REPORT, HID_REQ_SET_REPORT); OK, thank you for the fix! =46enguang > -----Original Message----- > From: kbuild test robot [mailto:fengguang.wu@intel.com]=20 > Sent: Saturday, June 18, 2016 9:13 PM > Cc: kbuild-all@01.org; linux-input@vger.kernel.org; linux-usb@vger.ke= rnel.org; Jiri Kosina; =E5=A4=AA=E7=94=B0 =E7=9C=9F=E5=96=9C Masaki Ota > Subject: [PATCH] HID: fix noderef.cocci warnings >=20 > drivers/hid/hid-alps.c:139:3-9: ERROR: application of sizeof to point= er > drivers/hid/hid-alps.c:148:4-10: ERROR: application of sizeof to poin= ter >=20 > sizeof when applied to a pointer typed expression gives the size of = the pointer >=20 > Generated by: scripts/coccinelle/misc/noderef.cocci >=20 > CC: Masaki Ota > Signed-off-by: Fengguang Wu > --- >=20 > hid-alps.c | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) >=20 > --- a/drivers/hid/hid-alps.c > +++ b/drivers/hid/hid-alps.c > @@ -136,7 +136,8 @@ static int u1_read_write_register(struct > =20 > input[7] =3D check_sum; > ret =3D hid_hw_raw_request(hdev, U1_FEATURE_REPORT_ID, input, > - sizeof(input), HID_FEATURE_REPORT, HID_REQ_SET_REPORT); > + sizeof(*input), HID_FEATURE_REPORT, > + HID_REQ_SET_REPORT); > =20 > if (ret < 0) { > dev_err(&hdev->dev, "failed to read command (%d)\n", ret); @@ -145= ,7 +146,7 @@ static int u1_read_write_register(struct > =20 > if (read_flag) { > ret =3D hid_hw_raw_request(hdev, U1_FEATURE_REPORT_ID, readbuf, > - sizeof(readbuf), HID_FEATURE_REPORT, > + sizeof(*readbuf), HID_FEATURE_REPORT, > HID_REQ_GET_REPORT); > =20 > if (ret < 0) { -- To unsubscribe from this list: send the line "unsubscribe linux-input" = in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html