Re: [SCSI] qla2xxx: Enhancements to support ISPFx00.

2016-04-15 Thread Giridhar Malavali


On 4/13/16, 5:39 AM, "Dan Carpenter" <dan.carpen...@oracle.com> wrote:

>Hello Giridhar Malavali,
>
>The patch 8ae6d9c7eb10: "[SCSI] qla2xxx: Enhancements to support
>ISPFx00." from Mar 28, 2013, leads to the following static checker
>warning:
>
>   drivers/scsi/qla2xxx/qla_mr.c:2264 qlafx00_ioctl_iosb_entry()
>   error: uninitialized symbol 'res'.

Dan,

We will rework the patch and post it. Thanks for bringing this to our
attention. 

‹ Giri


>
>drivers/scsi/qla2xxx/qla_mr.c
>  2210  struct srb_iocb *iocb_job;
>  2211  int res;
>^^^
>  2212  struct qla_mt_iocb_rsp_fx00 fstatus;
>  2213  uint8_t *fw_sts_ptr;
>  2214  
>  2215  sp = qla2x00_get_sp_from_handle(vha, func, req, pkt);
>  2216  if (!sp)
>  2217  return;
>  2218  
>  2219  if (sp->type == SRB_FXIOCB_DCMD) {
>  2220  iocb_job = >u.iocb_cmd;
>  2221  iocb_job->u.fxiocb.seq_number = pkt->seq_no;
>    iocb_job->u.fxiocb.fw_flags = pkt->fw_iotcl_flags;
>  2223  iocb_job->u.fxiocb.result = pkt->status;
>  2224  if (iocb_job->u.fxiocb.flags &
>SRB_FXDISC_RSP_DWRD_VALID)
>  2225  iocb_job->u.fxiocb.req_data =
>  2226  pkt->dataword_r;
>
>res isn't set on this path.
>
>  2227  } else {
>  2228  bsg_job = sp->u.bsg_job;
>  2229  
>  2230  memset(, 0, sizeof(struct
>qla_mt_iocb_rsp_fx00));
>  2231  
>  2232  fstatus.reserved_1 = pkt->reserved_0;
>  2233  fstatus.func_type = pkt->comp_func_num;
>  2234  fstatus.ioctl_flags = pkt->fw_iotcl_flags;
>  2235  fstatus.ioctl_data = pkt->dataword_r;
>  2236  fstatus.adapid = pkt->adapid;
>  2237  fstatus.reserved_2 = pkt->dataword_r_extra;
>  2238  fstatus.res_count = pkt->residuallen;
>  2239  fstatus.status = pkt->status;
>  2240  fstatus.seq_number = pkt->seq_no;
>  2241  memcpy(fstatus.reserved_3,
>  2242  pkt->reserved_2, 20 * sizeof(uint8_t));
>  2243  
>  2244  fw_sts_ptr = ((uint8_t *)bsg_job->req->sense) +
>  2245  sizeof(struct fc_bsg_reply);
>  2246  
>  2247  memcpy(fw_sts_ptr, (uint8_t *),
>  2248  sizeof(struct qla_mt_iocb_rsp_fx00));
>  2249  bsg_job->reply_len = sizeof(struct fc_bsg_reply) +
>  2250  sizeof(struct qla_mt_iocb_rsp_fx00) +
>sizeof(uint8_t);
>  2251  
>  2252  ql_dump_buffer(ql_dbg_user + ql_dbg_verbose,
>  2253  sp->fcport->vha, 0x5080,
>  2254  (uint8_t *)pkt, sizeof(struct
>ioctl_iocb_entry_fx00));
>  2255  
>  2256  ql_dump_buffer(ql_dbg_user + ql_dbg_verbose,
>  2257  sp->fcport->vha, 0x5074,
>  2258  (uint8_t *)fw_sts_ptr, sizeof(struct
>qla_mt_iocb_rsp_fx00));
>  2259  
>  2260  res = bsg_job->reply->result = DID_OK << 16;
>  2261  bsg_job->reply->reply_payload_rcv_len =
>  2262  bsg_job->reply_payload.payload_len;
>  2263  }
>  2264  sp->done(vha, sp, res);
>  ^^^
>Uninitialized.
>
>  2265  }
>
>regards,
>dan carpenter

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


re: [SCSI] qla2xxx: Enhancements to support ISPFx00.

2016-04-13 Thread Dan Carpenter
Hello Giridhar Malavali,

The patch 8ae6d9c7eb10: "[SCSI] qla2xxx: Enhancements to support
ISPFx00." from Mar 28, 2013, leads to the following static checker
warning:

drivers/scsi/qla2xxx/qla_mr.c:2264 qlafx00_ioctl_iosb_entry()
error: uninitialized symbol 'res'.

drivers/scsi/qla2xxx/qla_mr.c
  2210  struct srb_iocb *iocb_job;
  2211  int res;
^^^
  2212  struct qla_mt_iocb_rsp_fx00 fstatus;
  2213  uint8_t *fw_sts_ptr;
  2214  
  2215  sp = qla2x00_get_sp_from_handle(vha, func, req, pkt);
  2216  if (!sp)
  2217  return;
  2218  
  2219  if (sp->type == SRB_FXIOCB_DCMD) {
  2220  iocb_job = >u.iocb_cmd;
  2221  iocb_job->u.fxiocb.seq_number = pkt->seq_no;
    iocb_job->u.fxiocb.fw_flags = pkt->fw_iotcl_flags;
  2223  iocb_job->u.fxiocb.result = pkt->status;
  2224  if (iocb_job->u.fxiocb.flags & 
SRB_FXDISC_RSP_DWRD_VALID)
  2225  iocb_job->u.fxiocb.req_data =
  2226  pkt->dataword_r;

res isn't set on this path.

  2227  } else {
  2228  bsg_job = sp->u.bsg_job;
  2229  
  2230  memset(, 0, sizeof(struct 
qla_mt_iocb_rsp_fx00));
  2231  
  2232  fstatus.reserved_1 = pkt->reserved_0;
  2233  fstatus.func_type = pkt->comp_func_num;
  2234  fstatus.ioctl_flags = pkt->fw_iotcl_flags;
  2235  fstatus.ioctl_data = pkt->dataword_r;
  2236  fstatus.adapid = pkt->adapid;
  2237  fstatus.reserved_2 = pkt->dataword_r_extra;
  2238  fstatus.res_count = pkt->residuallen;
  2239  fstatus.status = pkt->status;
  2240  fstatus.seq_number = pkt->seq_no;
  2241  memcpy(fstatus.reserved_3,
  2242  pkt->reserved_2, 20 * sizeof(uint8_t));
  2243  
  2244  fw_sts_ptr = ((uint8_t *)bsg_job->req->sense) +
  2245  sizeof(struct fc_bsg_reply);
  2246  
  2247  memcpy(fw_sts_ptr, (uint8_t *),
  2248  sizeof(struct qla_mt_iocb_rsp_fx00));
  2249  bsg_job->reply_len = sizeof(struct fc_bsg_reply) +
  2250  sizeof(struct qla_mt_iocb_rsp_fx00) + 
sizeof(uint8_t);
  2251  
  2252  ql_dump_buffer(ql_dbg_user + ql_dbg_verbose,
  2253  sp->fcport->vha, 0x5080,
  2254  (uint8_t *)pkt, sizeof(struct 
ioctl_iocb_entry_fx00));
  2255  
  2256  ql_dump_buffer(ql_dbg_user + ql_dbg_verbose,
  2257  sp->fcport->vha, 0x5074,
  2258  (uint8_t *)fw_sts_ptr, sizeof(struct 
qla_mt_iocb_rsp_fx00));
  2259  
  2260  res = bsg_job->reply->result = DID_OK << 16;
  2261  bsg_job->reply->reply_payload_rcv_len =
  2262  bsg_job->reply_payload.payload_len;
  2263  }
  2264  sp->done(vha, sp, res);
  ^^^
Uninitialized.

  2265  }

regards,
dan carpenter
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


re: [SCSI] qla2xxx: Enhancements to support ISPFx00.

2013-04-15 Thread Dan Carpenter
Hello Giridhar Malavali,

The patch 8ae6d9c7eb10: [SCSI] qla2xxx: Enhancements to support 
ISPFx00. from Mar 28, 2013, leads to a bunch of Sparse endian warnings.

See: http://lwn.net/Articles/205624/

Most of them are just because the code hasn't been annotated but some
look like real bugs like on line 3288.

I've included the warnings below.

regards,
dan carpenter

stdin:1223:2: warning: #warning syscall finit_module not implemented [-Wcpp]
drivers/scsi/qla2xxx/qla_mr.c:55:21: warning: restricted pci_channel_state_t 
degrades to integer
drivers/scsi/qla2xxx/qla_mr.c:55:37: warning: restricted pci_channel_state_t 
degrades to integer
drivers/scsi/qla2xxx/qla_mr.c:643:35: warning: incorrect type in assignment 
(different base types)
drivers/scsi/qla2xxx/qla_mr.c:643:35:expected unsigned short [unsigned] 
[usertype] request_q_outpointer
drivers/scsi/qla2xxx/qla_mr.c:643:35:got restricted __le16 [usertype] 
noident
drivers/scsi/qla2xxx/qla_mr.c:644:35: warning: incorrect type in assignment 
(different base types)
drivers/scsi/qla2xxx/qla_mr.c:644:35:expected unsigned short [unsigned] 
[usertype] response_q_inpointer
drivers/scsi/qla2xxx/qla_mr.c:644:35:got restricted __le16 [usertype] 
noident
drivers/scsi/qla2xxx/qla_mr.c:645:31: warning: incorrect type in assignment 
(different base types)
drivers/scsi/qla2xxx/qla_mr.c:645:31:expected unsigned short [unsigned] 
[usertype] request_q_length
drivers/scsi/qla2xxx/qla_mr.c:645:31:got restricted __le16 [usertype] 
noident
drivers/scsi/qla2xxx/qla_mr.c:646:32: warning: incorrect type in assignment 
(different base types)
drivers/scsi/qla2xxx/qla_mr.c:646:32:expected unsigned short [unsigned] 
[usertype] response_q_length
drivers/scsi/qla2xxx/qla_mr.c:646:32:got restricted __le16 [usertype] 
noident
drivers/scsi/qla2xxx/qla_mr.c:647:35: warning: incorrect type in assignment 
(different base types)
drivers/scsi/qla2xxx/qla_mr.c:647:35:expected unsigned int [unsigned] 
noident
drivers/scsi/qla2xxx/qla_mr.c:647:35:got restricted __le32 [usertype] 
noident
drivers/scsi/qla2xxx/qla_mr.c:648:35: warning: incorrect type in assignment 
(different base types)
drivers/scsi/qla2xxx/qla_mr.c:648:35:expected unsigned int [unsigned] 
noident
drivers/scsi/qla2xxx/qla_mr.c:648:35:got restricted __le32 [usertype] 
noident
drivers/scsi/qla2xxx/qla_mr.c:649:36: warning: incorrect type in assignment 
(different base types)
drivers/scsi/qla2xxx/qla_mr.c:649:36:expected unsigned int [unsigned] 
noident
drivers/scsi/qla2xxx/qla_mr.c:649:36:got restricted __le32 [usertype] 
noident
drivers/scsi/qla2xxx/qla_mr.c:650:36: warning: incorrect type in assignment 
(different base types)
drivers/scsi/qla2xxx/qla_mr.c:650:36:expected unsigned int [unsigned] 
noident
drivers/scsi/qla2xxx/qla_mr.c:650:36:got restricted __le32 [usertype] 
noident
drivers/scsi/qla2xxx/qla_mr.c:883:22: warning: cast removes address space of 
expression
drivers/scsi/qla2xxx/qla_mr.c:898:22: warning: cast removes address space of 
expression
drivers/scsi/qla2xxx/qla_mr.c:1424:17: warning: incorrect type in argument 2 
(different address spaces)
drivers/scsi/qla2xxx/qla_mr.c:1424:17:expected void volatile [noderef] 
asn:2*addr
drivers/scsi/qla2xxx/qla_mr.c:1424:17:got unsigned int *noident
drivers/scsi/qla2xxx/qla_mr.c:2200:34: warning: cast to restricted __le32
drivers/scsi/qla2xxx/qla_mr.c::49: warning: cast to restricted __le32
drivers/scsi/qla2xxx/qla_mr.c:2223:47: warning: cast to restricted __le32
drivers/scsi/qla2xxx/qla_mr.c:2224:45: warning: cast to restricted __le32
drivers/scsi/qla2xxx/qla_mr.c:2227:29: warning: cast to restricted __le32
drivers/scsi/qla2xxx/qla_mr.c:2298:23: warning: cast to restricted __le16
drivers/scsi/qla2xxx/qla_mr.c:2299:23: warning: cast to restricted __le16
drivers/scsi/qla2xxx/qla_mr.c:2353:29: warning: cast to restricted __le32
drivers/scsi/qla2xxx/qla_mr.c:2355:29: warning: cast to restricted __le32
drivers/scsi/qla2xxx/qla_mr.c:2357:32: warning: cast to restricted __le32
drivers/scsi/qla2xxx/qla_mr.c:2652:26: warning: cast to restricted __le32
drivers/scsi/qla2xxx/qla_mr.c:2720:16: warning: incorrect type in argument 1 
(different address spaces)
drivers/scsi/qla2xxx/qla_mr.c:2720:16:expected void const volatile 
[noderef] asn:2*addr
drivers/scsi/qla2xxx/qla_mr.c:2720:16:got unsigned int *noident
drivers/scsi/qla2xxx/qla_mr.c:2723:45: warning: incorrect type in argument 2 
(different address spaces)
drivers/scsi/qla2xxx/qla_mr.c:2723:45:expected void const volatile 
[noderef] asn:2*src
drivers/scsi/qla2xxx/qla_mr.c:2723:45:got struct response_t [usertype] 
*[assigned] lptr
drivers/scsi/qla2xxx/qla_mr.c:2774:17: warning: incorrect type in argument 2 
(different address spaces)
drivers/scsi/qla2xxx/qla_mr.c:2774:17:expected void volatile [noderef] 
asn:2*addr
drivers/scsi/qla2xxx/qla_mr.c:2774:17:got unsigned int *noident
drivers/scsi/qla2xxx/qla_mr.c:3152:29: warning: incorrect

