[PATCH] [SCSI] mpt2sas, mpt3sas: fix sparse warings restricted __le16 degrades to integer
From: Sreekanth Reddy
Date: Mon Jan 12 2015 - 07:53:06 EST
Fixed sparse warings 'restricted __le16 degrades to integer' generated
from below titled patch
[PATCH v2 02/22] [SCSI] mpt2sas, mpt3sas: Added support to log message
when Temperature Threshold exceeds for any Sensor
Signed-off-by: Sreekanth Reddy <Sreekanth.Reddy@xxxxxxxxxxxxx>
---
drivers/scsi/mpt2sas/mpt2sas_scsih.c | 12 ++++++------
drivers/scsi/mpt3sas/mpt3sas_scsih.c | 12 ++++++------
2 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/drivers/scsi/mpt2sas/mpt2sas_scsih.c b/drivers/scsi/mpt2sas/mpt2sas_scsih.c
index 5950731..3f26147 100644
--- a/drivers/scsi/mpt2sas/mpt2sas_scsih.c
+++ b/drivers/scsi/mpt2sas/mpt2sas_scsih.c
@@ -3670,12 +3670,12 @@ _scsih_temp_threshold_events(struct MPT2SAS_ADAPTER *ioc,
{
if (ioc->temp_sensors_count >= event_data->SensorNum) {
printk(MPT2SAS_ERR_FMT "Temperature Threshold flags %s%s%s%s"
- " exceeded for Sensor: %d !!!\n", ioc->name,
- ((event_data->Status & 0x1) == 1) ? "0 " : " ",
- ((event_data->Status & 0x2) == 2) ? "1 " : " ",
- ((event_data->Status & 0x4) == 4) ? "2 " : " ",
- ((event_data->Status & 0x8) == 8) ? "3 " : " ",
- event_data->SensorNum);
+ " exceeded for Sensor: %d !!!\n", ioc->name,
+ ((le16_to_cpu(event_data->Status) & 0x1) == 1) ? "0 " : " ",
+ ((le16_to_cpu(event_data->Status) & 0x2) == 2) ? "1 " : " ",
+ ((le16_to_cpu(event_data->Status) & 0x4) == 4) ? "2 " : " ",
+ ((le16_to_cpu(event_data->Status) & 0x8) == 8) ? "3 " : " ",
+ event_data->SensorNum);
printk(MPT2SAS_ERR_FMT "Current Temp In Celsius: %d\n",
ioc->name, event_data->CurrentTemperature);
}
diff --git a/drivers/scsi/mpt3sas/mpt3sas_scsih.c b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
index e8e6bd4..5a97e32 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_scsih.c
+++ b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
@@ -3364,12 +3364,12 @@ _scsih_temp_threshold_events(struct MPT3SAS_ADAPTER *ioc,
{
if (ioc->temp_sensors_count >= event_data->SensorNum) {
pr_err(MPT3SAS_FMT "Temperature Threshold flags %s%s%s%s"
- " exceeded for Sensor: %d !!!\n", ioc->name,
- ((event_data->Status & 0x1) == 1) ? "0 " : " ",
- ((event_data->Status & 0x2) == 2) ? "1 " : " ",
- ((event_data->Status & 0x4) == 4) ? "2 " : " ",
- ((event_data->Status & 0x8) == 8) ? "3 " : " ",
- event_data->SensorNum);
+ " exceeded for Sensor: %d !!!\n", ioc->name,
+ ((le16_to_cpu(event_data->Status) & 0x1) == 1) ? "0 " : " ",
+ ((le16_to_cpu(event_data->Status) & 0x2) == 2) ? "1 " : " ",
+ ((le16_to_cpu(event_data->Status) & 0x4) == 4) ? "2 " : " ",
+ ((le16_to_cpu(event_data->Status) & 0x8) == 8) ? "3 " : " ",
+ event_data->SensorNum);
pr_err(MPT3SAS_FMT "Current Temp In Celsius: %d\n",
ioc->name, event_data->CurrentTemperature);
}
--
2.0.2
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/