linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: kbuild test robot <fengguang.wu-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Cc: kbuild-all-JC7UmRfGjtg@public.gmane.org,
	linux-input-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Jiri Kosina <jkosina-AlSwsSmVLrQ@public.gmane.org>,
	Masaki Ota <masaki.ota-Ej8lA1M1qLxBDgjK7y7TUQ@public.gmane.org>
Subject: [PATCH] HID: fix noderef.cocci warnings
Date: Sat, 18 Jun 2016 20:13:15 +0800	[thread overview]
Message-ID: <20160618121314.GA95633@lkp-ib04> (raw)
In-Reply-To: <201606182012.7NLmbFhz%fengguang.wu-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>

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 <masaki.ota-Ej8lA1M1qLxBDgjK7y7TUQ@public.gmane.org>
Signed-off-by: Fengguang Wu <fengguang.wu-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
---

 hid-alps.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

--- 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
 
 	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-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2016-06-18 12:13 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-18 12:13 [hid:for-4.8/alps 1/2] drivers/hid/hid-alps.c:139:3-9: ERROR: application of sizeof to pointer kbuild test robot
     [not found] ` <201606182012.7NLmbFhz%fengguang.wu-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2016-06-18 12:13   ` kbuild test robot [this message]
2016-06-20  9:45     ` [PATCH] HID: fix noderef.cocci warnings Masaki Ota
2016-06-20 10:02       ` Fengguang Wu
     [not found]       ` <OSXPR01MB0408C44F44A1B06579D0BCB7C72A0-x3s0nd+sA3ZOfzQfux4QuHcolHNk5qUtvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2016-06-20 10:40         ` 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=20160618121314.GA95633@lkp-ib04 \
    --to=fengguang.wu-ral2jqcrhueavxtiumwx3w@public.gmane.org \
    --cc=jkosina-AlSwsSmVLrQ@public.gmane.org \
    --cc=kbuild-all-JC7UmRfGjtg@public.gmane.org \
    --cc=linux-input-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=masaki.ota-Ej8lA1M1qLxBDgjK7y7TUQ@public.gmane.org \
    /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).