summaryrefslogtreecommitdiff
path: root/drivers/target/target_core_rd.c
diff options
context:
space:
mode:
authorMarkus Elfring <elfring@users.sourceforge.net>2017-04-09 20:15:12 +0200
committerNicholas Bellinger <nab@linux-iscsi.org>2017-05-01 22:21:30 -0700
commit5d68fb72d3780555752bcf2526f759f953e08bc3 (patch)
treea685c86aa6e05d75a14e78da65bca7220b74f510 /drivers/target/target_core_rd.c
parentfbc4040bf67b10ee66097c9603550773a3bc5c06 (diff)
downloadlinux-5d68fb72d3780555752bcf2526f759f953e08bc3.tar.gz
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: Markus Elfring <elfring@users.sourceforge.net> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'drivers/target/target_core_rd.c')
-rw-r--r--drivers/target/target_core_rd.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/target/target_core_rd.c b/drivers/target/target_core_rd.c
index 838dc128d494..20253d04103f 100644
--- a/drivers/target/target_core_rd.c
+++ b/drivers/target/target_core_rd.c
@@ -47,7 +47,7 @@ static int rd_attach_hba(struct se_hba *hba, u32 host_id)
{
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)
return -ENOMEM;
@@ -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_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)
return NULL;