linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] scsi: hpsa: simplify hpsa_set_local_logical_count()
@ 2017-10-15 19:35 Christos Gkekas
       [not found] ` <4993A297653ECB4581FA5C3C31323D19672184FC@avsrvexchmbx2.microsemi.net>
  0 siblings, 1 reply; 2+ messages in thread
From: Christos Gkekas @ 2017-10-15 19:35 UTC (permalink / raw)
  To: Don Brace, James E.J. Bottomley, Martin K. Petersen,
	esc.storagedev, linux-scsi, linux-kernel
  Cc: Christos Gkekas

Variable configured_logical_drive_count is defined as u8 and thus the
nested if statement always evaluates to true. Remove it and simplify.

Signed-off-by: Christos Gkekas <chris.gekas@gmail.com>
---
 drivers/scsi/hpsa.c | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c
index 9abe810..7d4f139 100644
--- a/drivers/scsi/hpsa.c
+++ b/drivers/scsi/hpsa.c
@@ -4090,14 +4090,7 @@ static int hpsa_set_local_logical_count(struct ctlr_info *h,
 	}
 	memset(id_ctlr, 0, sizeof(*id_ctlr));
 	rc = hpsa_bmic_id_controller(h, id_ctlr, sizeof(*id_ctlr));
-	if (!rc)
-		if (id_ctlr->configured_logical_drive_count < 256)
-			*nlocals = id_ctlr->configured_logical_drive_count;
-		else
-			*nlocals = le16_to_cpu(
-					id_ctlr->extended_logical_unit_count);
-	else
-		*nlocals = -1;
+	*nlocals = rc ? -1 : id_ctlr->configured_logical_drive_count;
 	return rc;
 }
 
-- 
2.7.4

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

end of thread, other threads:[~2017-10-16 19:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-15 19:35 [PATCH] scsi: hpsa: simplify hpsa_set_local_logical_count() Christos Gkekas
     [not found] ` <4993A297653ECB4581FA5C3C31323D19672184FC@avsrvexchmbx2.microsemi.net>
2017-10-16 19:06   ` Christos Gkekas

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