[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <9c4e9391-324d-8e88-14fb-691035e27a05@users.sourceforge.net>
Date: Sat, 1 Oct 2016 16:54:07 +0200
From: SF Markus Elfring <elfring@...rs.sourceforge.net>
To: linux-raid@...r.kernel.org, Guoqing Jiang <gqjiang@...e.com>,
Shaohua Li <shli@...nel.org>
Cc: LKML <linux-kernel@...r.kernel.org>,
kernel-janitors@...r.kernel.org,
Julia Lawall <julia.lawall@...6.fr>
Subject: [PATCH 09/15] md-cluster: Improve another size determination in
lockres_init()
From: Markus Elfring <elfring@...rs.sourceforge.net>
Date: Sat, 1 Oct 2016 13:02:18 +0200
Replace the specification of a data structure by a pointer dereference
as the parameter for the operator "sizeof" to make the corresponding size
determination a bit safer according to the Linux coding style convention.
Signed-off-by: Markus Elfring <elfring@...rs.sourceforge.net>
---
drivers/md/md-cluster.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/md/md-cluster.c b/drivers/md/md-cluster.c
index 0918108..bec8035 100644
--- a/drivers/md/md-cluster.c
+++ b/drivers/md/md-cluster.c
@@ -190,7 +190,7 @@ static struct dlm_lock_resource *lockres_init(struct mddev *mddev,
int ret, namelen;
struct md_cluster_info *cinfo = mddev->cluster_info;
- res = kzalloc(sizeof(struct dlm_lock_resource), GFP_KERNEL);
+ res = kzalloc(sizeof(*res), GFP_KERNEL);
if (!res)
return NULL;
init_waitqueue_head(&res->sync_locking);
--
2.10.0
Powered by blists - more mailing lists