• Arnd Bergmann's avatar
    scsi: bfa: fix type conversion warning · 48d83282
    Arnd Bergmann authored
    A regression fix introduced a harmless type mismatch warning:
    
    drivers/scsi/bfa/bfad_bsg.c: In function 'bfad_im_bsg_vendor_request':
    drivers/scsi/bfa/bfad_bsg.c:3137:35: error: initialization of 'struct bfad_im_port_s *' from 'long unsigned int' makes pointer from integer without a cast [-Werror=int-conversion]
      struct bfad_im_port_s *im_port = shost->hostdata[0];
                                       ^~~~~
    drivers/scsi/bfa/bfad_bsg.c: In function 'bfad_im_bsg_els_ct_request':
    drivers/scsi/bfa/bfad_bsg.c:3353:35: error: initialization of 'struct bfad_im_port_s *' from 'long unsigned int' makes pointer from integer without a cast [-Werror=int-conversion]
      struct bfad_im_port_s *im_port = shost->hostdata[0];
    
    This changes the code back to shost_priv() once more, but encapsulates
    it in an inline function to document the rather unusual way of
    using the private data only as a pointer to the previously allocated
    structure.
    
    I did not try to get rid of the extra indirection level entirely,
    which would have been rather invasive and required reworking the entire
    initialization sequence.
    
    Fixes: 45349821 ("scsi: bfa: fix access to bfad_im_port_s")
    Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
    Reviewed-by: default avatarJohannes Thumshirn <jthumshirn@suse.de>
    Reviewed-by: default avatarHannes Reinecke <hare@suse.com>
    Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
    48d83282
bfad_im.c 34.8 KB