From: Christos Gkekas <chris.gekas@gmail.com>
To: Don Brace <don.brace@microsemi.com>,
"James E.J. Bottomley" <jejb@linux.vnet.ibm.com>,
"Martin K. Petersen" <martin.petersen@oracle.com>,
esc.storagedev@microsemi.com, linux-scsi@vger.kernel.org,
linux-kernel@vger.kernel.org
Cc: Christos Gkekas <chris.gekas@gmail.com>
Subject: [PATCH] scsi: hpsa: simplify hpsa_set_local_logical_count()
Date: Sun, 15 Oct 2017 20:35:03 +0100 [thread overview]
Message-ID: <1508096103-6751-1-git-send-email-chris.gekas@gmail.com> (raw)
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
next reply other threads:[~2017-10-15 19:35 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-15 19:35 Christos Gkekas [this message]
[not found] ` <4993A297653ECB4581FA5C3C31323D19672184FC@avsrvexchmbx2.microsemi.net>
2017-10-16 19:06 ` [PATCH] scsi: hpsa: simplify hpsa_set_local_logical_count() Christos Gkekas
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1508096103-6751-1-git-send-email-chris.gekas@gmail.com \
--to=chris.gekas@gmail.com \
--cc=don.brace@microsemi.com \
--cc=esc.storagedev@microsemi.com \
--cc=jejb@linux.vnet.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).