Commit 9dfeb315 authored by Hillf Danton's avatar Hillf Danton Committed by James Bottomley

[SCSI] scsi_dh: cosmetic change to sizeof()

instead of doing sizeof(struct X) it's better to do sizeof(*v) where v
is the variable pointing to struct X.
Signed-off-by: default avatarHillf Danton <dhillf@gmail.com>
Signed-off-by: default avatarBabu Moger <babu.moger@lsi.com>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@suse.de>
parent 04b6e153
...@@ -763,7 +763,7 @@ static int alua_bus_attach(struct scsi_device *sdev) ...@@ -763,7 +763,7 @@ static int alua_bus_attach(struct scsi_device *sdev)
unsigned long flags; unsigned long flags;
int err = SCSI_DH_OK; int err = SCSI_DH_OK;
scsi_dh_data = kzalloc(sizeof(struct scsi_device_handler *) scsi_dh_data = kzalloc(sizeof(*scsi_dh_data)
+ sizeof(*h) , GFP_KERNEL); + sizeof(*h) , GFP_KERNEL);
if (!scsi_dh_data) { if (!scsi_dh_data) {
sdev_printk(KERN_ERR, sdev, "%s: Attach failed\n", sdev_printk(KERN_ERR, sdev, "%s: Attach failed\n",
......
...@@ -650,7 +650,7 @@ static int clariion_bus_attach(struct scsi_device *sdev) ...@@ -650,7 +650,7 @@ static int clariion_bus_attach(struct scsi_device *sdev)
unsigned long flags; unsigned long flags;
int err; int err;
scsi_dh_data = kzalloc(sizeof(struct scsi_device_handler *) scsi_dh_data = kzalloc(sizeof(*scsi_dh_data)
+ sizeof(*h) , GFP_KERNEL); + sizeof(*h) , GFP_KERNEL);
if (!scsi_dh_data) { if (!scsi_dh_data) {
sdev_printk(KERN_ERR, sdev, "%s: Attach failed\n", sdev_printk(KERN_ERR, sdev, "%s: Attach failed\n",
......
...@@ -339,8 +339,8 @@ static int hp_sw_bus_attach(struct scsi_device *sdev) ...@@ -339,8 +339,8 @@ static int hp_sw_bus_attach(struct scsi_device *sdev)
unsigned long flags; unsigned long flags;
int ret; int ret;
scsi_dh_data = kzalloc(sizeof(struct scsi_device_handler *) scsi_dh_data = kzalloc(sizeof(*scsi_dh_data)
+ sizeof(struct hp_sw_dh_data) , GFP_KERNEL); + sizeof(*h) , GFP_KERNEL);
if (!scsi_dh_data) { if (!scsi_dh_data) {
sdev_printk(KERN_ERR, sdev, "%s: Attach Failed\n", sdev_printk(KERN_ERR, sdev, "%s: Attach Failed\n",
HP_SW_NAME); HP_SW_NAME);
......
...@@ -798,7 +798,7 @@ static int rdac_bus_attach(struct scsi_device *sdev) ...@@ -798,7 +798,7 @@ static int rdac_bus_attach(struct scsi_device *sdev)
int err; int err;
char array_name[ARRAY_LABEL_LEN]; char array_name[ARRAY_LABEL_LEN];
scsi_dh_data = kzalloc(sizeof(struct scsi_device_handler *) scsi_dh_data = kzalloc(sizeof(*scsi_dh_data)
+ sizeof(*h) , GFP_KERNEL); + sizeof(*h) , GFP_KERNEL);
if (!scsi_dh_data) { if (!scsi_dh_data) {
sdev_printk(KERN_ERR, sdev, "%s: Attach failed\n", sdev_printk(KERN_ERR, sdev, "%s: Attach failed\n",
......
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