Received: by 2002:ac0:a679:0:0:0:0:0 with SMTP id p54csp260072imp; Thu, 21 Feb 2019 00:34:50 -0800 (PST) X-Google-Smtp-Source: AHgI3IbGnAvHTC8Zm9yv3NVgxFEklvyn5gjwGvaOp3PPIEqayz80CIqAoZrdkR6kF/pFF+DKSBaX X-Received: by 2002:a17:902:8346:: with SMTP id z6mr37105451pln.74.1550738090516; Thu, 21 Feb 2019 00:34:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550738090; cv=none; d=google.com; s=arc-20160816; b=MsDBU4Dq0cgqMiipn1D3prG4cB6IpCiRyYsq77T6v4EyYtYxYSxqLi2wShXicvPMv6 I34JZjh/A3FXA2AGrrz9X0uOutO8/ToirV2MPuzxKQdyh+eJ1rrPLSi0nSa181DaMLRw GkvPJgF8jFej0JccN4nmZIfPRyIdZ6UWvDTOdX2XK4+tWSdFm+pP6igKquyDCYEmX6V+ 0URVhCU9oeZosbcFOMDm4aEfur2DYsr1W/LWCmZIn1MBro/SC6d3N8GuETl34bGcmp5S 9Immht0LWIGCRMgBOvS8ZHdzo/PL9aWMOQm1JpYpiXfc0V8YiUcXCISY3Bb/yRHP8Dba ET9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=ekZtkSoyBr8OtpkvHNuuZF9ukyq0n3eew8rPB3PZjbk=; b=bgvGzpcc8a9OiRP1+AOohgFQmssVeHmq5ASWQrLQxwcucQskykVVPWdpXZWmj17DbA G6KU4Uyo/bx0mrlCxAGZMKA8fwh98cFkCXW9GWRC6iaCcD4evxksrcEeUtuL6KcSCY4j XDSOZmwUXkEzK881lXABBvXEXIvlwYq69nVXBrDLEhtKXkpJ+mWl0/h3t8nfjI99OPoF I+Bg60IDPppKO8OlORGmk1bLBggq6TKkmGRgtiBmceXPKXdh8qKLL03YnPov+UaZaogJ x2J9joMv4tPfD3n5hU4pSEqEQ6AsWFBiVS6tDWcfs4dXIyOcVLhy3e3tadKYDb5d3BKU ogAQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=BBvMWR0J; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e4si20201148pgd.256.2019.02.21.00.34.34; Thu, 21 Feb 2019 00:34:50 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=BBvMWR0J; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726729AbfBUIeA (ORCPT + 99 others); Thu, 21 Feb 2019 03:34:00 -0500 Received: from mail.kernel.org ([198.145.29.99]:59320 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726260AbfBUId7 (ORCPT ); Thu, 21 Feb 2019 03:33:59 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 8CEB920842; Thu, 21 Feb 2019 08:33:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1550738039; bh=LZmkfaZUb4yeiZ8AKXuXgClzv8dR6p3n1MDXWMajbws=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=BBvMWR0J+fKcniyk95GjFqngdVHq/+aPgNq7+1Nako5HYZlhNH89OD4J8Gm8yfAJD UVr9PEPcxWEYjElGvKdNebGwZmxvRpTrKQ4bSEcuiUsxbT7+S/lTB/XoXfbKqS5eP/ isB0+phWQm94+HbdlV0SupVs8fQ1sS9s7oeQkhAE= Date: Thu, 21 Feb 2019 09:33:55 +0100 From: Greg KH To: Matt Hsiao Cc: linux-kernel@vger.kernel.org, arnd@arndb.de, david.altobelli@hpe.com, mark.rusk@hpe.com, jerry.hoemann@hpe.com Subject: Re: [PATCH 2/4] misc: hpilo: Exclude unsupported device via blacklist Message-ID: <20190221083355.GB6397@kroah.com> References: <1550736282-25416-1-git-send-email-matt.hsiao@hpe.com> <1550736282-25416-3-git-send-email-matt.hsiao@hpe.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1550736282-25416-3-git-send-email-matt.hsiao@hpe.com> User-Agent: Mutt/1.11.3 (2019-02-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Feb 21, 2019 at 04:04:40PM +0800, Matt Hsiao wrote: > Instead of having explicit if statments excluding devices, > use a pci_device_id table of devices to blacklist. > > Signed-off-by: Matt Hsiao > --- > drivers/misc/hpilo.c | 13 +++++++++---- > 1 file changed, 9 insertions(+), 4 deletions(-) > > diff --git a/drivers/misc/hpilo.c b/drivers/misc/hpilo.c > index 01c407a..0224e50 100644 > --- a/drivers/misc/hpilo.c > +++ b/drivers/misc/hpilo.c > @@ -29,6 +29,11 @@ > static unsigned int ilo_major; > static unsigned int max_ccb = 16; > static char ilo_hwdev[MAX_ILO_DEV]; > +static const struct pci_device_id ilo_blacklist[] = { > + /* auxiliary iLO */ > + {PCI_DEVICE_SUB(PCI_VENDOR_ID_HP, 0x3307, PCI_VENDOR_ID_HP, 0x1979)}, > + {} > +}; > > static inline int get_entry_id(int entry) > { > @@ -763,10 +768,10 @@ static int ilo_probe(struct pci_dev *pdev, > int devnum, minor, start, error = 0; > struct ilo_hwinfo *ilo_hw; > > - /* Ignore auxiliary iLO device */ > - if (pdev->subsystem_vendor == PCI_VENDOR_ID_HP && > - pdev->subsystem_device == 0x1979) > - return 0; > + if (pci_match_id(ilo_blacklist, pdev)) { > + dev_dbg(&pdev->dev, "Not supported on this device\n"); > + return -ENODEV; > + } Why not just merge this into the previous patch? And why do some devices need to be blacklisted, shouldn't there only be a whitelist in the first place? Do you need to tighten up your original device ids? thanks, greg k-h