Commit 5d68fb72 authored by Markus Elfring's avatar Markus Elfring Committed by Nicholas Bellinger

target: Improve size determinations in two functions

Replace the specification of two data structures by pointer dereferences
as the parameter for the operator "sizeof" to make the corresponding size
determinations a bit safer according to the Linux coding style convention.
Signed-off-by: default avatarMarkus Elfring <elfring@users.sourceforge.net>
Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
parent fbc4040b
...@@ -47,7 +47,7 @@ static int rd_attach_hba(struct se_hba *hba, u32 host_id) ...@@ -47,7 +47,7 @@ static int rd_attach_hba(struct se_hba *hba, u32 host_id)
{ {
struct rd_host *rd_host; struct rd_host *rd_host;
rd_host = kzalloc(sizeof(struct rd_host), GFP_KERNEL); rd_host = kzalloc(sizeof(*rd_host), GFP_KERNEL);
if (!rd_host) if (!rd_host)
return -ENOMEM; return -ENOMEM;
...@@ -285,7 +285,7 @@ static struct se_device *rd_alloc_device(struct se_hba *hba, const char *name) ...@@ -285,7 +285,7 @@ static struct se_device *rd_alloc_device(struct se_hba *hba, const char *name)
struct rd_dev *rd_dev; struct rd_dev *rd_dev;
struct rd_host *rd_host = hba->hba_ptr; struct rd_host *rd_host = hba->hba_ptr;
rd_dev = kzalloc(sizeof(struct rd_dev), GFP_KERNEL); rd_dev = kzalloc(sizeof(*rd_dev), GFP_KERNEL);
if (!rd_dev) if (!rd_dev)
return NULL; return NULL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment