linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [linux-next:master 3879/7050] drivers/scsi/qla2xxx/qla_os.c:5929:30: sparse: sparse: incorrect type in assignment (different base types)
@ 2020-03-07 22:13 kbuild test robot
  0 siblings, 0 replies; only message in thread
From: kbuild test robot @ 2020-03-07 22:13 UTC (permalink / raw)
  To: Andrew Morton; +Cc: kbuild-all, Linux Memory Management List

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   b86a6a241b7c60ca7a6ca4fb3c0d2aedbbf2c1b6
commit: d83a80ee57f0cb38baccc75e96bc56ac47d300b3 [3879/7050] scsi: qla2xxx: Add vendor extended RDP additions and amendments
reproduce:
        # apt-get install sparse
        # sparse version: v0.6.1-174-g094d5a94-dirty
        git checkout d83a80ee57f0cb38baccc75e96bc56ac47d300b3
        make ARCH=x86_64 allmodconfig
        make C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__'

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@intel.com>


sparse warnings: (new ones prefixed by >>)

   drivers/scsi/qla2xxx/qla_os.c:4470:45: sparse: sparse: incorrect type in assignment (different base types) @@    expected unsigned short [usertype] exchange_count @@    got resunsigned short [usertype] exchange_count @@
   drivers/scsi/qla2xxx/qla_os.c:4470:45: sparse:    expected unsigned short [usertype] exchange_count
   drivers/scsi/qla2xxx/qla_os.c:4470:45: sparse:    got restricted __le16 [usertype]
   drivers/scsi/qla2xxx/qla_os.c:4481:45: sparse: sparse: incorrect type in assignment (different base types) @@    expected unsigned short [usertype] exchange_count @@    got resunsigned short [usertype] exchange_count @@
   drivers/scsi/qla2xxx/qla_os.c:4481:45: sparse:    expected unsigned short [usertype] exchange_count
   drivers/scsi/qla2xxx/qla_os.c:4481:45: sparse:    got restricted __le16 [usertype]
   drivers/scsi/qla2xxx/qla_os.c:4581:45: sparse: sparse: incorrect type in assignment (different base types) @@    expected unsigned short [usertype] exchange_count @@    got resunsigned short [usertype] exchange_count @@
   drivers/scsi/qla2xxx/qla_os.c:4581:45: sparse:    expected unsigned short [usertype] exchange_count
   drivers/scsi/qla2xxx/qla_os.c:4581:45: sparse:    got restricted __le16 [usertype]
   drivers/scsi/qla2xxx/qla_os.c:5132:41: sparse: sparse: cast to restricted __le16
   drivers/scsi/qla2xxx/qla_os.c:5136:37: sparse: sparse: cast to restricted __le16
   drivers/scsi/qla2xxx/qla_os.c:5922:50: sparse: sparse: incorrect type in assignment (different base types) @@    expected restricted __le32 [usertype] tx_len @@    got 2 [usertype] tx_len @@
   drivers/scsi/qla2xxx/qla_os.c:5922:50: sparse:    expected restricted __le32 [usertype] tx_len
   drivers/scsi/qla2xxx/qla_os.c:5922:50: sparse:    got unsigned long
>> drivers/scsi/qla2xxx/qla_os.c:5929:30: sparse: sparse: incorrect type in assignment (different base types) @@    expected unsigned int [usertype] cmd @@    got restrunsigned int [usertype] cmd @@
   drivers/scsi/qla2xxx/qla_os.c:5929:30: sparse:    expected unsigned int [usertype] cmd
   drivers/scsi/qla2xxx/qla_os.c:5929:30: sparse:    got restricted __be32 [usertype]
   drivers/scsi/qla2xxx/qla_os.c:5930:32: sparse: sparse: restricted __le32 degrades to integer
   drivers/scsi/qla2xxx/qla_os.c:5930:32: sparse: sparse: restricted __le32 degrades to integer
   drivers/scsi/qla2xxx/qla_os.c:5930:32: sparse: sparse: restricted __le32 degrades to integer
   drivers/scsi/qla2xxx/qla_os.c:5930:32: sparse: sparse: restricted __le32 degrades to integer
   drivers/scsi/qla2xxx/qla_os.c:5930:32: sparse: sparse: restricted __le32 degrades to integer
   drivers/scsi/qla2xxx/qla_os.c:5930:32: sparse: sparse: restricted __le32 degrades to integer
>> drivers/scsi/qla2xxx/qla_os.c:5930:30: sparse: sparse: incorrect type in assignment (different base types) @@    expected unsigned int [usertype] len @@    got restrunsigned int [usertype] len @@
   drivers/scsi/qla2xxx/qla_os.c:5930:30: sparse:    expected unsigned int [usertype] len
   drivers/scsi/qla2xxx/qla_os.c:5930:30: sparse:    got restricted __be32 [usertype]
>> drivers/scsi/qla2xxx/qla_os.c:5934:48: sparse: sparse: incorrect type in assignment (different base types) @@    expected unsigned int [usertype] desc_tag @@    got restrunsigned int [usertype] desc_tag @@
   drivers/scsi/qla2xxx/qla_os.c:5934:48: sparse:    expected unsigned int [usertype] desc_tag
   drivers/scsi/qla2xxx/qla_os.c:5934:48: sparse:    got restricted __be32 [usertype]
>> drivers/scsi/qla2xxx/qla_os.c:5935:48: sparse: sparse: incorrect type in assignment (different base types) @@    expected unsigned int [usertype] desc_len @@    got restrunsigned int [usertype] desc_len @@
   drivers/scsi/qla2xxx/qla_os.c:5935:48: sparse:    expected unsigned int [usertype] desc_len
   drivers/scsi/qla2xxx/qla_os.c:5935:48: sparse:    got restricted __be32 [usertype]
>> drivers/scsi/qla2xxx/qla_os.c:5937:58: sparse: sparse: incorrect type in assignment (different base types) @@    expected unsigned int [usertype] req_payload_word_0 @@    got d int [usertype] req_payload_word_0 @@
   drivers/scsi/qla2xxx/qla_os.c:5937:58: sparse:    expected unsigned int [usertype] req_payload_word_0
   drivers/scsi/qla2xxx/qla_os.c:5937:58: sparse:    got restricted __be32
   drivers/scsi/qla2xxx/qla_os.c:5941:49: sparse: sparse: incorrect type in assignment (different base types) @@    expected unsigned int [usertype] desc_tag @@    got restrunsigned int [usertype] desc_tag @@
   drivers/scsi/qla2xxx/qla_os.c:5941:49: sparse:    expected unsigned int [usertype] desc_tag
   drivers/scsi/qla2xxx/qla_os.c:5941:49: sparse:    got restricted __be32 [usertype]
   drivers/scsi/qla2xxx/qla_os.c:5942:49: sparse: sparse: incorrect type in assignment (different base types) @@    expected unsigned int [usertype] desc_len @@    got restrunsigned int [usertype] desc_len @@
   drivers/scsi/qla2xxx/qla_os.c:5942:49: sparse:    expected unsigned int [usertype] desc_len
   drivers/scsi/qla2xxx/qla_os.c:5942:49: sparse:    got restricted __be32 [usertype]
   drivers/scsi/qla2xxx/qla_os.c:5944:59: sparse: sparse: incorrect type in assignment (different base types) @@    expected unsigned int [usertype] req_payload_word_0 @@    got d int [usertype] req_payload_word_0 @@
   drivers/scsi/qla2xxx/qla_os.c:5944:59: sparse:    expected unsigned int [usertype] req_payload_word_0
   drivers/scsi/qla2xxx/qla_os.c:5944:59: sparse:    got restricted __be32
   drivers/scsi/qla2xxx/qla_os.c:5976:61: sparse: sparse: incorrect type in assignment (different base types) @@    expected unsigned int [usertype] desc_tag @@    got restrunsigned int [usertype] desc_tag @@
   drivers/scsi/qla2xxx/qla_os.c:5976:61: sparse:    expected unsigned int [usertype] desc_tag
   drivers/scsi/qla2xxx/qla_os.c:5976:61: sparse:    got restricted __be32 [usertype]
   drivers/scsi/qla2xxx/qla_os.c:5978:61: sparse: sparse: incorrect type in assignment (different base types) @@    expected unsigned int [usertype] desc_len @@    got restrunsigned int [usertype] desc_len @@
   drivers/scsi/qla2xxx/qla_os.c:5978:61: sparse:    expected unsigned int [usertype] desc_len
   drivers/scsi/qla2xxx/qla_os.c:5978:61: sparse:    got restricted __be32 [usertype]
>> drivers/scsi/qla2xxx/qla_os.c:5985:62: sparse: sparse: incorrect type in assignment (different base types) @@    expected unsigned short [usertype] sfp_flags @@    got resunsigned short [usertype] sfp_flags @@
   drivers/scsi/qla2xxx/qla_os.c:5985:62: sparse:    expected unsigned short [usertype] sfp_flags
   drivers/scsi/qla2xxx/qla_os.c:5985:62: sparse:    got restricted __be16 [usertype]
   drivers/scsi/qla2xxx/qla_os.c:5991:47: sparse: sparse: incorrect type in assignment (different base types) @@    expected unsigned int [usertype] desc_tag @@    got restrunsigned int [usertype] desc_tag @@
   drivers/scsi/qla2xxx/qla_os.c:5991:47: sparse:    expected unsigned int [usertype] desc_tag
   drivers/scsi/qla2xxx/qla_os.c:5991:47: sparse:    got restricted __be32 [usertype]
   drivers/scsi/qla2xxx/qla_os.c:5992:47: sparse: sparse: incorrect type in assignment (different base types) @@    expected unsigned int [usertype] desc_len @@    got restrunsigned int [usertype] desc_len @@
   drivers/scsi/qla2xxx/qla_os.c:5992:47: sparse:    expected unsigned int [usertype] desc_len
   drivers/scsi/qla2xxx/qla_os.c:5992:47: sparse:    got restricted __be32 [usertype]
>> drivers/scsi/qla2xxx/qla_os.c:5994:50: sparse: sparse: incorrect type in assignment (different base types) @@    expected unsigned short [usertype] speed_capab @@    got resunsigned short [usertype] speed_capab @@
   drivers/scsi/qla2xxx/qla_os.c:5994:50: sparse:    expected unsigned short [usertype] speed_capab
   drivers/scsi/qla2xxx/qla_os.c:5994:50: sparse:    got restricted __be16 [usertype]
>> drivers/scsi/qla2xxx/qla_os.c:5996:54: sparse: sparse: incorrect type in assignment (different base types) @@    expected unsigned short [usertype] operating_speed @@    got resunsigned short [usertype] operating_speed @@
   drivers/scsi/qla2xxx/qla_os.c:5996:54: sparse:    expected unsigned short [usertype] operating_speed
   drivers/scsi/qla2xxx/qla_os.c:5996:54: sparse:    got restricted __be16 [usertype]
   drivers/scsi/qla2xxx/qla_os.c:6003:59: sparse: sparse: incorrect type in assignment (different base types) @@    expected unsigned int [usertype] desc_tag @@    got restrunsigned int [usertype] desc_tag @@
   drivers/scsi/qla2xxx/qla_os.c:6003:59: sparse:    expected unsigned int [usertype] desc_tag
   drivers/scsi/qla2xxx/qla_os.c:6003:59: sparse:    got restricted __be32 [usertype]
   drivers/scsi/qla2xxx/qla_os.c:6005:59: sparse: sparse: incorrect type in assignment (different base types) @@    expected unsigned int [usertype] desc_len @@    got restrunsigned int [usertype] desc_len @@
   drivers/scsi/qla2xxx/qla_os.c:6005:59: sparse:    expected unsigned int [usertype] desc_len
   drivers/scsi/qla2xxx/qla_os.c:6005:59: sparse:    got restricted __be32 [usertype]
   drivers/scsi/qla2xxx/qla_os.c:6008:29: sparse: sparse: cast from restricted __le32
>> drivers/scsi/qla2xxx/qla_os.c:6008:29: sparse: sparse: incorrect type in argument 1 (different base types) @@    expected unsigned int [usertype] val @@    got restrunsigned int [usertype] val @@
   drivers/scsi/qla2xxx/qla_os.c:6008:29: sparse:    expected unsigned int [usertype] val
   drivers/scsi/qla2xxx/qla_os.c:6008:29: sparse:    got restricted __le32 [usertype] link_fail_cnt
   drivers/scsi/qla2xxx/qla_os.c:6008:29: sparse: sparse: cast from restricted __le32
   drivers/scsi/qla2xxx/qla_os.c:6008:29: sparse: sparse: cast from restricted __le32
   drivers/scsi/qla2xxx/qla_os.c:6008:29: sparse: sparse: cast from restricted __le32
   drivers/scsi/qla2xxx/qla_os.c:6008:29: sparse: sparse: cast from restricted __le32
>> drivers/scsi/qla2xxx/qla_os.c:6007:64: sparse: sparse: incorrect type in assignment (different base types) @@    expected unsigned int [usertype] link_fail_cnt @@    got restrunsigned int [usertype] link_fail_cnt @@
   drivers/scsi/qla2xxx/qla_os.c:6007:64: sparse:    expected unsigned int [usertype] link_fail_cnt
   drivers/scsi/qla2xxx/qla_os.c:6007:64: sparse:    got restricted __be32 [usertype]
   drivers/scsi/qla2xxx/qla_os.c:6010:29: sparse: sparse: cast from restricted __le32
   drivers/scsi/qla2xxx/qla_os.c:6010:29: sparse: sparse: incorrect type in argument 1 (different base types) @@    expected unsigned int [usertype] val @@    got restrunsigned int [usertype] val @@
   drivers/scsi/qla2xxx/qla_os.c:6010:29: sparse:    expected unsigned int [usertype] val
   drivers/scsi/qla2xxx/qla_os.c:6010:29: sparse:    got restricted __le32 [usertype] loss_sync_cnt
   drivers/scsi/qla2xxx/qla_os.c:6010:29: sparse: sparse: cast from restricted __le32
   drivers/scsi/qla2xxx/qla_os.c:6010:29: sparse: sparse: cast from restricted __le32
   drivers/scsi/qla2xxx/qla_os.c:6010:29: sparse: sparse: cast from restricted __le32
   drivers/scsi/qla2xxx/qla_os.c:6010:29: sparse: sparse: cast from restricted __le32
>> drivers/scsi/qla2xxx/qla_os.c:6009:64: sparse: sparse: incorrect type in assignment (different base types) @@    expected unsigned int [usertype] loss_sync_cnt @@    got restrunsigned int [usertype] loss_sync_cnt @@
   drivers/scsi/qla2xxx/qla_os.c:6009:64: sparse:    expected unsigned int [usertype] loss_sync_cnt
   drivers/scsi/qla2xxx/qla_os.c:6009:64: sparse:    got restricted __be32 [usertype]
   drivers/scsi/qla2xxx/qla_os.c:6012:29: sparse: sparse: cast from restricted __le32
   drivers/scsi/qla2xxx/qla_os.c:6012:29: sparse: sparse: incorrect type in argument 1 (different base types) @@    expected unsigned int [usertype] val @@    got restrunsigned int [usertype] val @@
   drivers/scsi/qla2xxx/qla_os.c:6012:29: sparse:    expected unsigned int [usertype] val
   drivers/scsi/qla2xxx/qla_os.c:6012:29: sparse:    got restricted __le32 [usertype] loss_sig_cnt
   drivers/scsi/qla2xxx/qla_os.c:6012:29: sparse: sparse: cast from restricted __le32
   drivers/scsi/qla2xxx/qla_os.c:6012:29: sparse: sparse: cast from restricted __le32
   drivers/scsi/qla2xxx/qla_os.c:6012:29: sparse: sparse: cast from restricted __le32
   drivers/scsi/qla2xxx/qla_os.c:6012:29: sparse: sparse: cast from restricted __le32
>> drivers/scsi/qla2xxx/qla_os.c:6011:63: sparse: sparse: incorrect type in assignment (different base types) @@    expected unsigned int [usertype] loss_sig_cnt @@    got restrunsigned int [usertype] loss_sig_cnt @@
   drivers/scsi/qla2xxx/qla_os.c:6011:63: sparse:    expected unsigned int [usertype] loss_sig_cnt
   drivers/scsi/qla2xxx/qla_os.c:6011:63: sparse:    got restricted __be32 [usertype]
   drivers/scsi/qla2xxx/qla_os.c:6014:29: sparse: sparse: cast from restricted __le32
   drivers/scsi/qla2xxx/qla_os.c:6014:29: sparse: sparse: incorrect type in argument 1 (different base types) @@    expected unsigned int [usertype] val @@    got restrunsigned int [usertype] val @@
   drivers/scsi/qla2xxx/qla_os.c:6014:29: sparse:    expected unsigned int [usertype] val
   drivers/scsi/qla2xxx/qla_os.c:6014:29: sparse:    got restricted __le32 [usertype] prim_seq_err_cnt
   drivers/scsi/qla2xxx/qla_os.c:6014:29: sparse: sparse: cast from restricted __le32
   drivers/scsi/qla2xxx/qla_os.c:6014:29: sparse: sparse: cast from restricted __le32
   drivers/scsi/qla2xxx/qla_os.c:6014:29: sparse: sparse: cast from restricted __le32
   drivers/scsi/qla2xxx/qla_os.c:6014:29: sparse: sparse: cast from restricted __le32
>> drivers/scsi/qla2xxx/qla_os.c:6013:67: sparse: sparse: incorrect type in assignment (different base types) @@    expected unsigned int [usertype] prim_seq_err_cnt @@    got restrunsigned int [usertype] prim_seq_err_cnt @@
   drivers/scsi/qla2xxx/qla_os.c:6013:67: sparse:    expected unsigned int [usertype] prim_seq_err_cnt
   drivers/scsi/qla2xxx/qla_os.c:6013:67: sparse:    got restricted __be32 [usertype]
   drivers/scsi/qla2xxx/qla_os.c:6016:29: sparse: sparse: cast from restricted __le32
   drivers/scsi/qla2xxx/qla_os.c:6016:29: sparse: sparse: incorrect type in argument 1 (different base types) @@    expected unsigned int [usertype] val @@    got restrunsigned int [usertype] val @@
   drivers/scsi/qla2xxx/qla_os.c:6016:29: sparse:    expected unsigned int [usertype] val
   drivers/scsi/qla2xxx/qla_os.c:6016:29: sparse:    got restricted __le32 [usertype] inval_xmit_word_cnt
   drivers/scsi/qla2xxx/qla_os.c:6016:29: sparse: sparse: cast from restricted __le32
   drivers/scsi/qla2xxx/qla_os.c:6016:29: sparse: sparse: cast from restricted __le32
   drivers/scsi/qla2xxx/qla_os.c:6016:29: sparse: sparse: cast from restricted __le32
   drivers/scsi/qla2xxx/qla_os.c:6016:29: sparse: sparse: cast from restricted __le32
>> drivers/scsi/qla2xxx/qla_os.c:6015:70: sparse: sparse: incorrect type in assignment (different base types) @@    expected unsigned int [usertype] inval_xmit_word_cnt @@    got restrunsigned int [usertype] inval_xmit_word_cnt @@
   drivers/scsi/qla2xxx/qla_os.c:6015:70: sparse:    expected unsigned int [usertype] inval_xmit_word_cnt
   drivers/scsi/qla2xxx/qla_os.c:6015:70: sparse:    got restricted __be32 [usertype]
   drivers/scsi/qla2xxx/qla_os.c:6018:29: sparse: sparse: cast from restricted __le32
   drivers/scsi/qla2xxx/qla_os.c:6018:29: sparse: sparse: incorrect type in argument 1 (different base types) @@    expected unsigned int [usertype] val @@    got restrunsigned int [usertype] val @@
   drivers/scsi/qla2xxx/qla_os.c:6018:29: sparse:    expected unsigned int [usertype] val
   drivers/scsi/qla2xxx/qla_os.c:6018:29: sparse:    got restricted __le32 [usertype] inval_crc_cnt
   drivers/scsi/qla2xxx/qla_os.c:6018:29: sparse: sparse: cast from restricted __le32
   drivers/scsi/qla2xxx/qla_os.c:6018:29: sparse: sparse: cast from restricted __le32
   drivers/scsi/qla2xxx/qla_os.c:6018:29: sparse: sparse: cast from restricted __le32
   drivers/scsi/qla2xxx/qla_os.c:6018:29: sparse: sparse: cast from restricted __le32
>> drivers/scsi/qla2xxx/qla_os.c:6017:64: sparse: sparse: incorrect type in assignment (different base types) @@    expected unsigned int [usertype] inval_crc_cnt @@    got restrunsigned int [usertype] inval_crc_cnt @@
   drivers/scsi/qla2xxx/qla_os.c:6017:64: sparse:    expected unsigned int [usertype] inval_crc_cnt
   drivers/scsi/qla2xxx/qla_os.c:6017:64: sparse:    got restricted __be32 [usertype]
   drivers/scsi/qla2xxx/qla_os.c:6024:51: sparse: sparse: incorrect type in assignment (different base types) @@    expected unsigned int [usertype] desc_tag @@    got restrunsigned int [usertype] desc_tag @@
   drivers/scsi/qla2xxx/qla_os.c:6024:51: sparse:    expected unsigned int [usertype] desc_tag
   drivers/scsi/qla2xxx/qla_os.c:6024:51: sparse:    got restricted __be32 [usertype]
   drivers/scsi/qla2xxx/qla_os.c:6025:51: sparse: sparse: incorrect type in assignment (different base types) @@    expected unsigned int [usertype] desc_len @@    got restrunsigned int [usertype] desc_len @@
   drivers/scsi/qla2xxx/qla_os.c:6025:51: sparse:    expected unsigned int [usertype] desc_len
   drivers/scsi/qla2xxx/qla_os.c:6025:51: sparse:    got restricted __be32 [usertype]
   drivers/scsi/qla2xxx/qla_os.c:6035:53: sparse: sparse: incorrect type in assignment (different base types) @@    expected unsigned int [usertype] desc_tag @@    got restrunsigned int [usertype] desc_tag @@
   drivers/scsi/qla2xxx/qla_os.c:6035:53: sparse:    expected unsigned int [usertype] desc_tag
   drivers/scsi/qla2xxx/qla_os.c:6035:53: sparse:    got restricted __be32 [usertype]
   drivers/scsi/qla2xxx/qla_os.c:6036:53: sparse: sparse: incorrect type in assignment (different base types) @@    expected unsigned int [usertype] desc_len @@    got restrunsigned int [usertype] desc_len @@
   drivers/scsi/qla2xxx/qla_os.c:6036:53: sparse:    expected unsigned int [usertype] desc_len
   drivers/scsi/qla2xxx/qla_os.c:6036:53: sparse:    got restricted __be32 [usertype]
   drivers/scsi/qla2xxx/qla_os.c:6045:20: sparse: sparse: restricted __le32 degrades to integer
   drivers/scsi/qla2xxx/qla_os.c:6053:66: sparse: sparse: incorrect type in assignment (different base types) @@    expected unsigned int [usertype] desc_tag @@    got restrunsigned int [usertype] desc_tag @@
   drivers/scsi/qla2xxx/qla_os.c:6053:66: sparse:    expected unsigned int [usertype] desc_tag
   drivers/scsi/qla2xxx/qla_os.c:6053:66: sparse:    got restricted __be32 [usertype]
   drivers/scsi/qla2xxx/qla_os.c:6055:66: sparse: sparse: incorrect type in assignment (different base types) @@    expected unsigned int [usertype] desc_len @@    got restrunsigned int [usertype] desc_len @@
   drivers/scsi/qla2xxx/qla_os.c:6055:66: sparse:    expected unsigned int [usertype] desc_len
   drivers/scsi/qla2xxx/qla_os.c:6055:66: sparse:    got restricted __be32 [usertype]
