Re: [PATCH 01/21] hpsa: correct calls to dev_printk

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 10/26/2015 07:52 AM, Tomas Henzl wrote:
On 24.10.2015 21:52, Don Brace wrote:
was seeing issues passing level into hpsa_show_dev_msg and then using
the level as an arguement to dev_printk. For now, switch to dev_warn.

Signed-off-by: Don Brace <don.brace@xxxxxxxx>
---
  drivers/scsi/hpsa.c |   41 ++++++++++++++++++++++++-----------------
  1 file changed, 24 insertions(+), 17 deletions(-)

diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c
index 40669f8..8454f22 100644
--- a/drivers/scsi/hpsa.c
+++ b/drivers/scsi/hpsa.c
@@ -1137,11 +1137,15 @@ static int hpsa_find_target_lun(struct ctlr_info *h,
  static inline void hpsa_show_dev_msg(const char *level, struct ctlr_info *h,
  	struct hpsa_scsi_dev_t *dev, char *description)
  {
-	dev_printk(level, &h->pdev->dev,
+	if (dev == NULL)
+		return;
+
+	dev_warn(&h->pdev->dev,
  			"scsi %d:%d:%d:%d: %s %s %.8s %.16s RAID-%s SSDSmartPathCap%c En%c Exp=%d\n",
  			h->scsi_host->host_no, dev->bus, dev->target, dev->lun,
  			description,
-			scsi_device_type(dev->devtype),
+			dev->devtype >= 0 ?
+				scsi_device_type(dev->devtype) : "unknown",
Can devtype ever be negative? Found only this place in code
where it is set "this_device->devtype = (inq_buff[0] & 0x1f);"
And if it was negative the scsi_device_type will return "Unknown"
anyway. You probably could skip the test now and switch devtype
from int to unsigned in the future.

Cheers,
Tomas


Thanks, changed to unsigned and removed check.
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux