From: Colin King <colin.king@canonical.com>
To: Adrian Hunter <adrian.hunter@intel.com>,
Ulf Hansson <ulf.hansson@linaro.org>,
linux-mmc@vger.kernel.org
Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] sdhci: remove redundant check of zero slots
Date: Fri, 18 Aug 2017 13:37:03 +0100 [thread overview]
Message-ID: <20170818123703.14870-1-colin.king@canonical.com> (raw)
From: Colin Ian King <colin.king@canonical.com>
Slots can never be zero, PCI_SLOTS_INFO_SLOTS returns a value in the
range 0..7; slots is one more than this, 1..8 so cannot be zero and
so the zero check is redundant and can be removed.
Detected by CoverityScan, CID#744269 ("Logically Dead Code")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
drivers/mmc/host/sdhci-pci-core.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/mmc/host/sdhci-pci-core.c b/drivers/mmc/host/sdhci-pci-core.c
index 2c853cfa8389..43b2b09131bd 100644
--- a/drivers/mmc/host/sdhci-pci-core.c
+++ b/drivers/mmc/host/sdhci-pci-core.c
@@ -1669,8 +1669,6 @@ static int sdhci_pci_probe(struct pci_dev *pdev,
slots = PCI_SLOT_INFO_SLOTS(slots) + 1;
dev_dbg(&pdev->dev, "found %d slot(s)\n", slots);
- if (slots == 0)
- return -ENODEV;
BUG_ON(slots > MAX_SLOTS);
--
2.11.0
next reply other threads:[~2017-08-18 12:37 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-18 12:37 Colin King [this message]
2017-08-18 13:15 ` Adrian Hunter
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=20170818123703.14870-1-colin.king@canonical.com \
--to=colin.king@canonical.com \
--cc=adrian.hunter@intel.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mmc@vger.kernel.org \
--cc=ulf.hansson@linaro.org \
/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
all inboxes | Powered by JetHome®