Re: [SCSI] qla2xxx: Enhancements to support ISPFx00.

2013-04-15 Thread Giridhar Malavali
Dan,

Thanks for bringing this to our attention. We will look into this and take
care of this. 

-- Giri

On 4/15/13 1:34 PM, Dan Carpenter dan.carpen...@oracle.com wrote:

Hello Giridhar Malavali,

The patch 8ae6d9c7eb10: [SCSI] qla2xxx: Enhancements to support
ISPFx00. from Mar 28, 2013, leads to a bunch of Sparse endian warnings.

See: http://lwn.net/Articles/205624/

Most of them are just because the code hasn't been annotated but some
look like real bugs like on line 3288.

I've included the warnings below.

regards,
dan carpenter

stdin:1223:2: warning: #warning syscall finit_module not implemented
[-Wcpp]
drivers/scsi/qla2xxx/qla_mr.c:55:21: warning: restricted
pci_channel_state_t degrades to integer
drivers/scsi/qla2xxx/qla_mr.c:55:37: warning: restricted
pci_channel_state_t degrades to integer
drivers/scsi/qla2xxx/qla_mr.c:643:35: warning: incorrect type in
assignment (different base types)
drivers/scsi/qla2xxx/qla_mr.c:643:35:expected unsigned short
[unsigned] [usertype] request_q_outpointer
drivers/scsi/qla2xxx/qla_mr.c:643:35:got restricted __le16 [usertype]
noident
drivers/scsi/qla2xxx/qla_mr.c:644:35: warning: incorrect type in
assignment (different base types)
drivers/scsi/qla2xxx/qla_mr.c:644:35:expected unsigned short
[unsigned] [usertype] response_q_inpointer
drivers/scsi/qla2xxx/qla_mr.c:644:35:got restricted __le16 [usertype]
noident
drivers/scsi/qla2xxx/qla_mr.c:645:31: warning: incorrect type in
assignment (different base types)
drivers/scsi/qla2xxx/qla_mr.c:645:31:expected unsigned short
[unsigned] [usertype] request_q_length
drivers/scsi/qla2xxx/qla_mr.c:645:31:got restricted __le16 [usertype]
noident
drivers/scsi/qla2xxx/qla_mr.c:646:32: warning: incorrect type in
assignment (different base types)
drivers/scsi/qla2xxx/qla_mr.c:646:32:expected unsigned short
[unsigned] [usertype] response_q_length
drivers/scsi/qla2xxx/qla_mr.c:646:32:got restricted __le16 [usertype]
noident
drivers/scsi/qla2xxx/qla_mr.c:647:35: warning: incorrect type in
assignment (different base types)
drivers/scsi/qla2xxx/qla_mr.c:647:35:expected unsigned int [unsigned]
noident
drivers/scsi/qla2xxx/qla_mr.c:647:35:got restricted __le32 [usertype]
noident
drivers/scsi/qla2xxx/qla_mr.c:648:35: warning: incorrect type in
assignment (different base types)
drivers/scsi/qla2xxx/qla_mr.c:648:35:expected unsigned int [unsigned]
noident
drivers/scsi/qla2xxx/qla_mr.c:648:35:got restricted __le32 [usertype]
noident
drivers/scsi/qla2xxx/qla_mr.c:649:36: warning: incorrect type in
assignment (different base types)
drivers/scsi/qla2xxx/qla_mr.c:649:36:expected unsigned int [unsigned]
noident
drivers/scsi/qla2xxx/qla_mr.c:649:36:got restricted __le32 [usertype]
noident
drivers/scsi/qla2xxx/qla_mr.c:650:36: warning: incorrect type in
assignment (different base types)
drivers/scsi/qla2xxx/qla_mr.c:650:36:expected unsigned int [unsigned]
noident
drivers/scsi/qla2xxx/qla_mr.c:650:36:got restricted __le32 [usertype]
noident
drivers/scsi/qla2xxx/qla_mr.c:883:22: warning: cast removes address space
of expression
drivers/scsi/qla2xxx/qla_mr.c:898:22: warning: cast removes address space
of expression
drivers/scsi/qla2xxx/qla_mr.c:1424:17: warning: incorrect type in
argument 2 (different address spaces)
drivers/scsi/qla2xxx/qla_mr.c:1424:17:expected void volatile
[noderef] asn:2*addr
drivers/scsi/qla2xxx/qla_mr.c:1424:17:got unsigned int *noident
drivers/scsi/qla2xxx/qla_mr.c:2200:34: warning: cast to restricted __le32
drivers/scsi/qla2xxx/qla_mr.c::49: warning: cast to restricted __le32
drivers/scsi/qla2xxx/qla_mr.c:2223:47: warning: cast to restricted __le32
drivers/scsi/qla2xxx/qla_mr.c:2224:45: warning: cast to restricted __le32
drivers/scsi/qla2xxx/qla_mr.c:2227:29: warning: cast to restricted __le32
drivers/scsi/qla2xxx/qla_mr.c:2298:23: warning: cast to restricted __le16
drivers/scsi/qla2xxx/qla_mr.c:2299:23: warning: cast to restricted __le16
drivers/scsi/qla2xxx/qla_mr.c:2353:29: warning: cast to restricted __le32
drivers/scsi/qla2xxx/qla_mr.c:2355:29: warning: cast to restricted __le32
drivers/scsi/qla2xxx/qla_mr.c:2357:32: warning: cast to restricted __le32
drivers/scsi/qla2xxx/qla_mr.c:2652:26: warning: cast to restricted __le32
drivers/scsi/qla2xxx/qla_mr.c:2720:16: warning: incorrect type in
argument 1 (different address spaces)
drivers/scsi/qla2xxx/qla_mr.c:2720:16:expected void const volatile
[noderef] asn:2*addr
drivers/scsi/qla2xxx/qla_mr.c:2720:16:got unsigned int *noident
drivers/scsi/qla2xxx/qla_mr.c:2723:45: warning: incorrect type in
argument 2 (different address spaces)
drivers/scsi/qla2xxx/qla_mr.c:2723:45:expected void const volatile
[noderef] asn:2*src
drivers/scsi/qla2xxx/qla_mr.c:2723:45:got struct response_t
[usertype] *[assigned] lptr
drivers/scsi/qla2xxx/qla_mr.c:2774:17: warning: incorrect type in
argument 2 (different address spaces)
drivers/scsi/qla2xxx/qla_mr.c:2774:17:expected void volatile
[noderef] asn:2