From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Tue, 14 Aug 2018 07:59:47 +0800 From: kbuild test robot To: Bart Van Assche Cc: kbuild-all@01.org, Jens Axboe , linux-block@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] block: fix noderef.cocci warnings Message-ID: <20180813235947.GA25573@lkp-sbx04> References: <201808140744.LIoM2Vik%fengguang.wu@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii In-Reply-To: <201808140744.LIoM2Vik%fengguang.wu@intel.com> List-ID: From: kbuild test robot 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 --- 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));