Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ff615f06 authored by Petros Koutoupis's avatar Petros Koutoupis Committed by Martin K. Petersen
Browse files

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: default avatarPetros Koutoupis <petros@petroskoutoupis.com>
Acked-by: default avatarDon Brace <don.brace@microsemi.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent d230823a
Loading
Loading
Loading
Loading
+4 −6
Original line number Original line Diff line number Diff line
@@ -1665,9 +1665,8 @@ static void hpsa_figure_phys_disk_ptrs(struct ctlr_info *h,
		for (j = 0; j < ndevices; j++) {
		for (j = 0; j < ndevices; j++) {
			if (dev[j] == NULL)
			if (dev[j] == NULL)
				continue;
				continue;
			if (dev[j]->devtype != TYPE_DISK)
			if (dev[j]->devtype != TYPE_DISK &&
				continue;
			    dev[j]->devtype != TYPE_ZBC)
			if (dev[j]->devtype != TYPE_ZBC)
				continue;
				continue;
			if (is_logical_device(dev[j]))
			if (is_logical_device(dev[j]))
				continue;
				continue;
@@ -1712,9 +1711,8 @@ static void hpsa_update_log_drive_phys_drive_ptrs(struct ctlr_info *h,
	for (i = 0; i < ndevices; i++) {
	for (i = 0; i < ndevices; i++) {
		if (dev[i] == NULL)
		if (dev[i] == NULL)
			continue;
			continue;
		if (dev[i]->devtype != TYPE_DISK)
		if (dev[i]->devtype != TYPE_DISK &&
			continue;
		    dev[i]->devtype != TYPE_ZBC)
		if (dev[i]->devtype != TYPE_ZBC)
			continue;
			continue;
		if (!is_logical_device(dev[i]))
		if (!is_logical_device(dev[i]))
			continue;
			continue;