From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751786AbdHRMhH (ORCPT ); Fri, 18 Aug 2017 08:37:07 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:59078 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751626AbdHRMhF (ORCPT ); Fri, 18 Aug 2017 08:37:05 -0400 From: Colin King To: Adrian Hunter , Ulf Hansson , 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 Message-Id: <20170818123703.14870-1-colin.king@canonical.com> X-Mailer: git-send-email 2.11.0 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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); -- 2.11.0