>> drivers/scsi/qla2xxx/qla_os.c:6058:68: sparse: sparse: incorrect type in assignment (different base types) @@    expected unsigned int [usertype] fcport_b2b @@    got restrunsigned int [usertype] fcport_b2b @@
   drivers/scsi/qla2xxx/qla_os.c:6058:68: sparse:    expected unsigned int [usertype] fcport_b2b
   drivers/scsi/qla2xxx/qla_os.c:6058:68: sparse:    got restricted __be32 [usertype]
>> drivers/scsi/qla2xxx/qla_os.c:6060:77: sparse: sparse: incorrect type in assignment (different base types) @@    expected unsigned int [usertype] attached_fcport_b2b @@    got restrunsigned int [usertype] attached_fcport_b2b @@
   drivers/scsi/qla2xxx/qla_os.c:6060:77: sparse:    expected unsigned int [usertype] attached_fcport_b2b
   drivers/scsi/qla2xxx/qla_os.c:6060:77: sparse:    got restricted __be32 [usertype]
>> drivers/scsi/qla2xxx/qla_os.c:6062:68: sparse: sparse: incorrect type in assignment (different base types) @@    expected unsigned int [usertype] fcport_rtt @@    got restrunsigned int [usertype] fcport_rtt @@
   drivers/scsi/qla2xxx/qla_os.c:6062:68: sparse:    expected unsigned int [usertype] fcport_rtt
   drivers/scsi/qla2xxx/qla_os.c:6062:68: sparse:    got restricted __be32 [usertype]
   drivers/scsi/qla2xxx/qla_os.c:6074:68: sparse: sparse: incorrect type in assignment (different base types) @@    expected unsigned int [usertype] desc_tag @@    got restrunsigned int [usertype] desc_tag @@
   drivers/scsi/qla2xxx/qla_os.c:6074:68: sparse:    expected unsigned int [usertype] desc_tag
   drivers/scsi/qla2xxx/qla_os.c:6074:68: sparse:    got restricted __be32 [usertype]
   drivers/scsi/qla2xxx/qla_os.c:6076:68: sparse: sparse: incorrect type in assignment (different base types) @@    expected unsigned int [usertype] desc_len @@    got restrunsigned int [usertype] desc_len @@
   drivers/scsi/qla2xxx/qla_os.c:6076:68: sparse:    expected unsigned int [usertype] desc_len
   drivers/scsi/qla2xxx/qla_os.c:6076:68: sparse:    got restricted __be32 [usertype]
