linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [SCSI] pmcraid: PMC-Sierra MaxRAID driver to support 6Gb/s SAS RAID controller
@ 2018-10-04  8:28 Colin Ian King
  2018-10-04 11:48 ` John Garry
  0 siblings, 1 reply; 2+ messages in thread
From: Colin Ian King @ 2018-10-04  8:28 UTC (permalink / raw)
  To: James E.J. Bottomley, Martin K. Petersen, linux-scsi
  Cc: linux-kernel, kernel-janitors

Hi,

Static analysis from CoverityScan (CID#114178 "Operands don't affect
result") detected an issue in drivers/scsi/pmcraid.c, function
pmcraid_init_res_table with the following check:

        if (pinstance->cfg_table->flags & MICROCODE_UPDATE_REQUIRED)
                pmcraid_err("IOA requires microcode download\n");


pinstance->cfg_table->flags is a u8, MICROCODE_UPDATE_REQUIRED is  1 <<
31, so the & operation always results in false and the error message is
never displayed.  From my understanding, flags should be a u8, so there
is something wrong here with the check.  Any ideas?

Colin

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [SCSI] pmcraid: PMC-Sierra MaxRAID driver to support 6Gb/s SAS RAID controller
  2018-10-04  8:28 [SCSI] pmcraid: PMC-Sierra MaxRAID driver to support 6Gb/s SAS RAID controller Colin Ian King
@ 2018-10-04 11:48 ` John Garry
  0 siblings, 0 replies; 2+ messages in thread
From: John Garry @ 2018-10-04 11:48 UTC (permalink / raw)
  To: Colin Ian King, James E.J. Bottomley, Martin K. Petersen, linux-scsi
  Cc: linux-kernel, kernel-janitors

On 04/10/2018 09:28, Colin Ian King wrote:
> Hi,
>
> Static analysis from CoverityScan (CID#114178 "Operands don't affect
> result") detected an issue in drivers/scsi/pmcraid.c, function
> pmcraid_init_res_table with the following check:
>
>         if (pinstance->cfg_table->flags & MICROCODE_UPDATE_REQUIRED)
>                 pmcraid_err("IOA requires microcode download\n");
>
>
> pinstance->cfg_table->flags is a u8, MICROCODE_UPDATE_REQUIRED is  1 <<
> 31, so the & operation always results in false and the error message is
> never displayed.  From my understanding, flags should be a u8, so there
> is something wrong here with the check.  Any ideas?
>
> Colin
>
>

Maybe MICROCODE_UPDATE_REQUIRED definition is wrong and should be:
  /* config_table.flags value */
-#define MICROCODE_UPDATE_REQUIRED        PMC_BIT32(0)
+#define MICROCODE_UPDATE_REQUIRED        PMC_BIT8(0)

John


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-10-04 11:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-04  8:28 [SCSI] pmcraid: PMC-Sierra MaxRAID driver to support 6Gb/s SAS RAID controller Colin Ian King
2018-10-04 11:48 ` John Garry

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).