diff options
author | Petros Koutoupis <petros@petroskoutoupis.com> | 2016-05-09 21:44:10 +0300 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2016-05-11 04:58:08 +0300 |
commit | ff615f065a48137e48985c78d8b17ce14b22fa90 (patch) | |
tree | 680e9f70f04a0ca68fc377717c232402abb989a8 /drivers/scsi | |
parent | d230823a1c4c3e97afd4c934b86b3975d5e20249 (diff) | |
download | linux-ff615f065a48137e48985c78d8b17ce14b22fa90.tar.xz |
hpsa: Fix type ZBC conditional checks
The device ID obtained from the inquiry can only be of a single type.
The original code places a check for TYPE_ZBC right after the check for
TYPE_DISK. Logically, if the first if statement sees a device of a
TYPE_DISK and moves on to the second statement checking if not TYPE_ZBC,
it will always hit the continue.
[mkp: Applied by hand]
Signed-off-by: Petros Koutoupis <petros@petroskoutoupis.com>
Acked-by: Don Brace <don.brace@microsemi.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi')
-rw-r--r-- | drivers/scsi/hpsa.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c index ff25d2082139..ff8dcd5b0631 100644 --- a/drivers/scsi/hpsa.c +++ b/drivers/scsi/hpsa.c @@ -1665,9 +1665,8 @@ static void hpsa_figure_phys_disk_ptrs(struct ctlr_info *h, for (j = 0; j < ndevices; j++) { if (dev[j] == NULL) continue; - if (dev[j]->devtype != TYPE_DISK) - continue; - if (dev[j]->devtype != TYPE_ZBC) + if (dev[j]->devtype != TYPE_DISK && + dev[j]->devtype != TYPE_ZBC) continue; if (is_logical_device(dev[j])) continue; @@ -1712,9 +1711,8 @@ static void hpsa_update_log_drive_phys_drive_ptrs(struct ctlr_info *h, for (i = 0; i < ndevices; i++) { if (dev[i] == NULL) continue; - if (dev[i]->devtype != TYPE_DISK) - continue; - if (dev[i]->devtype != TYPE_ZBC) + if (dev[i]->devtype != TYPE_DISK && + dev[i]->devtype != TYPE_ZBC) continue; if (!is_logical_device(dev[i])) continue; |