>> drivers/scsi/qla2xxx/qla_os.c:6083:73: sparse: sparse: incorrect type in assignment (different base types) @@    expected unsigned int [usertype] element_flags @@    got restrunsigned int [usertype] element_flags @@
   drivers/scsi/qla2xxx/qla_os.c:6083:73: sparse:    expected unsigned int [usertype] element_flags
   drivers/scsi/qla2xxx/qla_os.c:6083:73: sparse:    got restricted __be32 [usertype]
   drivers/scsi/qla2xxx/qla_os.c:6087:68: sparse: sparse: incorrect type in assignment (different base types) @@    expected unsigned int [usertype] desc_tag @@    got restrunsigned int [usertype] desc_tag @@
   drivers/scsi/qla2xxx/qla_os.c:6087:68: sparse:    expected unsigned int [usertype] desc_tag
   drivers/scsi/qla2xxx/qla_os.c:6087:68: sparse:    got restricted __be32 [usertype]
   drivers/scsi/qla2xxx/qla_os.c:6089:68: sparse: sparse: incorrect type in assignment (different base types) @@    expected unsigned int [usertype] desc_len @@    got restrunsigned int [usertype] desc_len @@
   drivers/scsi/qla2xxx/qla_os.c:6089:68: sparse:    expected unsigned int [usertype] desc_len
   drivers/scsi/qla2xxx/qla_os.c:6089:68: sparse:    got restricted __be32 [usertype]
   drivers/scsi/qla2xxx/qla_os.c:6096:73: sparse: sparse: incorrect type in assignment (different base types) @@    expected unsigned int [usertype] element_flags @@    got restrunsigned int [usertype] element_flags @@
   drivers/scsi/qla2xxx/qla_os.c:6096:73: sparse:    expected unsigned int [usertype] element_flags
   drivers/scsi/qla2xxx/qla_os.c:6096:73: sparse:    got restricted __be32 [usertype]
   drivers/scsi/qla2xxx/qla_os.c:6100:68: sparse: sparse: incorrect type in assignment (different base types) @@    expected unsigned int [usertype] desc_tag @@    got restrunsigned int [usertype] desc_tag @@
   drivers/scsi/qla2xxx/qla_os.c:6100:68: sparse:    expected unsigned int [usertype] desc_tag
   drivers/scsi/qla2xxx/qla_os.c:6100:68: sparse:    got restricted __be32 [usertype]
   drivers/scsi/qla2xxx/qla_os.c:6102:68: sparse: sparse: incorrect type in assignment (different base types) @@    expected unsigned int [usertype] desc_len @@    got restrunsigned int [usertype] desc_len @@
   drivers/scsi/qla2xxx/qla_os.c:6102:68: sparse:    expected unsigned int [usertype] desc_len
   drivers/scsi/qla2xxx/qla_os.c:6102:68: sparse:    got restricted __be32 [usertype]
   drivers/scsi/qla2xxx/qla_os.c:6109:73: sparse: sparse: incorrect type in assignment (different base types) @@    expected unsigned int [usertype] element_flags @@    got restrunsigned int [usertype] element_flags @@
   drivers/scsi/qla2xxx/qla_os.c:6109:73: sparse:    expected unsigned int [usertype] element_flags
   drivers/scsi/qla2xxx/qla_os.c:6109:73: sparse:    got restricted __be32 [usertype]
   drivers/scsi/qla2xxx/qla_os.c:6113:68: sparse: sparse: incorrect type in assignment (different base types) @@    expected unsigned int [usertype] desc_tag @@    got restrunsigned int [usertype] desc_tag @@
   drivers/scsi/qla2xxx/qla_os.c:6113:68: sparse:    expected unsigned int [usertype] desc_tag
   drivers/scsi/qla2xxx/qla_os.c:6113:68: sparse:    got restricted __be32 [usertype]
   drivers/scsi/qla2xxx/qla_os.c:6115:68: sparse: sparse: incorrect type in assignment (different base types) @@    expected unsigned int [usertype] desc_len @@    got restrunsigned int [usertype] desc_len @@
   drivers/scsi/qla2xxx/qla_os.c:6115:68: sparse:    expected unsigned int [usertype] desc_len
   drivers/scsi/qla2xxx/qla_os.c:6115:68: sparse:    got restricted __be32 [usertype]
   drivers/scsi/qla2xxx/qla_os.c:6122:73: sparse: sparse: incorrect type in assignment (different base types) @@    expected unsigned int [usertype] element_flags @@    got restrunsigned int [usertype] element_flags @@
   drivers/scsi/qla2xxx/qla_os.c:6122:73: sparse:    expected unsigned int [usertype] element_flags
   drivers/scsi/qla2xxx/qla_os.c:6122:73: sparse:    got restricted __be32 [usertype]
   drivers/scsi/qla2xxx/qla_os.c:6126:68: sparse: sparse: incorrect type in assignment (different base types) @@    expected unsigned int [usertype] desc_tag @@    got restrunsigned int [usertype] desc_tag @@
   drivers/scsi/qla2xxx/qla_os.c:6126:68: sparse:    expected unsigned int [usertype] desc_tag
   drivers/scsi/qla2xxx/qla_os.c:6126:68: sparse:    got restricted __be32 [usertype]
   drivers/scsi/qla2xxx/qla_os.c:6128:68: sparse: sparse: incorrect type in assignment (different base types) @@    expected unsigned int [usertype] desc_len @@    got restrunsigned int [usertype] desc_len @@
   drivers/scsi/qla2xxx/qla_os.c:6128:68: sparse:    expected unsigned int [usertype] desc_len
   drivers/scsi/qla2xxx/qla_os.c:6128:68: sparse:    got restricted __be32 [usertype]
   drivers/scsi/qla2xxx/qla_os.c:6135:73: sparse: sparse: incorrect type in assignment (different base types) @@    expected unsigned int [usertype] element_flags @@    got restrunsigned int [usertype] element_flags @@
   drivers/scsi/qla2xxx/qla_os.c:6135:73: sparse:    expected unsigned int [usertype] element_flags
   drivers/scsi/qla2xxx/qla_os.c:6135:73: sparse:    got restricted __be32 [usertype]
   drivers/scsi/qla2xxx/qla_os.c:6143:73: sparse: sparse: invalid assignment: |=
   drivers/scsi/qla2xxx/qla_os.c:6143:73: sparse:    left side has type unsigned int
   drivers/scsi/qla2xxx/qla_os.c:6143:73: sparse:    right side has type restricted __be32
   drivers/scsi/qla2xxx/qla_os.c:6151:73: sparse: sparse: invalid assignment: |=
   drivers/scsi/qla2xxx/qla_os.c:6151:73: sparse:    left side has type unsigned int
   drivers/scsi/qla2xxx/qla_os.c:6151:73: sparse:    right side has type restricted __be32
   drivers/scsi/qla2xxx/qla_os.c:6159:73: sparse: sparse: invalid assignment: |=
   drivers/scsi/qla2xxx/qla_os.c:6159:73: sparse:    left side has type unsigned int
   drivers/scsi/qla2xxx/qla_os.c:6159:73: sparse:    right side has type restricted __be32
   drivers/scsi/qla2xxx/qla_os.c:6167:73: sparse: sparse: too many warnings

vim +5929 drivers/scsi/qla2xxx/qla_os.c

  5815	
  5816	/*
  5817	 * Function Name: qla24xx_process_purex_iocb
  5818	 *
  5819	 * Description:
  5820	 * Prepare a RDP response and send to Fabric switch
  5821	 *
  5822	 * PARAMETERS:
  5823	 * vha:	SCSI qla host
  5824	 * purex: RDP request received by HBA
  5825	 */
  5826	static int qla24xx_process_purex_iocb(struct scsi_qla_host *vha, void *pkt)
  5827	{
  5828		struct qla_hw_data *ha = vha->hw;
  5829		struct purex_entry_24xx *purex = pkt;
  5830		struct port_database_24xx *pdb = NULL;
  5831		dma_addr_t rsp_els_dma;
  5832		dma_addr_t rsp_payload_dma;
  5833		dma_addr_t stat_dma;
  5834		dma_addr_t bbc_dma;
  5835		dma_addr_t sfp_dma;
  5836		struct els_entry_24xx *rsp_els = NULL;
  5837		struct rdp_rsp_payload *rsp_payload = NULL;
  5838		struct link_statistics *stat = NULL;
  5839		struct buffer_credit_24xx *bbc = NULL;
  5840		uint8_t *sfp = NULL;
  5841		uint16_t sfp_flags = 0;
  5842		int rval = -ENOMEM;
  5843	
  5844		ql_dbg(ql_dbg_init + ql_dbg_verbose, vha, 0x0180,
  5845		    "%s: Enter\n", __func__);
  5846	
  5847		ql_dbg(ql_dbg_init + ql_dbg_verbose, vha, 0x0181,
  5848		    "-------- ELS REQ -------\n");
  5849		ql_dump_buffer(ql_dbg_init + ql_dbg_verbose, vha, 0x0182,
  5850		    (void *)purex, sizeof(*purex));
  5851	
  5852		rsp_els = dma_alloc_coherent(&ha->pdev->dev, sizeof(*rsp_els),
  5853		    &rsp_els_dma, GFP_KERNEL);
  5854		if (!rsp_els)
  5855			goto dealloc;
  5856	
  5857		rsp_payload = dma_alloc_coherent(&ha->pdev->dev, sizeof(*rsp_payload),
  5858		    &rsp_payload_dma, GFP_KERNEL);
  5859		if (!rsp_payload)
  5860			goto dealloc;
  5861	
  5862		sfp = dma_alloc_coherent(&ha->pdev->dev, SFP_RTDI_LEN,
  5863		    &sfp_dma, GFP_KERNEL);
  5864	
  5865		stat = dma_alloc_coherent(&ha->pdev->dev, sizeof(*stat),
  5866		    &stat_dma, GFP_KERNEL);
  5867	
  5868		bbc = dma_alloc_coherent(&ha->pdev->dev, sizeof(*bbc),
  5869		    &bbc_dma, GFP_KERNEL);
  5870	
  5871		/* Prepare Response IOCB */
  5872		memset(rsp_els, 0, sizeof(*rsp_els));
  5873		rsp_els->entry_type = ELS_IOCB_TYPE;
  5874		rsp_els->entry_count = 1;
  5875		rsp_els->sys_define = 0;
  5876		rsp_els->entry_status = 0;
  5877		rsp_els->handle = 0;
  5878		rsp_els->nport_handle = purex->nport_handle;
  5879		rsp_els->tx_dsd_count = 1;
  5880		rsp_els->vp_index = purex->vp_idx;
  5881		rsp_els->sof_type = EST_SOFI3;
  5882		rsp_els->rx_xchg_address = purex->rx_xchg_addr;
  5883		rsp_els->rx_dsd_count = 0;
  5884		rsp_els->opcode = purex->els_frame_payload[0];
  5885	
  5886		rsp_els->port_id[0] = purex->s_id[0];
  5887		rsp_els->port_id[1] = purex->s_id[1];
  5888		rsp_els->port_id[2] = purex->s_id[2];
  5889	
  5890		rsp_els->control_flags = EPD_ELS_ACC;
  5891		rsp_els->rx_byte_count = 0;
  5892		rsp_els->tx_byte_count = cpu_to_le32(sizeof(*rsp_payload));
  5893	
  5894		put_unaligned_le64(rsp_payload_dma, &rsp_els->tx_address);
  5895		rsp_els->tx_len = rsp_els->tx_byte_count;
  5896	
  5897		rsp_els->rx_address = 0;
  5898		rsp_els->rx_len = 0;
  5899	
  5900		if (sizeof(*rsp_payload) <= 0x100)
  5901			goto accept;
  5902	
  5903		pdb = kzalloc(sizeof(*pdb), GFP_KERNEL);
  5904		if (!pdb)
  5905			goto reduce;
  5906	
  5907		rval = qla24xx_get_port_database(vha, purex->nport_handle, pdb);
  5908		if (rval)
  5909			goto reduce;
  5910	
  5911		if (pdb->port_id[0] != purex->s_id[2] ||
  5912		    pdb->port_id[1] != purex->s_id[1] ||
  5913		    pdb->port_id[2] != purex->s_id[0])
  5914			goto reduce;
  5915	
  5916		if (pdb->current_login_state == PDS_PLOGI_COMPLETE ||
  5917		    pdb->current_login_state == PDS_PRLI_COMPLETE)
  5918			goto accept;
  5919	
  5920	reduce:
  5921		ql_dbg(ql_dbg_init, vha, 0x016e, "Requesting port is not logged in.\n");
  5922		rsp_els->tx_byte_count = rsp_els->tx_len =
  5923		    offsetof(struct rdp_rsp_payload, buffer_credit_desc);
  5924		ql_dbg(ql_dbg_init, vha, 0x016f, "Reduced response payload size %u.\n",
  5925		    rsp_els->tx_byte_count);
  5926	
  5927	accept:
  5928		/* Prepare Response Payload */
> 5929		rsp_payload->hdr.cmd = cpu_to_be32(0x2 << 24); /* LS_ACC */
> 5930		rsp_payload->hdr.len = cpu_to_be32(
  5931		    rsp_els->tx_byte_count - sizeof(rsp_payload->hdr));
  5932	
  5933		/* Link service Request Info Descriptor */
> 5934		rsp_payload->ls_req_info_desc.desc_tag = cpu_to_be32(0x1);
> 5935		rsp_payload->ls_req_info_desc.desc_len =
  5936		    cpu_to_be32(RDP_DESC_LEN(rsp_payload->ls_req_info_desc));
> 5937		rsp_payload->ls_req_info_desc.req_payload_word_0 =
  5938		    cpu_to_be32p((uint32_t *)purex->els_frame_payload);
  5939	
  5940		/* Link service Request Info Descriptor 2 */
  5941		rsp_payload->ls_req_info_desc2.desc_tag = cpu_to_be32(0x1);
  5942		rsp_payload->ls_req_info_desc2.desc_len =
  5943		    cpu_to_be32(RDP_DESC_LEN(rsp_payload->ls_req_info_desc2));
> 5944		rsp_payload->ls_req_info_desc2.req_payload_word_0 =
  5945		    cpu_to_be32p((uint32_t *)purex->els_frame_payload);
  5946	
  5947		if (sfp) {
  5948			/* SFP Flags */
  5949			memset(sfp, 0, SFP_RTDI_LEN);
  5950			rval = qla2x00_read_sfp(vha, sfp_dma, sfp, 0xa0, 0x7, 2, 0);
  5951			if (!rval) {
  5952				/* SFP Flags bits 3-0: Port Tx Laser Type */
  5953				if (sfp[0] & BIT_2 || sfp[1] & (BIT_6|BIT_5))
  5954					sfp_flags |= BIT_0; /* short wave */
  5955				else if (sfp[0] & BIT_1)
  5956					sfp_flags |= BIT_1; /* long wave 1310nm */
  5957				else if (sfp[1] & BIT_4)
  5958					sfp_flags |= BIT_1|BIT_0; /* long wave 1550nm */
  5959			}
  5960	
  5961			/* SFP Type */
  5962			memset(sfp, 0, SFP_RTDI_LEN);
  5963			rval = qla2x00_read_sfp(vha, sfp_dma, sfp, 0xa0, 0x0, 1, 0);
  5964			if (!rval) {
  5965				sfp_flags |= BIT_4; /* optical */
  5966				if (sfp[0] == 0x3)
  5967					sfp_flags |= BIT_6; /* sfp+ */
  5968			}
  5969	
  5970			/* SFP Diagnostics */
  5971			memset(sfp, 0, SFP_RTDI_LEN);
  5972			rval = qla2x00_read_sfp(vha, sfp_dma, sfp, 0xa2, 0x60, 10, 0);
  5973			if (!rval && sfp_flags) {
  5974				uint16_t *trx = (void *)sfp; /* already be16 */
  5975	
  5976				rsp_payload->sfp_diag_desc.desc_tag =
  5977				    cpu_to_be32(0x10000);
  5978				rsp_payload->sfp_diag_desc.desc_len =
  5979				    cpu_to_be32(RDP_DESC_LEN(rsp_payload->sfp_diag_desc));
  5980				rsp_payload->sfp_diag_desc.temperature = trx[0];
  5981				rsp_payload->sfp_diag_desc.vcc = trx[1];
  5982				rsp_payload->sfp_diag_desc.tx_bias = trx[2];
  5983				rsp_payload->sfp_diag_desc.tx_power = trx[3];
  5984				rsp_payload->sfp_diag_desc.rx_power = trx[4];
> 5985				rsp_payload->sfp_diag_desc.sfp_flags =
  5986				    cpu_to_be16(sfp_flags);
  5987			}
  5988		}
  5989	
  5990		/* Port Speed Descriptor */
> 5991		rsp_payload->port_speed_desc.desc_tag = cpu_to_be32(0x10001);
  5992		rsp_payload->port_speed_desc.desc_len =
  5993		    cpu_to_be32(RDP_DESC_LEN(rsp_payload->port_speed_desc));
> 5994		rsp_payload->port_speed_desc.speed_capab = cpu_to_be16(
  5995		    qla25xx_rdp_port_speed_capability(ha));
> 5996		rsp_payload->port_speed_desc.operating_speed = cpu_to_be16(
  5997		    qla25xx_rdp_port_speed_currently(ha));
  5998	
  5999		if (stat) {
  6000			rval = qla24xx_get_isp_stats(vha, stat, stat_dma, 0);
  6001			if (!rval) {
  6002				/* Link Error Status Descriptor */
  6003				rsp_payload->ls_err_desc.desc_tag =
  6004				    cpu_to_be32(0x10002);
> 6005				rsp_payload->ls_err_desc.desc_len =
  6006				    cpu_to_be32(RDP_DESC_LEN(rsp_payload->ls_err_desc));
> 6007				rsp_payload->ls_err_desc.link_fail_cnt =
> 6008				    cpu_to_be32(stat->link_fail_cnt);
> 6009				rsp_payload->ls_err_desc.loss_sync_cnt =
  6010				    cpu_to_be32(stat->loss_sync_cnt);
> 6011				rsp_payload->ls_err_desc.loss_sig_cnt =
  6012				    cpu_to_be32(stat->loss_sig_cnt);
> 6013				rsp_payload->ls_err_desc.prim_seq_err_cnt =
  6014				    cpu_to_be32(stat->prim_seq_err_cnt);
> 6015				rsp_payload->ls_err_desc.inval_xmit_word_cnt =
  6016				    cpu_to_be32(stat->inval_xmit_word_cnt);
> 6017				rsp_payload->ls_err_desc.inval_crc_cnt =
  6018				    cpu_to_be32(stat->inval_crc_cnt);
  6019				rsp_payload->ls_err_desc.pn_port_phy_type |= BIT_6;
  6020			}
  6021		}
  6022	
  6023		/* Portname Descriptor */
  6024		rsp_payload->port_name_diag_desc.desc_tag = cpu_to_be32(0x10003);
  6025		rsp_payload->port_name_diag_desc.desc_len =
  6026		    cpu_to_be32(RDP_DESC_LEN(rsp_payload->port_name_diag_desc));
  6027		memcpy(rsp_payload->port_name_diag_desc.WWNN,
  6028		    vha->node_name,
  6029		    sizeof(rsp_payload->port_name_diag_desc.WWNN));
  6030		memcpy(rsp_payload->port_name_diag_desc.WWPN,
  6031		    vha->port_name,
  6032		    sizeof(rsp_payload->port_name_diag_desc.WWPN));
  6033	
  6034		/* F-Port Portname Descriptor */
  6035		rsp_payload->port_name_direct_desc.desc_tag = cpu_to_be32(0x10003);
> 6036		rsp_payload->port_name_direct_desc.desc_len =
  6037		    cpu_to_be32(RDP_DESC_LEN(rsp_payload->port_name_direct_desc));
  6038		memcpy(rsp_payload->port_name_direct_desc.WWNN,
  6039		    vha->fabric_node_name,
  6040		    sizeof(rsp_payload->port_name_direct_desc.WWNN));
  6041		memcpy(rsp_payload->port_name_direct_desc.WWPN,
  6042		    vha->fabric_port_name,
  6043		    sizeof(rsp_payload->port_name_direct_desc.WWPN));
  6044	
  6045		if (rsp_els->tx_byte_count < sizeof(*rsp_payload))
  6046			goto send;
  6047	
  6048		if (bbc) {
  6049			memset(bbc, 0, sizeof(*bbc));
  6050			rval = qla24xx_get_buffer_credits(vha, bbc, bbc_dma);
  6051			if (!rval) {
  6052				/* Bufer Credit Descriptor */
> 6053				rsp_payload->buffer_credit_desc.desc_tag =
  6054				    cpu_to_be32(0x10006);
> 6055				rsp_payload->buffer_credit_desc.desc_len =
  6056				    cpu_to_be32(RDP_DESC_LEN(
  6057					rsp_payload->buffer_credit_desc));
> 6058				rsp_payload->buffer_credit_desc.fcport_b2b =
  6059				    cpu_to_be32(LSW(bbc->parameter[0]));
> 6060				rsp_payload->buffer_credit_desc.attached_fcport_b2b =
  6061				    cpu_to_be32(0);
> 6062				rsp_payload->buffer_credit_desc.fcport_rtt =
  6063				    cpu_to_be32(0);
  6064			}
  6065		}
  6066	
  6067		if (sfp) {
  6068			memset(sfp, 0, SFP_RTDI_LEN);
  6069			rval = qla2x00_read_sfp(vha, sfp_dma, sfp, 0xa2, 0, 64, 0);
  6070			if (!rval) {
  6071				uint16_t *trx = (void *)sfp; /* already be16 */
  6072	
  6073				/* Optical Element Descriptor, Temperature */
  6074				rsp_payload->optical_elmt_desc[0].desc_tag =
  6075				    cpu_to_be32(0x10007);
  6076				rsp_payload->optical_elmt_desc[0].desc_len =
  6077				    cpu_to_be32(RDP_DESC_LEN(
  6078					*rsp_payload->optical_elmt_desc));
  6079				rsp_payload->optical_elmt_desc[0].high_alarm = trx[0];
  6080				rsp_payload->optical_elmt_desc[0].low_alarm = trx[1];
  6081				rsp_payload->optical_elmt_desc[0].high_warn = trx[2];
  6082				rsp_payload->optical_elmt_desc[0].low_warn = trx[3];
> 6083				rsp_payload->optical_elmt_desc[0].element_flags =
  6084				    cpu_to_be32(1 << 28);
  6085	
  6086				/* Optical Element Descriptor, Voltage */
  6087				rsp_payload->optical_elmt_desc[1].desc_tag =
  6088				    cpu_to_be32(0x10007);
  6089				rsp_payload->optical_elmt_desc[1].desc_len =
  6090				    cpu_to_be32(RDP_DESC_LEN(
  6091					*rsp_payload->optical_elmt_desc));
  6092				rsp_payload->optical_elmt_desc[1].high_alarm = trx[4];
  6093				rsp_payload->optical_elmt_desc[1].low_alarm = trx[5];
  6094				rsp_payload->optical_elmt_desc[1].high_warn = trx[6];
  6095				rsp_payload->optical_elmt_desc[1].low_warn = trx[7];
  6096				rsp_payload->optical_elmt_desc[1].element_flags =
  6097				    cpu_to_be32(2 << 28);
  6098	
  6099				/* Optical Element Descriptor, Tx Bias Current */
  6100				rsp_payload->optical_elmt_desc[2].desc_tag =
  6101				    cpu_to_be32(0x10007);
  6102				rsp_payload->optical_elmt_desc[2].desc_len =
  6103				    cpu_to_be32(RDP_DESC_LEN(
  6104					*rsp_payload->optical_elmt_desc));
  6105				rsp_payload->optical_elmt_desc[2].high_alarm = trx[8];
  6106				rsp_payload->optical_elmt_desc[2].low_alarm = trx[9];
  6107				rsp_payload->optical_elmt_desc[2].high_warn = trx[10];
  6108				rsp_payload->optical_elmt_desc[2].low_warn = trx[11];
  6109				rsp_payload->optical_elmt_desc[2].element_flags =
  6110				    cpu_to_be32(3 << 28);
  6111	
  6112				/* Optical Element Descriptor, Tx Power */
  6113				rsp_payload->optical_elmt_desc[3].desc_tag =
  6114				    cpu_to_be32(0x10007);
  6115				rsp_payload->optical_elmt_desc[3].desc_len =
  6116				    cpu_to_be32(RDP_DESC_LEN(
  6117					*rsp_payload->optical_elmt_desc));
  6118				rsp_payload->optical_elmt_desc[3].high_alarm = trx[12];
  6119				rsp_payload->optical_elmt_desc[3].low_alarm = trx[13];
  6120				rsp_payload->optical_elmt_desc[3].high_warn = trx[14];
  6121				rsp_payload->optical_elmt_desc[3].low_warn = trx[15];
  6122				rsp_payload->optical_elmt_desc[3].element_flags =
  6123				    cpu_to_be32(4 << 28);
  6124	
  6125				/* Optical Element Descriptor, Rx Power */
  6126				rsp_payload->optical_elmt_desc[4].desc_tag =
  6127				    cpu_to_be32(0x10007);
  6128				rsp_payload->optical_elmt_desc[4].desc_len =
  6129				    cpu_to_be32(RDP_DESC_LEN(
  6130					*rsp_payload->optical_elmt_desc));
  6131				rsp_payload->optical_elmt_desc[4].high_alarm = trx[16];
  6132				rsp_payload->optical_elmt_desc[4].low_alarm = trx[17];
  6133				rsp_payload->optical_elmt_desc[4].high_warn = trx[18];
  6134				rsp_payload->optical_elmt_desc[4].low_warn = trx[19];
  6135				rsp_payload->optical_elmt_desc[4].element_flags =
  6136				    cpu_to_be32(5 << 28);
  6137			}
  6138	
  6139			memset(sfp, 0, SFP_RTDI_LEN);
  6140			rval = qla2x00_read_sfp(vha, sfp_dma, sfp, 0xa2, 112, 64, 0);
  6141			if (!rval) {
  6142				/* Temperature high/low alarm/warning */
  6143				rsp_payload->optical_elmt_desc[0].element_flags |=
  6144				    cpu_to_be32(
  6145					(sfp[0] >> 7 & 1) << 3 |
  6146					(sfp[0] >> 6 & 1) << 2 |
  6147					(sfp[4] >> 7 & 1) << 1 |
  6148					(sfp[4] >> 6 & 1) << 0);
  6149	
  6150				/* Voltage high/low alarm/warning */
  6151				rsp_payload->optical_elmt_desc[1].element_flags |=
  6152				    cpu_to_be32(
  6153					(sfp[0] >> 5 & 1) << 3 |
  6154					(sfp[0] >> 4 & 1) << 2 |
  6155					(sfp[4] >> 5 & 1) << 1 |
  6156					(sfp[4] >> 4 & 1) << 0);
  6157	
  6158				/* Tx Bias Current high/low alarm/warning */
  6159				rsp_payload->optical_elmt_desc[2].element_flags |=
  6160				    cpu_to_be32(
  6161					(sfp[0] >> 3 & 1) << 3 |
  6162					(sfp[0] >> 2 & 1) << 2 |
  6163					(sfp[4] >> 3 & 1) << 1 |
  6164					(sfp[4] >> 2 & 1) << 0);
  6165	
  6166				/* Tx Power high/low alarm/warning */
  6167				rsp_payload->optical_elmt_desc[3].element_flags |=
  6168				    cpu_to_be32(
  6169					(sfp[0] >> 1 & 1) << 3 |
  6170					(sfp[0] >> 0 & 1) << 2 |
  6171					(sfp[4] >> 1 & 1) << 1 |
  6172					(sfp[4] >> 0 & 1) << 0);
  6173	
  6174				/* Rx Power high/low alarm/warning */
  6175				rsp_payload->optical_elmt_desc[4].element_flags |=
  6176				    cpu_to_be32(
  6177					(sfp[1] >> 7 & 1) << 3 |
  6178					(sfp[1] >> 6 & 1) << 2 |
  6179					(sfp[5] >> 7 & 1) << 1 |
  6180					(sfp[5] >> 6 & 1) << 0);
  6181			}
  6182		}
  6183	
  6184		if (sfp) {
  6185			memset(sfp, 0, SFP_RTDI_LEN);
  6186			rval = qla2x00_read_sfp(vha, sfp_dma, sfp, 0xa0, 20, 64, 0);
  6187			if (!rval) {
  6188				/* Optical Product Data Descriptor */
  6189				rsp_payload->optical_prod_desc.desc_tag =
  6190				    cpu_to_be32(0x10008);
  6191				rsp_payload->optical_prod_desc.desc_len =
  6192				    cpu_to_be32(RDP_DESC_LEN(
  6193					rsp_payload->optical_prod_desc));
  6194				memcpy(rsp_payload->optical_prod_desc.vendor_name,
  6195				    sfp + 0,
  6196				    sizeof(rsp_payload->optical_prod_desc.vendor_name));
  6197				memcpy(rsp_payload->optical_prod_desc.part_number,
  6198				    sfp + 20,
  6199				    sizeof(rsp_payload->optical_prod_desc.part_number));
  6200				memcpy(rsp_payload->optical_prod_desc.revision,
  6201				    sfp + 36,
  6202				    sizeof(rsp_payload->optical_prod_desc.revision));
  6203				memcpy(rsp_payload->optical_prod_desc.serial_number,
  6204				    sfp + 48,
  6205				    sizeof(rsp_payload->optical_prod_desc.serial_number));
  6206			}
  6207	
  6208			memset(sfp, 0, SFP_RTDI_LEN);
  6209			rval = qla2x00_read_sfp(vha, sfp_dma, sfp, 0xa0, 84, 8, 0);
  6210			if (!rval) {
  6211				memcpy(rsp_payload->optical_prod_desc.date,
  6212				    sfp + 0,
  6213				    sizeof(rsp_payload->optical_prod_desc.date));
  6214			}
  6215		}
  6216	
  6217	send:
  6218		ql_dbg(ql_dbg_init, vha, 0x0183,
  6219		    "Sending ELS Response to RDP Request...\n");
  6220		ql_dbg(ql_dbg_init + ql_dbg_verbose, vha, 0x0184,
  6221		    "-------- ELS RSP -------\n");
  6222		ql_dump_buffer(ql_dbg_init + ql_dbg_verbose, vha, 0x0185,
  6223		    (void *)rsp_els, sizeof(*rsp_els));
  6224		ql_dbg(ql_dbg_init + ql_dbg_verbose, vha, 0x0186,
  6225		    "-------- ELS RSP PAYLOAD -------\n");
  6226		ql_dump_buffer(ql_dbg_init + ql_dbg_verbose, vha, 0x0187,
  6227		    (void *)rsp_payload, rsp_els->tx_byte_count);
  6228	
  6229		rval = qla2x00_issue_iocb(vha, rsp_els, rsp_els_dma, 0);
  6230	
  6231		if (rval != QLA_SUCCESS) {
  6232			ql_log(ql_log_warn, vha, 0x0188,
  6233			    "%s: failed to issue IOCB (%x).\n", __func__, rval);
  6234		} else if (rsp_els->entry_status != 0) {
  6235			ql_log(ql_log_warn, vha, 0x0189,
  6236			    "%s: failed to complete IOCB -- error status (%x).\n",
  6237			    __func__, rsp_els->entry_status);
  6238			rval = QLA_FUNCTION_FAILED;
  6239		} else {
  6240			ql_dbg(ql_dbg_init, vha, 0x018a, "%s: done.\n", __func__);
  6241		}
  6242	
  6243	dealloc:
  6244		kfree(pdb);
  6245	
  6246		if (bbc)
  6247			dma_free_coherent(&ha->pdev->dev, sizeof(*bbc),
  6248			    bbc, bbc_dma);
  6249		if (stat)
  6250			dma_free_coherent(&ha->pdev->dev, sizeof(*stat),
  6251			    stat, stat_dma);
  6252		if (sfp)
  6253			dma_free_coherent(&ha->pdev->dev, SFP_RTDI_LEN,
  6254			    sfp, sfp_dma);
  6255		if (rsp_payload)
  6256			dma_free_coherent(&ha->pdev->dev, sizeof(*rsp_payload),
  6257			    rsp_payload, rsp_payload_dma);
  6258		if (rsp_els)
  6259			dma_free_coherent(&ha->pdev->dev, sizeof(*rsp_els),
  6260			    rsp_els, rsp_els_dma);
  6261	
  6262		return rval;
  6263	}
  6264	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-03-07 22:13 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-07 22:13 [linux-next:master 3879/7050] drivers/scsi/qla2xxx/qla_os.c:5929:30: sparse: sparse: incorrect type in assignment (different base types) kbuild test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).