public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* [patch] [SCSI] megaraid_sas: fix a bug for 64 bit arches
@ 2013-06-28 21:21 Dan Carpenter
  2013-07-02  5:11 ` Saxena, Sumit
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2013-06-28 21:21 UTC (permalink / raw)
  To: Neela Syam Kolli, Sumit.Saxena@lsi.com
  Cc: James E.J. Bottomley, linux-scsi, kernel-janitors

On 64 bit then -1UL and -1U are not equal, so these conditions don't
work as intended and it breaks error handling.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/scsi/megaraid/megaraid_sas_fp.c b/drivers/scsi/megaraid/megaraid_sas_fp.c
index 8056eac..4f401f7 100644
--- a/drivers/scsi/megaraid/megaraid_sas_fp.c
+++ b/drivers/scsi/megaraid/megaraid_sas_fp.c
@@ -585,7 +585,7 @@ u8 get_arm(struct megasas_instance *instance, u32 ld, u8 span, u64 stripe,
 	case 1:
 		/* start with logical arm */
 		arm = get_arm_from_strip(instance, ld, stripe, map);
-		if (arm != -1UL)
+		if (arm != -1U)
 			arm *= 2;
 		break;
 	}
@@ -637,7 +637,7 @@ static u8 mr_spanset_get_phy_params(struct megasas_instance *instance, u32 ld,
 
 	if (raid->level == 6) {
 		logArm = get_arm_from_strip(instance, ld, stripRow, map);
-		if (logArm == -1UL)
+		if (logArm == -1U)
 			return FALSE;
 		rowMod = mega_mod64(row, SPAN_ROW_SIZE(map, ld, span));
 		armQ = SPAN_ROW_SIZE(map, ld, span) - 1 - rowMod;

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

* RE: [patch] [SCSI] megaraid_sas: fix a bug for 64 bit arches
  2013-06-28 21:21 [patch] [SCSI] megaraid_sas: fix a bug for 64 bit arches Dan Carpenter
@ 2013-07-02  5:11 ` Saxena, Sumit
  0 siblings, 0 replies; 2+ messages in thread
From: Saxena, Sumit @ 2013-07-02  5:11 UTC (permalink / raw)
  To: Dan Carpenter, DL-MegaRAID Linux
  Cc: James E.J. Bottomley, linux-scsi@vger.kernel.org,
	kernel-janitors@vger.kernel.org

>-----Original Message-----
>From: Dan Carpenter [mailto:dan.carpenter@oracle.com]
>Sent: Saturday, June 29, 2013 2:51 AM
>To: DL-MegaRAID Linux; Saxena, Sumit
>Cc: James E.J. Bottomley; linux-scsi@vger.kernel.org; kernel-
>janitors@vger.kernel.org
>Subject: [patch] [SCSI] megaraid_sas: fix a bug for 64 bit arches
>
>On 64 bit then -1UL and -1U are not equal, so these conditions don't
>work as intended and it breaks error handling.
>
>Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>
>diff --git a/drivers/scsi/megaraid/megaraid_sas_fp.c
>b/drivers/scsi/megaraid/megaraid_sas_fp.c
>index 8056eac..4f401f7 100644
>--- a/drivers/scsi/megaraid/megaraid_sas_fp.c
>+++ b/drivers/scsi/megaraid/megaraid_sas_fp.c
>@@ -585,7 +585,7 @@ u8 get_arm(struct megasas_instance *instance, u32
>ld, u8 span, u64 stripe,
> 	case 1:
> 		/* start with logical arm */
> 		arm = get_arm_from_strip(instance, ld, stripe, map);
>-		if (arm != -1UL)
>+		if (arm != -1U)
> 			arm *= 2;
> 		break;
> 	}
>@@ -637,7 +637,7 @@ static u8 mr_spanset_get_phy_params(struct
>megasas_instance *instance, u32 ld,
>
> 	if (raid->level == 6) {
> 		logArm = get_arm_from_strip(instance, ld, stripRow, map);
>-		if (logArm == -1UL)
>+		if (logArm == -1U)
> 			return FALSE;
> 		rowMod = mega_mod64(row, SPAN_ROW_SIZE(map, ld, span));
> 		armQ = SPAN_ROW_SIZE(map, ld, span) - 1 - rowMod;

Acked-by: Sumit Saxena <sumit.saxena@lsi.com>


Sumit



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

end of thread, other threads:[~2013-07-02  5:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-28 21:21 [patch] [SCSI] megaraid_sas: fix a bug for 64 bit arches Dan Carpenter
2013-07-02  5:11 ` Saxena, Sumit

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox