linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: kbuild test robot <fengguang.wu@intel.com>
To: Bart Van Assche <bart.vanassche@wdc.com>
Cc: kbuild-all@01.org, Jens Axboe <axboe@kernel.dk>,
	linux-block@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] block: fix noderef.cocci warnings
Date: Tue, 14 Aug 2018 07:59:47 +0800	[thread overview]
Message-ID: <20180813235947.GA25573@lkp-sbx04> (raw)
In-Reply-To: <201808140744.LIoM2Vik%fengguang.wu@intel.com>

From: kbuild test robot <fengguang.wu@intel.com>

block/genhd.c:1483:37-43: 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

Fixes: b4032d402850 ("block: Introduce alloc_disk_node_attr()")
Signed-off-by: kbuild test robot <fengguang.wu@intel.com>
---

 genhd.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/block/genhd.c
+++ b/block/genhd.c
@@ -1480,7 +1480,7 @@ struct gendisk *__alloc_disk_node(int mi
 		disk_to_dev(disk)->class = &block_class;
 		disk_to_dev(disk)->type = &disk_type;
 		if (num_groups) {
-			memcpy(disk->ag, ag, num_groups * sizeof(ag));
+			memcpy(disk->ag, ag, num_groups * sizeof(*ag));
 			disk_to_dev(disk)->groups = disk->ag;
 		}
 		device_initialize(disk_to_dev(disk));

           reply	other threads:[~2018-08-13 23:59 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <201808140744.LIoM2Vik%fengguang.wu@intel.com>]

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=20180813235947.GA25573@lkp-sbx04 \
    --to=fengguang.wu@intel.com \
    --cc=axboe@kernel.dk \
    --cc=bart.vanassche@wdc.com \
    --cc=kbuild-all@01.org \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.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).