Skip to contentSkip to conversation

scsi: aacraid: Reorder Adapter status check

bug report Dan Carpenter 2 participants 2 messages Feb 27, 2017 – Mar 2, 2017 SCSI

lore
Share & tools
lore
#0 lore raw

Hello Raghava Aditya Renukunta,

The patch c421530bf848: "scsi: aacraid: Reorder Adapter status check" from Feb 16, 2017, leads to the following static checker warning:

drivers/scsi/aacraid/src.c:471 aac_src_check_health()
warn: was shift intended here '(status > 16)'

drivers/scsi/aacraid/src.c
464 */
465 return 0;
466
467 err_out:
468 return -1;
469
470 err_blink:

   471          return (status > 16) & 0xFF;
                        ^^^^^^^^^^^^^^^^^^^

Issue #1: This is obviously a typo.

472 }

Issue #2: The caller checks for if the return is greater than 2. It
never is. We can remove this dead code.

Issue #3: The caller passes "bled" to aac_send_iop_reset() which
ignores it. What's up with that? Either it's a bug or we should delete that dead code.

regards,
dan carpenter

#1 lore raw
Quoted 17 lines

-----Original Message-----
From: [email protected] [mailto:linux-scsi- [email protected]] On Behalf Of Dan Carpenter
Sent: Monday, February 27, 2017 8:32 AM
To: Raghava Aditya Renukunta
Cc: [email protected]
Subject: [bug report] scsi: aacraid: Reorder Adapter status check

The patch c421530bf848: "scsi: aacraid: Reorder Adapter status check" from Feb 16, 2017, leads to the following static checker warning:

drivers/scsi/aacraid/src.c:471 aac_src_check_health()
warn: was shift intended here '(status > 16)'

drivers/scsi/aacraid/src.c
464 */

Quoted 8 lines
   465          return 0;
   466
   467  err_out:
   468          return -1;
   469
   470  err_blink:
   471          return (status > 16) & 0xFF;
                        ^^^^^^^^^^^^^^^^^^^ Issue #1:  This is obviously a typo.

Agreed, will submit a correction ... should be >>

Quoted 5 lines
   472  }

Issue #2: The caller checks for if the return is greater than 2. It
never is. We can remove this dead code.

That would be the blink led returned from the controller which would be greater than 2

Quoted 4 lines

Issue #3: The caller passes "bled" to aac_send_iop_reset() which
ignores it. What's up with that? Either it's a bug or we should delete that dead code.

When we have gotten all caught up, we will be printing the blink led as part of the iop_reset

Thanks, -Dave

Quoted 3 lines

regards,
dan carpenter