[SCSI] scsi_dh: cosmetic change to sizeof()
authorHillf Danton <dhillf@gmail.com>
Fri, 11 Feb 2011 22:17:33 +0000 (15:17 -0700)
committerJames Bottomley <James.Bottomley@suse.de>
Sat, 12 Feb 2011 20:13:34 +0000 (14:13 -0600)
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: Hillf Danton <dhillf@gmail.com>
Signed-off-by: Babu Moger <babu.moger@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
drivers/scsi/device_handler/scsi_dh_alua.c
drivers/scsi/device_handler/scsi_dh_emc.c
drivers/scsi/device_handler/scsi_dh_hp_sw.c
drivers/scsi/device_handler/scsi_dh_rdac.c

index 5b6f9ab10d7a971243c50f1e62090fd0eadff5ca..7cae0bc853901c01b9f5bfa3b1167b9150707239 100644 (file)
@@ -763,7 +763,7 @@ static int alua_bus_attach(struct scsi_device *sdev)
        unsigned long flags;
        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);
        if (!scsi_dh_data) {
                sdev_printk(KERN_ERR, sdev, "%s: Attach failed\n",
index 6faf472f7537a4b728d2947ea69647c0a724b14d..48441f6908a4c2f3fa040f9dd54313ae55fb82be 100644 (file)
@@ -650,7 +650,7 @@ static int clariion_bus_attach(struct scsi_device *sdev)
        unsigned long flags;
        int err;
 
-       scsi_dh_data = kzalloc(sizeof(struct scsi_device_handler *)
+       scsi_dh_data = kzalloc(sizeof(*scsi_dh_data)
                               + sizeof(*h) , GFP_KERNEL);
        if (!scsi_dh_data) {
                sdev_printk(KERN_ERR, sdev, "%s: Attach failed\n",
index d0363c8fa348852151c69f4a3e0f0f4d314ae4b4..b479f1eef96878ae71f73c2e2d5f1c2bf6f52f51 100644 (file)
@@ -339,8 +339,8 @@ static int hp_sw_bus_attach(struct scsi_device *sdev)
        unsigned long flags;
        int ret;
 
-       scsi_dh_data = kzalloc(sizeof(struct scsi_device_handler *)
-                              + sizeof(struct hp_sw_dh_data) , GFP_KERNEL);
+       scsi_dh_data = kzalloc(sizeof(*scsi_dh_data)
+                              + sizeof(*h) , GFP_KERNEL);
        if (!scsi_dh_data) {
                sdev_printk(KERN_ERR, sdev, "%s: Attach Failed\n",
                            HP_SW_NAME);
index 7d83a84442a7d192c914666ecf6d6822ab950367..bdff28014a2a719ba3436ad0aacef5f934055a90 100644 (file)
@@ -798,7 +798,7 @@ static int rdac_bus_attach(struct scsi_device *sdev)
        int err;
        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);
        if (!scsi_dh_data) {
                sdev_printk(KERN_ERR, sdev, "%s: Attach failed\n",