linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] hpsa: fix bad comparison of signed with unsigned in hpsa_update_scsi_devices
@ 2014-05-21 16:16 Stephen M. Cameron
  2014-05-21 16:16 ` [PATCH 2/3] hpsa: return -ENOMEM not -1 on kzalloc failure in hpsa_get_device_id Stephen M. Cameron
  2014-05-21 16:16 ` [PATCH 3/3] hpsa: fix handling of hpsa_volume_offline return value Stephen M. Cameron
  0 siblings, 2 replies; 3+ messages in thread
From: Stephen M. Cameron @ 2014-05-21 16:16 UTC (permalink / raw)
  To: =james.bottomley
  Cc: martin.petersen, linux-scsi, stephenmcameron, joseph.t.handzik,
	thenzl, michael.miller, scott.teel, hch, dan.carpenter

From: Joe Handzik <joseph.t.handzik@hp.com>

rescan_hba_mode was defined as a u8 so could never be less than zero:

        rescan_hba_mode = hpsa_hba_mode_enabled(h);
        if (rescan_hba_mode < 0)
                goto out;

Signed-off-by: Joe Handzik <joseph.t.handzik@hp.com>
Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
---
 drivers/scsi/hpsa.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c
index 654e341..c5b24e6 100644
--- a/drivers/scsi/hpsa.c
+++ b/drivers/scsi/hpsa.c
@@ -3010,7 +3010,7 @@ static void hpsa_update_scsi_devices(struct ctlr_info *h, int hostno)
 	int reportlunsize = sizeof(*physdev_list) + HPSA_MAX_PHYS_LUN * 24;
 	int i, n_ext_target_devs, ndevs_to_allocate;
 	int raid_ctlr_position;
-	u8 rescan_hba_mode;
+	int rescan_hba_mode;
 	DECLARE_BITMAP(lunzerobits, MAX_EXT_TARGETS);
 
 	currentsd = kzalloc(sizeof(*currentsd) * HPSA_MAX_DEVICES, GFP_KERNEL);


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

* [PATCH 2/3] hpsa: return -ENOMEM not -1 on kzalloc failure in hpsa_get_device_id
  2014-05-21 16:16 [PATCH 1/3] hpsa: fix bad comparison of signed with unsigned in hpsa_update_scsi_devices Stephen M. Cameron
@ 2014-05-21 16:16 ` Stephen M. Cameron
  2014-05-21 16:16 ` [PATCH 3/3] hpsa: fix handling of hpsa_volume_offline return value Stephen M. Cameron
  1 sibling, 0 replies; 3+ messages in thread
From: Stephen M. Cameron @ 2014-05-21 16:16 UTC (permalink / raw)
  To: =james.bottomley
  Cc: martin.petersen, linux-scsi, stephenmcameron, joseph.t.handzik,
	thenzl, michael.miller, scott.teel, hch, dan.carpenter

From: Stephen M. Cameron <scameron@beardog.cce.hp.com>

Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
---
 drivers/scsi/hpsa.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c
index c5b24e6..af51e7d 100644
--- a/drivers/scsi/hpsa.c
+++ b/drivers/scsi/hpsa.c
@@ -2430,7 +2430,7 @@ static int hpsa_get_device_id(struct ctlr_info *h, unsigned char *scsi3addr,
 		buflen = 16;
 	buf = kzalloc(64, GFP_KERNEL);
 	if (!buf)
-		return -1;
+		return -ENOMEM;
 	rc = hpsa_scsi_do_inquiry(h, scsi3addr, VPD_PAGE | 0x83, buf, 64);
 	if (rc == 0)
 		memcpy(device_id, &buf[8], buflen);


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

* [PATCH 3/3] hpsa: fix handling of hpsa_volume_offline return value
  2014-05-21 16:16 [PATCH 1/3] hpsa: fix bad comparison of signed with unsigned in hpsa_update_scsi_devices Stephen M. Cameron
  2014-05-21 16:16 ` [PATCH 2/3] hpsa: return -ENOMEM not -1 on kzalloc failure in hpsa_get_device_id Stephen M. Cameron
@ 2014-05-21 16:16 ` Stephen M. Cameron
  1 sibling, 0 replies; 3+ messages in thread
From: Stephen M. Cameron @ 2014-05-21 16:16 UTC (permalink / raw)
  To: =james.bottomley
  Cc: martin.petersen, linux-scsi, stephenmcameron, joseph.t.handzik,
	thenzl, michael.miller, scott.teel, hch, dan.carpenter

From: Stephen M. Cameron <scameron@beardog.cce.hp.com>

Make return value an int instead of an unsigned char so that
we do not lose negative error return values.

Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
---
 drivers/scsi/hpsa.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c
index af51e7d..13ec036 100644
--- a/drivers/scsi/hpsa.c
+++ b/drivers/scsi/hpsa.c
@@ -1191,7 +1191,7 @@ static void hpsa_monitor_offline_device(struct ctlr_info *h,
 static void hpsa_show_volume_status(struct ctlr_info *h,
 	struct hpsa_scsi_dev_t *sd)
 {
-	if (sd->volume_offline == HPSA_VPD_LV_STATUS_UNSUPPORTED)
+	if (sd->volume_offline == (u8) HPSA_VPD_LV_STATUS_UNSUPPORTED)
 		dev_info(&h->pdev->dev,
 			"C%d:B%d:T%d:L%d Volume status is not available through vital product data pages.\n",
 			h->scsi_host->host_no,
@@ -2547,7 +2547,7 @@ exit_failed:
  *  # (integer code indicating one of several NOT READY states
  *     describing why a volume is to be kept offline)
  */
-static unsigned char hpsa_volume_offline(struct ctlr_info *h,
+static int hpsa_volume_offline(struct ctlr_info *h,
 					unsigned char scsi3addr[])
 {
 	struct CommandList *c;
@@ -2650,7 +2650,7 @@ static int hpsa_update_device_info(struct ctlr_info *h,
 		if (h->fw_support & MISC_FW_RAID_OFFLOAD_BASIC)
 			hpsa_get_ioaccel_status(h, scsi3addr, this_device);
 		this_device->volume_offline =
-			hpsa_volume_offline(h, scsi3addr);
+			(u8) hpsa_volume_offline(h, scsi3addr);
 	} else {
 		this_device->raid_level = RAID_UNKNOWN;
 		this_device->offload_config = 0;


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

end of thread, other threads:[~2014-05-21 16:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-21 16:16 [PATCH 1/3] hpsa: fix bad comparison of signed with unsigned in hpsa_update_scsi_devices Stephen M. Cameron
2014-05-21 16:16 ` [PATCH 2/3] hpsa: return -ENOMEM not -1 on kzalloc failure in hpsa_get_device_id Stephen M. Cameron
2014-05-21 16:16 ` [PATCH 3/3] hpsa: fix handling of hpsa_volume_offline return value Stephen M. Cameron

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