[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAPDyKFpo6EqOp0mqVj7yHdttoh957QSZ8sFzHMs+QFz-cHETew@mail.gmail.com>
Date: Mon, 3 Jun 2019 15:48:27 +0200
From: Ulf Hansson <ulf.hansson@...aro.org>
To: Colin King <colin.king@...onical.com>
Cc: Adrian Hunter <adrian.hunter@...el.com>,
"linux-mmc@...r.kernel.org" <linux-mmc@...r.kernel.org>,
kernel-janitors@...r.kernel.org,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] mmc: sdhci-pci: remove redundant check of slots == 0
On Fri, 31 May 2019 at 13:32, Colin King <colin.king@...onical.com> wrote:
>
> From: Colin Ian King <colin.king@...onical.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@...onical.com>
Applied for next, thanks!
Kind regards
Uffe
> ---
> 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);
>
> --
> 2.20.1
>
Powered by blists - more mailing lists