提交 ff615f06 编写于 作者: P Petros Koutoupis 提交者: Martin K. Petersen

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: NPetros Koutoupis <petros@petroskoutoupis.com>
Acked-by: NDon Brace <don.brace@microsemi.com>
Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
上级 d230823a
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册