[SCSI] bfa: driver compatibility with 32bit libs
authorVijaya Mohan Guvva <vmohan@brocade.com>
Mon, 13 May 2013 09:33:27 +0000 (02:33 -0700)
committerJames Bottomley <JBottomley@Parallels.com>
Wed, 26 Jun 2013 20:49:49 +0000 (13:49 -0700)
Replaced usage of void * with u64 in data structure shared between
brocade user space libraries and the bfa driver to address pointer
size changes across 32-bit vs 64-bit to have the compatibility between
32bit library and 64bit driver and vice versa.

Signed-off-by: Vijaya Mohan Guvva <vmohan@brocade.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
drivers/scsi/bfa/bfad_bsg.c
drivers/scsi/bfa/bfad_bsg.h

index f31acfa..9863b1c 100644 (file)
@@ -3371,7 +3371,8 @@ bfad_im_bsg_els_ct_request(struct fc_bsg_job *job)
                goto out;
        }
 
-       if (copy_from_user((uint8_t *)bsg_fcpt, bsg_data->payload,
+       if (copy_from_user((uint8_t *)bsg_fcpt,
+                               (void *)(unsigned long)bsg_data->payload,
                                bsg_data->payload_len)) {
                kfree(bsg_fcpt);
                rc = -EIO;
@@ -3525,8 +3526,8 @@ out_free_mem:
        kfree(rsp_kbuf);
 
        /* Need a copy to user op */
-       if (copy_to_user(bsg_data->payload, (void *) bsg_fcpt,
-                        bsg_data->payload_len))
+       if (copy_to_user((void *)(unsigned long)bsg_data->payload,
+                       (void *)bsg_fcpt, bsg_data->payload_len))
                rc = -EIO;
 
        kfree(bsg_fcpt);
index 3ef321c..b0b5ac7 100644 (file)
@@ -819,10 +819,12 @@ struct bfa_bsg_fcpt_s {
 };
 #define bfa_bsg_fcpt_t struct bfa_bsg_fcpt_s
 
+#pragma pack(1)
 struct bfa_bsg_data {
        int payload_len;
-       void *payload;
+       u64 payload;
 };
+#pragma pack()
 
 #define bfad_chk_iocmd_sz(__payload_len, __hdrsz, __bufsz)     \
        (((__payload_len) != ((__hdrsz) + (__bufsz))) ?         \