public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* [bug report] [SCSI] fnic: Add new Cisco PCI-Express FCoE HBA
@ 2020-10-30 12:49 Dan Carpenter
  0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2020-10-30 12:49 UTC (permalink / raw)
  To: abjoglek; +Cc: linux-scsi

Hello Abhijeet Joglekar,

The patch 5df6d737dd4b: "[SCSI] fnic: Add new Cisco PCI-Express FCoE
HBA" from Apr 17, 2009, leads to the following static checker warning:

    drivers/scsi/fnic/fnic_res.c:96 fnic_get_vnic_config()
    warn: '__UNIQUE_ID___x1297' 255000 can't fit into 65535 'c->ed_tov'

    drivers/scsi/fnic/fnic_res.c:101 fnic_get_vnic_config()
    warn: '__UNIQUE_ID___x1301' 255000 can't fit into 65535 'c->ra_tov'

drivers/scsi/fnic/fnic_res.c
    89          c->rq_desc_count = ALIGN(c->rq_desc_count, 16);
    90  
    91          c->maxdatafieldsize =
    92                  min_t(u16, VNIC_FNIC_MAXDATAFIELDSIZE_MAX,
    93                        max_t(u16, VNIC_FNIC_MAXDATAFIELDSIZE_MIN,
    94                              c->maxdatafieldsize));
    95          c->ed_tov =
    96                  min_t(u32, VNIC_FNIC_EDTOV_MAX,
    97                        max_t(u32, VNIC_FNIC_EDTOV_MIN,
    98                              c->ed_tov));

The VNIC_FNIC_EDTOV_MAX is 255000 but c->ed_tov is a u16 so the max is
way outside of the maximum that the type says it can be.

    99  
   100          c->ra_tov =
   101                  min_t(u32, VNIC_FNIC_RATOV_MAX,
                                    ^^^^^^^^^^^^^^^^^^
Same.

   102                        max_t(u32, VNIC_FNIC_RATOV_MIN,
   103                              c->ra_tov));
   104  
   105          c->flogi_retries =
   106                  min_t(u32, VNIC_FNIC_FLOGI_RETRIES_MAX, c->flogi_retries);

regards,
dan carpenter

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

only message in thread, other threads:[~2020-10-30 12:49 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-10-30 12:49 [bug report] [SCSI] fnic: Add new Cisco PCI-Express FCoE HBA Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox