mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Matt Hsiao <matt.hsiao@hpe.com>
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
Date: Thu, 21 Feb 2019 09:33:55 +0100	[thread overview]
Message-ID: <20190221083355.GB6397@kroah.com> (raw)
In-Reply-To: <1550736282-25416-3-git-send-email-matt.hsiao@hpe.com>

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 <matt.hsiao@hpe.com>
> ---
>  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

  reply	other threads:[~2019-02-21  8:34 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-21  8:04 [PATCH 0/4] misc: hpilo: Do not claim on unsupported hardware Matt Hsiao
2019-02-21  8:04 ` [PATCH 1/4] misc: hpilo: Be more specific when ignoring the aux iLO Matt Hsiao
2019-02-21  8:04 ` [PATCH 2/4] misc: hpilo: Exclude unsupported device via blacklist Matt Hsiao
2019-02-21  8:33   ` Greg KH [this message]
2019-02-22  4:35     ` Jerry Hoemann
2019-02-22  6:50       ` Greg KH
2019-02-21  8:04 ` [PATCH 3/4] misc: hpilo: Do not claim unsupported hardware Matt Hsiao
2019-02-21  8:35   ` Greg KH
2019-02-22  3:59     ` Jerry Hoemann
2019-02-21  8:04 ` [PATCH 4/4] misc: hpilo: Update driver version Matt Hsiao
2019-02-21  8:32   ` Greg KH
2019-02-22  4:11     ` Jerry Hoemann
2019-02-22  6:49       ` Greg KH
2019-02-25  8:28         ` Jerry Hoemann
2019-02-25 21:44           ` Greg KH

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=20190221083355.GB6397@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=arnd@arndb.de \
    --cc=david.altobelli@hpe.com \
    --cc=jerry.hoemann@hpe.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rusk@hpe.com \
    --cc=matt.hsiao@hpe.com \
    /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

Powered by JetHome