From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754308AbcKUMGP (ORCPT ); Mon, 21 Nov 2016 07:06:15 -0500 Received: from mga07.intel.com ([134.134.136.100]:57125 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754191AbcKUMGM (ORCPT ); Mon, 21 Nov 2016 07:06:12 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,675,1473145200"; d="scan'208";a="903912784" Date: Mon, 21 Nov 2016 20:05:31 +0800 From: kbuild test robot To: Benjamin Tissoires Cc: kbuild-all@01.org, Jiri Kosina , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] HID: lg: fix noderef.cocci warnings 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 Content-Disposition: inline In-Reply-To: <1479725322-30863-3-git-send-email-benjamin.tissoires@redhat.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: fengguang.wu@intel.com X-SA-Exim-Scanned: No (on bee); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@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); }