Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[SCSI] bfa: driver compatibility with 32bit libs

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>

authored by

Vijaya Mohan Guvva and committed by
James Bottomley
bccd2683 c679b599

+7 -4
+4 -3
drivers/scsi/bfa/bfad_bsg.c
··· 3371 3371 goto out; 3372 3372 } 3373 3373 3374 - if (copy_from_user((uint8_t *)bsg_fcpt, bsg_data->payload, 3374 + if (copy_from_user((uint8_t *)bsg_fcpt, 3375 + (void *)(unsigned long)bsg_data->payload, 3375 3376 bsg_data->payload_len)) { 3376 3377 kfree(bsg_fcpt); 3377 3378 rc = -EIO; ··· 3526 3525 kfree(rsp_kbuf); 3527 3526 3528 3527 /* Need a copy to user op */ 3529 - if (copy_to_user(bsg_data->payload, (void *) bsg_fcpt, 3530 - bsg_data->payload_len)) 3528 + if (copy_to_user((void *)(unsigned long)bsg_data->payload, 3529 + (void *)bsg_fcpt, bsg_data->payload_len)) 3531 3530 rc = -EIO; 3532 3531 3533 3532 kfree(bsg_fcpt);
+3 -1
drivers/scsi/bfa/bfad_bsg.h
··· 819 819 }; 820 820 #define bfa_bsg_fcpt_t struct bfa_bsg_fcpt_s 821 821 822 + #pragma pack(1) 822 823 struct bfa_bsg_data { 823 824 int payload_len; 824 - void *payload; 825 + u64 payload; 825 826 }; 827 + #pragma pack() 826 828 827 829 #define bfad_chk_iocmd_sz(__payload_len, __hdrsz, __bufsz) \ 828 830 (((__payload_len) != ((__hdrsz) + (__bufsz))) ? \