From: Adrian Hunter <adrian.hunter@intel.com>
To: Colin King <colin.king@canonical.com>,
Ulf Hansson <ulf.hansson@linaro.org>,
linux-mmc@vger.kernel.org
Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mmc: sdhci-pci: remove redundant check of slots == 0
Date: Fri, 31 May 2019 11:35:33 +0000 [thread overview]
Message-ID: <4336bf57-5fcf-5758-8d0d-9fd4aec3df4a@intel.com> (raw)
In-Reply-To: <20190531113223.27474-1-colin.king@canonical.com>
On 31/05/19 2:32 PM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> The calculation of slots results in a value in the range 1..8
> and so slots can never be zero. The check for slots = 0 is
> always going to be false, hence it is redundant and can be
> removed.
>
> Addresses-Coverity: ("Logically dead code")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Adrian Hunter <adrian.hunter@intel.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 ab9e2b901094..f70436261746 100644
> --- a/drivers/mmc/host/sdhci-pci-core.c
> +++ b/drivers/mmc/host/sdhci-pci-core.c
> @@ -2044,8 +2044,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);
>
>
next prev parent reply other threads:[~2019-05-31 11:35 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-31 11:32 [PATCH] mmc: sdhci-pci: remove redundant check of slots == 0 Colin King
2019-05-31 11:35 ` Adrian Hunter [this message]
2019-06-03 13:48 ` Ulf Hansson
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=4336bf57-5fcf-5758-8d0d-9fd4aec3df4a@intel.com \
--to=adrian.hunter@intel.com \
--cc=colin.king@canonical.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