public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
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] sdhci: remove redundant check of zero slots
Date: Fri, 18 Aug 2017 16:15:47 +0300	[thread overview]
Message-ID: <024cfffc-cf86-745b-e13d-88dc0d351426@intel.com> (raw)
In-Reply-To: <20170818123703.14870-1-colin.king@canonical.com>

On 18/08/17 15:37, Colin King wrote:
> 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);

Isn't MAX_SLOTS == 8? So that is dead too.

>  
> 

      reply	other threads:[~2017-08-18 13:22 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-18 12:37 [PATCH] sdhci: remove redundant check of zero slots Colin King
2017-08-18 13:15 ` Adrian Hunter [this message]

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=024cfffc-cf86-745b-e13d-88dc0d351426@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