lkml.org 
[lkml]   [2018]   [Aug]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] block: fix noderef.cocci warnings
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));
\
 
 \ /
  Last update: 2018-08-14 02:01    [W:2.038 / U:0.232 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site