linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Hannes Reinecke <hare@suse.de>
Cc: "Martin K. Petersen" <martin.petersen@oracle.com>,
	Don Brace <don.brace@microsemi.com>,
	Christoph Hellwig <hch@lst.de>,
	James Bottomley <james.bottomley@hansenpartnership.com>,
	Meelis Roos <mroos@linux.ee>,
	linux-scsi@vger.kernel.org, Hannes Reinecke <hare@suse.com>
Subject: Re: [PATCH 2/6] hpsa: add support for legacy boards
Date: Wed, 9 Aug 2017 15:45:14 +0200	[thread overview]
Message-ID: <20170809134514.GD25852@lst.de> (raw)
In-Reply-To: <1502181315-102499-3-git-send-email-hare@suse.de>

> -static int hpsa_lookup_board_id(struct pci_dev *pdev, u32 *board_id)
> +static int hpsa_lookup_board_id(struct pci_dev *pdev, u32 *board_id,
> +				bool *supported)
>  {
>  	int i;
>  	u32 subsystem_vendor_id, subsystem_device_id;
> @@ -7242,9 +7266,22 @@ static int hpsa_lookup_board_id(struct pci_dev *pdev, u32 *board_id)
>  	*board_id = ((subsystem_device_id << 16) & 0xffff0000) |
>  		    subsystem_vendor_id;
>  
> +	if (supported)
> +		*supported = true;
>  	for (i = 0; i < ARRAY_SIZE(products); i++)
> -		if (*board_id == products[i].board_id)
> -			return i;
> +		if (*board_id == products[i].board_id) {
> +			if (products[i].access != &SA5A_access &&
> +			    products[i].access != &SA5B_access)
> +				return i;
> +			if (hpsa_allow_any) {
> +				dev_warn(&pdev->dev,
> +					 "unsupported board ID: 0x%08x\n",
> +					 *board_id);
> +				if (supported)
> +					*supported = false;
> +				return i;
> +			}
> +		}

Can you explain the point of the supported flag?

> +	unsigned long register_value  =
> +		readl(h->vaddr + SA5_INTR_STATUS);
> +	return (register_value & SA5B_INTR_PENDING);

This should be condensed into:

	return readl(h->vaddr + SA5_INTR_STATUS) & SA5B_INTR_PENDING;

>  	.command_completed = SA5_completed,
>  };
>  
> +/* Duplicate entry of the above to mark unsupported boards */
> +static struct access_method SA5A_access = {
> +	.submit_command = SA5_submit_command,
> +	.set_intr_mask = SA5_intr_mask,
> +	.intr_pending = SA5_intr_pending,
> +	.command_completed = SA5_completed,
> +};
> +
> +static struct access_method SA5B_access = {
> +	.submit_command = SA5_submit_command,
> +	.set_intr_mask = SA5B_intr_mask,
> +	.intr_pending = SA5B_intr_pending,
> +	.command_completed = SA5_completed,
> +};

Please align the fields nicely, e.g.:

static struct access_method SA5A_access = {
	.submit_command 	= SA5_submit_command,
	.set_intr_mask		= SA5_intr_mask,
	...

  parent reply	other threads:[~2017-08-09 13:45 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-08  8:35 [PATCH RESEND 0/6] hpsa: support legacy boards Hannes Reinecke
2017-08-08  8:35 ` [PATCH 1/6] hpsa: consolidate status variables Hannes Reinecke
2017-08-09 13:40   ` Christoph Hellwig
2017-08-14 10:02     ` Hannes Reinecke
2017-08-08  8:35 ` [PATCH 2/6] hpsa: add support for legacy boards Hannes Reinecke
2017-08-09 13:41   ` Christoph Hellwig
2017-08-09 15:08     ` Hannes Reinecke
2017-08-09 15:59       ` Christoph Hellwig
2017-08-09 13:45   ` Christoph Hellwig [this message]
2017-08-09 14:50     ` Hannes Reinecke
2017-08-08  8:35 ` [PATCH 3/6] hpsa: disable volume status check for older controller Hannes Reinecke
2017-08-09 13:42   ` Christoph Hellwig
2017-08-11 13:23   ` Tomas Henzl
2017-08-14 10:45     ` Hannes Reinecke
2017-08-08  8:35 ` [PATCH 4/6] hpsa: Ignore errors for unsupported LV_DEVICE_ID VPD page Hannes Reinecke
2017-08-09 13:45   ` Christoph Hellwig
2017-08-08  8:35 ` [PATCH 5/6] hpsa: do not print errors for unsupported report luns format Hannes Reinecke
2017-08-09 13:46   ` Christoph Hellwig
2017-08-09 14:52     ` Hannes Reinecke
2017-08-08  8:35 ` [PATCH 6/6] hpsa: handle unsupported devices more gracefully Hannes Reinecke
2017-08-09 13:48   ` Christoph Hellwig
2017-08-09 22:08 ` [PATCH RESEND 0/6] hpsa: support legacy boards Don Brace
2017-08-10  7:07   ` Hannes Reinecke
2017-08-10  7:09     ` Christoph Hellwig
2017-08-10  7:29       ` Hannes Reinecke
2017-08-10 14:06       ` James Bottomley
2017-08-10 14:11         ` Hannes Reinecke
2017-08-10 19:15           ` Don Brace
2017-08-11  6:43             ` Hannes Reinecke
2017-08-11 16:35               ` Don Brace

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=20170809134514.GD25852@lst.de \
    --to=hch@lst.de \
    --cc=don.brace@microsemi.com \
    --cc=hare@suse.com \
    --cc=hare@suse.de \
    --cc=james.bottomley@hansenpartnership.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=mroos@linux.ee \
    /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;
as well as URLs for NNTP newsgroup(s).