Linux SCSI subsystem development
 help / color / mirror / Atom feed
* [PATCH] pcmraid: fix endianness problems
@ 2009-11-03 17:15 James Bottomley
  2009-11-03 19:29 ` Anil Ravindranath
  0 siblings, 1 reply; 3+ messages in thread
From: James Bottomley @ 2009-11-03 17:15 UTC (permalink / raw)
  To: Anil Ravindranath; +Cc: linux-scsi

There's a compile problem with pcmraid on BE platforms because the flags
machine mailbox register is only 8 bits wide:

drivers/scsi/pmcraid.c: In function 'pmcraid_request_sense':
drivers/scsi/pmcraid.c:2259: warning: large integer implicitly truncated to unsigned type
drivers/scsi/pmcraid.c: In function 'pmcraid_build_ioadl':
drivers/scsi/pmcraid.c:3025: warning: large integer implicitly truncated to unsigned type
drivers/scsi/pmcraid.c: In function 'pmcraid_build_passthrough_ioadls':
drivers/scsi/pmcraid.c:3395: warning: large integer implicitly truncated to unsigned type
drivers/scsi/pmcraid.c: In function 'pmcraid_querycfg':
drivers/scsi/pmcraid.c:5322: warning: large integer implicitly truncated to unsigned type

The fix, I think, is just to remove the spurious cpu_to_le32 wrappers

James

---

diff --git a/drivers/scsi/pmcraid.c b/drivers/scsi/pmcraid.c
index 86d158e..ef4102e 100644
--- a/drivers/scsi/pmcraid.c
+++ b/drivers/scsi/pmcraid.c
@@ -2256,7 +2256,7 @@ static void pmcraid_request_sense(struct pmcraid_cmd *cmd)
 
 	ioadl->address = cpu_to_le64(cmd->sense_buffer_dma);
 	ioadl->data_len = cpu_to_le32(SCSI_SENSE_BUFFERSIZE);
-	ioadl->flags = cpu_to_le32(IOADL_FLAGS_LAST_DESC);
+	ioadl->flags = IOADL_FLAGS_LAST_DESC;
 
 	/* request sense might be called as part of error response processing
 	 * which runs in tasklets context. It is possible that mid-layer might
@@ -3022,7 +3022,7 @@ static int pmcraid_build_ioadl(
 		ioadl[i].flags = 0;
 	}
 	/* setup last descriptor */
-	ioadl[i - 1].flags = cpu_to_le32(IOADL_FLAGS_LAST_DESC);
+	ioadl[i - 1].flags = IOADL_FLAGS_LAST_DESC;
 
 	return 0;
 }
@@ -3392,7 +3392,7 @@ static int pmcraid_build_passthrough_ioadls(
 	}
 
 	/* setup the last descriptor */
-	ioadl[i - 1].flags = cpu_to_le32(IOADL_FLAGS_LAST_DESC);
+	ioadl[i - 1].flags = IOADL_FLAGS_LAST_DESC;
 
 	return 0;
 }
@@ -5319,7 +5319,7 @@ static void pmcraid_querycfg(struct pmcraid_cmd *cmd)
 		cpu_to_le32(sizeof(struct pmcraid_config_table));
 
 	ioadl = &(ioarcb->add_data.u.ioadl[0]);
-	ioadl->flags = cpu_to_le32(IOADL_FLAGS_LAST_DESC);
+	ioadl->flags = IOADL_FLAGS_LAST_DESC;
 	ioadl->address = cpu_to_le64(pinstance->cfg_table_bus_addr);
 	ioadl->data_len = cpu_to_le32(sizeof(struct pmcraid_config_table));
 



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

* Re: [PATCH] pcmraid: fix endianness problems
  2009-11-03 17:15 [PATCH] pcmraid: fix endianness problems James Bottomley
@ 2009-11-03 19:29 ` Anil Ravindranath
  2009-11-03 21:31   ` James Bottomley
  0 siblings, 1 reply; 3+ messages in thread
From: Anil Ravindranath @ 2009-11-03 19:29 UTC (permalink / raw)
  To: James Bottomley; +Cc: linux-scsi, anil_ravindranath

James,

Yes. We can remove these spurious cpu_to_le32 wrappers for 8 bits.
I had already submitted a patch dated: Sep 24 to address this. The subject 
of the mail/patch was:
PATCH 1/1] pmcraid: Fix ppc64 driver build for using cpu_to_le32 on U8 
data type

In addition to below, I have made one more similar change as well -

pmcraid.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- scsi-misc-2.6.orig/drivers/scsi/pmcraid.c	2009-11-03 11:22:49.000000000 -0800
+++ scsi-misc-2.6/drivers/scsi/pmcraid.c	2009-11-03 11:25:06.000000000 -0800
@@ -1076,7 +1076,7 @@
 
 	ioarcb->data_transfer_length = cpu_to_le32(rcb_size);
 
-	ioadl[0].flags |= cpu_to_le32(IOADL_FLAGS_READ_LAST);
+	ioadl[0].flags |= IOADL_FLAGS_READ_LAST;
 	ioadl[0].data_len = cpu_to_le32(rcb_size);
 	ioadl[0].address = cpu_to_le32(dma);
 

On Tue, 3 Nov 2009, James Bottomley wrote:

> There's a compile problem with pcmraid on BE platforms because the flags
> machine mailbox register is only 8 bits wide:
> 
> drivers/scsi/pmcraid.c: In function 'pmcraid_request_sense':
> drivers/scsi/pmcraid.c:2259: warning: large integer implicitly truncated to unsigned type
> drivers/scsi/pmcraid.c: In function 'pmcraid_build_ioadl':
> drivers/scsi/pmcraid.c:3025: warning: large integer implicitly truncated to unsigned type
> drivers/scsi/pmcraid.c: In function 'pmcraid_build_passthrough_ioadls':
> drivers/scsi/pmcraid.c:3395: warning: large integer implicitly truncated to unsigned type
> drivers/scsi/pmcraid.c: In function 'pmcraid_querycfg':
> drivers/scsi/pmcraid.c:5322: warning: large integer implicitly truncated to unsigned type
> 
> The fix, I think, is just to remove the spurious cpu_to_le32 wrappers
> 
> James
> 
> ---
> 
> diff --git a/drivers/scsi/pmcraid.c b/drivers/scsi/pmcraid.c
> index 86d158e..ef4102e 100644
> --- a/drivers/scsi/pmcraid.c
> +++ b/drivers/scsi/pmcraid.c
> @@ -2256,7 +2256,7 @@ static void pmcraid_request_sense(struct pmcraid_cmd *cmd)
>  
>  	ioadl->address = cpu_to_le64(cmd->sense_buffer_dma);
>  	ioadl->data_len = cpu_to_le32(SCSI_SENSE_BUFFERSIZE);
> -	ioadl->flags = cpu_to_le32(IOADL_FLAGS_LAST_DESC);
> +	ioadl->flags = IOADL_FLAGS_LAST_DESC;
>  
>  	/* request sense might be called as part of error response processing
>  	 * which runs in tasklets context. It is possible that mid-layer might
> @@ -3022,7 +3022,7 @@ static int pmcraid_build_ioadl(
>  		ioadl[i].flags = 0;
>  	}
>  	/* setup last descriptor */
> -	ioadl[i - 1].flags = cpu_to_le32(IOADL_FLAGS_LAST_DESC);
> +	ioadl[i - 1].flags = IOADL_FLAGS_LAST_DESC;
>  
>  	return 0;
>  }
> @@ -3392,7 +3392,7 @@ static int pmcraid_build_passthrough_ioadls(
>  	}
>  
>  	/* setup the last descriptor */
> -	ioadl[i - 1].flags = cpu_to_le32(IOADL_FLAGS_LAST_DESC);
> +	ioadl[i - 1].flags = IOADL_FLAGS_LAST_DESC;
>  
>  	return 0;
>  }
> @@ -5319,7 +5319,7 @@ static void pmcraid_querycfg(struct pmcraid_cmd *cmd)
>  		cpu_to_le32(sizeof(struct pmcraid_config_table));
>  
>  	ioadl = &(ioarcb->add_data.u.ioadl[0]);
> -	ioadl->flags = cpu_to_le32(IOADL_FLAGS_LAST_DESC);
> +	ioadl->flags = IOADL_FLAGS_LAST_DESC;
>  	ioadl->address = cpu_to_le64(pinstance->cfg_table_bus_addr);
>  	ioadl->data_len = cpu_to_le32(sizeof(struct pmcraid_config_table));
>  
> 
> 
> 

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

* Re: [PATCH] pcmraid: fix endianness problems
  2009-11-03 19:29 ` Anil Ravindranath
@ 2009-11-03 21:31   ` James Bottomley
  0 siblings, 0 replies; 3+ messages in thread
From: James Bottomley @ 2009-11-03 21:31 UTC (permalink / raw)
  To: Anil Ravindranath; +Cc: linux-scsi

On Tue, 2009-11-03 at 11:29 -0800, Anil Ravindranath wrote:
> James,
> 
> Yes. We can remove these spurious cpu_to_le32 wrappers for 8 bits.
> I had already submitted a patch dated: Sep 24 to address this. The subject 
> of the mail/patch was:
> PATCH 1/1] pmcraid: Fix ppc64 driver build for using cpu_to_le32 on U8 
> data type

Sorry ... found it now.  I'll add it to the list for scsi-misc.

Thanks,

James



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

end of thread, other threads:[~2009-11-03 21:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-03 17:15 [PATCH] pcmraid: fix endianness problems James Bottomley
2009-11-03 19:29 ` Anil Ravindranath
2009-11-03 21:31   ` James Bottomley

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