From patchwork Mon Jun 20 09:45:02 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Masaki Ota X-Patchwork-Id: 9187069 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 9B9F0607D1 for ; Mon, 20 Jun 2016 10:02:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 833F624DA2 for ; Mon, 20 Jun 2016 10:02:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7457526490; Mon, 20 Jun 2016 10:02:30 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8D18224DA2 for ; Mon, 20 Jun 2016 10:02:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753371AbcFTKC2 (ORCPT ); Mon, 20 Jun 2016 06:02:28 -0400 Received: from mail-os2jpn01on0059.outbound.protection.outlook.com ([104.47.92.59]:49184 "EHLO JPN01-OS2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752606AbcFTKC2 convert rfc822-to-8bit (ORCPT ); Mon, 20 Jun 2016 06:02:28 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alpsgroup.onmicrosoft.com; s=selector1-jp-alps-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=I/ogZiFK0IvLOxnSlR/GEVaQIhXFW00dZI81FkF5XzY=; b=iXsOkyhobQ5AAQbnbDYsF3lYn+0V3XuHdXlXHUi0SDjImOR4aKxnV/fdt5A97t9EZqKn8fecUjqzJIbbij4OCkhFrivDs2WpmPU1WL/gWcHncU0oLKM9tktooQrLVyxVtlJO/Dw53mffIwfmfioebncxGn/ARzGGj1HNeYjMn70= Received: from OSXPR01MB0408.jpnprd01.prod.outlook.com (10.167.145.142) by OSXPR01MB0408.jpnprd01.prod.outlook.com (10.167.145.142) with Microsoft SMTP Server (TLS) id 15.1.523.12; Mon, 20 Jun 2016 09:45:02 +0000 Received: from OSXPR01MB0408.jpnprd01.prod.outlook.com ([10.167.145.142]) by OSXPR01MB0408.jpnprd01.prod.outlook.com ([10.167.145.142]) with mapi id 15.01.0523.015; Mon, 20 Jun 2016 09:45:02 +0000 From: Masaki Ota To: kbuild test robot CC: "kbuild-all@01.org" , "linux-input@vger.kernel.org" , "linux-usb@vger.kernel.org" , Jiri Kosina Subject: RE: [PATCH] HID: fix noderef.cocci warnings Thread-Topic: [PATCH] HID: fix noderef.cocci warnings Thread-Index: AQHRyVrq8INn7hGlj0WqW+JzlD1mi5/yG/Sg Date: Mon, 20 Jun 2016 09:45:02 +0000 Message-ID: References: <201606182012.7NLmbFhz%fengguang.wu@intel.com> <20160618121314.GA95633@lkp-ib04> In-Reply-To: <20160618121314.GA95633@lkp-ib04> Accept-Language: ja-JP, en-US Content-Language: ja-JP X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=masaki.ota@jp.alps.com; x-originating-ip: [106.184.109.136] x-ms-office365-filtering-correlation-id: 4ead8d15-22f0-4f71-9bd4-08d398ef8d8b x-microsoft-exchange-diagnostics: 1; OSXPR01MB0408; 20:XT1erPfpetBLO3NLXMH4pi0ZnYkUS1i43WdTtlYRIyWKAAhJ8Mv6C5GW2xUnGlJdCD5uU/7SeRIS/v1+dUZDZsmJRXbPTbxcnnUEc2ZuG1OajatnDXeGIvJAv7gt2WPsw1skotgcpCfnXHWONKNo8n/YMc8vqkq4L/b0rn0GaZZolt12hy6m03uZqkz6TJLil1ltI/5aT+HqS6gl9ADKtXyuWlCaV5bnoVJSsBvJvk5MUQvTAuHisLJ/qiXnCA7J x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:OSXPR01MB0408; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(9452136761055)(9931346810618)(228905959029699); x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(2401047)(5005006)(8121501046)(10201501046)(3002001)(6055026); SRVR:OSXPR01MB0408; BCL:0; PCL:0; RULEID:; SRVR:OSXPR01MB0408; x-forefront-prvs: 09796A1B83 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(6009001)(7916002)(189002)(13464003)(377454003)(199003)(3280700002)(76176999)(92566002)(97736004)(77096005)(4326007)(54356999)(122556002)(5004730100002)(11100500001)(66066001)(102836003)(5003600100002)(586003)(3660700001)(110136002)(3846002)(2906002)(76576001)(6116002)(8936002)(19580395003)(5002640100001)(19580405001)(9686002)(189998001)(101416001)(106356001)(33656002)(105586002)(2950100001)(2900100001)(68736007)(106116001)(87936001)(10400500002)(85182001)(50986999)(8676002)(74316001)(81156014)(7846002)(86362001)(81166006); DIR:OUT; SFP:1101; SCL:1; SRVR:OSXPR01MB0408; H:OSXPR01MB0408.jpnprd01.prod.outlook.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:0; LANG:en; received-spf: None (protection.outlook.com: jp.alps.com does not designate permitted sender hosts) spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: jp.alps.com X-MS-Exchange-CrossTenant-originalarrivaltime: 20 Jun 2016 09:45:02.3910 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 57e76998-77bd-4b82-a424-198f46eb2254 X-MS-Exchange-Transport-CrossTenantHeadersStamped: OSXPR01MB0408 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Hi, fengguang, ret = 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); I tested this code, but our device cannot work on it. So, I think we should modify the code as below. ret = hid_hw_raw_request(hdev, U1_FEATURE_REPORT_ID, input, sizeof(u8)*U1_FEATURE_REPORT_LEN, HID_FEATURE_REPORT, HID_REQ_SET_REPORT); Best Regards, Masaki Ota -----Original Message----- From: kbuild test robot [mailto:fengguang.wu@intel.com] Sent: Saturday, June 18, 2016 9:13 PM Cc: kbuild-all@01.org; linux-input@vger.kernel.org; linux-usb@vger.kernel.org; Jiri Kosina; 太田 真喜 Masaki Ota Subject: [PATCH] HID: fix noderef.cocci warnings drivers/hid/hid-alps.c:139:3-9: ERROR: application of sizeof to pointer drivers/hid/hid-alps.c:148:4-10: 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: Masaki Ota Signed-off-by: Fengguang Wu --- hid-alps.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) if (read_flag) { ret = hid_hw_raw_request(hdev, U1_FEATURE_REPORT_ID, readbuf, - sizeof(readbuf), HID_FEATURE_REPORT, + sizeof(*readbuf), HID_FEATURE_REPORT, HID_REQ_GET_REPORT); 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 --- a/drivers/hid/hid-alps.c +++ b/drivers/hid/hid-alps.c @@ -136,7 +136,8 @@ static int u1_read_write_register(struct input[7] = check_sum; ret = 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); 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