linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] scsi: hpsa: fix the device_id in hpsa_update_device_info()
@ 2017-08-17 14:44 Dan Carpenter
  2017-08-17 14:48 ` Hannes Reinecke
  2017-08-17 16:51 ` Martin K. Petersen
  0 siblings, 2 replies; 3+ messages in thread
From: Dan Carpenter @ 2017-08-17 14:44 UTC (permalink / raw)
  To: Don Brace, . Hannes Reinecke
  Cc: James E.J. Bottomley, Martin K. Petersen, esc.storagedev,
	linux-scsi, kernel-janitors

The parentheses are in the wrong place so we specify the length as
"sizeof(this_device->device_id) < 0" which is zero.

Fixes: 988b87edd231 ("scsi: hpsa: Ignore errors for unsupported LV_DEVICE_ID VPD page")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c
index 2773dd7a2087..a22295ee3b70 100644
--- a/drivers/scsi/hpsa.c
+++ b/drivers/scsi/hpsa.c
@@ -3827,7 +3827,7 @@ static int hpsa_update_device_info(struct ctlr_info *h,
 	memset(this_device->device_id, 0,
 		sizeof(this_device->device_id));
 	if (hpsa_get_device_id(h, scsi3addr, this_device->device_id, 8,
-		sizeof(this_device->device_id) < 0))
+		sizeof(this_device->device_id)) < 0)
 		dev_err(&h->pdev->dev,
 			"hpsa%d: %s: can't get device id for host %d:C0:T%d:L%d\t%s\t%.16s\n",
 			h->ctlr, __func__,

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] scsi: hpsa: fix the device_id in hpsa_update_device_info()
  2017-08-17 14:44 [PATCH] scsi: hpsa: fix the device_id in hpsa_update_device_info() Dan Carpenter
@ 2017-08-17 14:48 ` Hannes Reinecke
  2017-08-17 16:51 ` Martin K. Petersen
  1 sibling, 0 replies; 3+ messages in thread
From: Hannes Reinecke @ 2017-08-17 14:48 UTC (permalink / raw)
  To: Dan Carpenter, Don Brace
  Cc: James E.J. Bottomley, Martin K. Petersen, esc.storagedev,
	linux-scsi, kernel-janitors

On 08/17/2017 04:44 PM, Dan Carpenter wrote:
> The parentheses are in the wrong place so we specify the length as
> "sizeof(this_device->device_id) < 0" which is zero.
> 
> Fixes: 988b87edd231 ("scsi: hpsa: Ignore errors for unsupported LV_DEVICE_ID VPD page")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> 
> diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c
> index 2773dd7a2087..a22295ee3b70 100644
> --- a/drivers/scsi/hpsa.c
> +++ b/drivers/scsi/hpsa.c
> @@ -3827,7 +3827,7 @@ static int hpsa_update_device_info(struct ctlr_info *h,
>  	memset(this_device->device_id, 0,
>  		sizeof(this_device->device_id));
>  	if (hpsa_get_device_id(h, scsi3addr, this_device->device_id, 8,
> -		sizeof(this_device->device_id) < 0))
> +		sizeof(this_device->device_id)) < 0)
>  		dev_err(&h->pdev->dev,
>  			"hpsa%d: %s: can't get device id for host %d:C0:T%d:L%d\t%s\t%.16s\n",
>  			h->ctlr, __func__,
> 
Reviewed-by: Hannes Reinecke <hare@suse.com>

Cheers,

Hannes
-- 
Dr. Hannes Reinecke		   Teamlead Storage & Networking
hare@suse.de			               +49 911 74053 688
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton
HRB 21284 (AG Nürnberg)

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] scsi: hpsa: fix the device_id in hpsa_update_device_info()
  2017-08-17 14:44 [PATCH] scsi: hpsa: fix the device_id in hpsa_update_device_info() Dan Carpenter
  2017-08-17 14:48 ` Hannes Reinecke
@ 2017-08-17 16:51 ` Martin K. Petersen
  1 sibling, 0 replies; 3+ messages in thread
From: Martin K. Petersen @ 2017-08-17 16:51 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Don Brace, . Hannes Reinecke, James E.J. Bottomley,
	Martin K. Petersen, esc.storagedev, linux-scsi, kernel-janitors


Dan,

> The parentheses are in the wrong place so we specify the length as
> "sizeof(this_device->device_id) < 0" which is zero.

Applied to 4.14/scsi-queue. Thank you!

-- 
Martin K. Petersen	Oracle Linux Engineering

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-08-17 16:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-17 14:44 [PATCH] scsi: hpsa: fix the device_id in hpsa_update_device_info() Dan Carpenter
2017-08-17 14:48 ` Hannes Reinecke
2017-08-17 16:51 ` Martin K. Petersen

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).