From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753128AbdHRNWS (ORCPT ); Fri, 18 Aug 2017 09:22:18 -0400 Received: from mga04.intel.com ([192.55.52.120]:29806 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752572AbdHRNWQ (ORCPT ); Fri, 18 Aug 2017 09:22:16 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.41,393,1498546800"; d="scan'208";a="301795161" Subject: Re: [PATCH] sdhci: remove redundant check of zero slots To: Colin King , Ulf Hansson , linux-mmc@vger.kernel.org Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org References: <20170818123703.14870-1-colin.king@canonical.com> From: Adrian Hunter Organization: Intel Finland Oy, Registered Address: PL 281, 00181 Helsinki, Business Identity Code: 0357606 - 4, Domiciled in Helsinki Message-ID: <024cfffc-cf86-745b-e13d-88dc0d351426@intel.com> Date: Fri, 18 Aug 2017 16:15:47 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <20170818123703.14870-1-colin.king@canonical.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 18/08/17 15:37, Colin King wrote: > From: Colin Ian King > > 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 > --- > 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. > >