linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] sata_mv: endian annotations
@ 2006-05-21 11:51 Alexey Dobriyan
  2006-05-22  6:37 ` Jeff Garzik
  0 siblings, 1 reply; 6+ messages in thread
From: Alexey Dobriyan @ 2006-05-21 11:51 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: Al Viro, Mark Lord, linux-ide

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
---

 drivers/scsi/sata_mv.c |   28 ++++++++++++++--------------
 1 file changed, 14 insertions(+), 14 deletions(-)

--- a/drivers/scsi/sata_mv.c
+++ b/drivers/scsi/sata_mv.c
@@ -272,32 +272,32 @@ enum chip_type {
 
 /* Command ReQuest Block: 32B */
 struct mv_crqb {
-	u32			sg_addr;
-	u32			sg_addr_hi;
-	u16			ctrl_flags;
-	u16			ata_cmd[11];
+	__le32			sg_addr;
+	__le32			sg_addr_hi;
+	__le16			ctrl_flags;
+	__le16			ata_cmd[11];
 };
 
 struct mv_crqb_iie {
-	u32			addr;
-	u32			addr_hi;
-	u32			flags;
+	__le32			addr;
+	__le32			addr_hi;
+	__le32			flags;
 	u32			len;
-	u32			ata_cmd[4];
+	__le32			ata_cmd[4];
 };
 
 /* Command ResPonse Block: 8B */
 struct mv_crpb {
 	u16			id;
-	u16			flags;
+	__le16			flags;
 	u32			tmstmp;
 };
 
 /* EDMA Physical Region Descriptor (ePRD); A.K.A. SG */
 struct mv_sg {
-	u32			addr;
-	u32			flags_size;
-	u32			addr_hi;
+	__le32			addr;
+	__le32			flags_size;
+	__le32			addr_hi;
 	u32			reserved;
 };
 
@@ -1028,7 +1028,7 @@ static inline unsigned mv_inc_q_index(un
 	return (index + 1) & MV_MAX_Q_DEPTH_MASK;
 }
 
-static inline void mv_crqb_pack_cmd(u16 *cmdw, u8 data, u8 addr, unsigned last)
+static inline void mv_crqb_pack_cmd(__le16 *cmdw, u8 data, u8 addr, unsigned last)
 {
 	u16 tmp = data | (addr << CRQB_CMD_ADDR_SHIFT) | CRQB_CMD_CS |
 		(last ? CRQB_CMD_LAST : 0);
@@ -1051,7 +1051,7 @@ static void mv_qc_prep(struct ata_queued
 {
 	struct ata_port *ap = qc->ap;
 	struct mv_port_priv *pp = ap->private_data;
-	u16 *cw;
+	__le16 *cw;
 	struct ata_taskfile *tf;
 	u16 flags = 0;
 	unsigned in_index;


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

* Re: [PATCH] sata_mv: endian annotations
  2006-05-21 11:51 [PATCH] sata_mv: endian annotations Alexey Dobriyan
@ 2006-05-22  6:37 ` Jeff Garzik
  2006-05-22 22:56   ` Mark Lord
  0 siblings, 1 reply; 6+ messages in thread
From: Jeff Garzik @ 2006-05-22  6:37 UTC (permalink / raw)
  To: Alexey Dobriyan; +Cc: Al Viro, Mark Lord, linux-ide

Alexey Dobriyan wrote:
> Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>

Unless Mark objects, I'll merge this into #upstream (2.6.18) soon.

	Jeff




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

* Re: [PATCH] sata_mv: endian annotations
  2006-05-22  6:37 ` Jeff Garzik
@ 2006-05-22 22:56   ` Mark Lord
  2006-05-22 22:58     ` Mark Lord
  2006-05-22 23:02     ` Mark Lord
  0 siblings, 2 replies; 6+ messages in thread
From: Mark Lord @ 2006-05-22 22:56 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: Alexey Dobriyan, Al Viro, linux-ide

On Monday 22 May 2006 02:37, Jeff Garzik wrote:
> Alexey Dobriyan wrote:
> > Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
> 
> Unless Mark objects, I'll merge this into #upstream (2.6.18) soon.
> 
> 	Jeff

Well, if we're going to use the endian annotation types,
then we may as well mark *all* of the __le* hardware fields,
not just a few of them.

Thus, this extended version of Alexey's original patch:

Signed-off-by: Mark Lord <liml@rtr.ca>

---
--- linux/drivers/scsi/sata_mv.c	2006-05-19 15:59:51.000000000 -0400
+++ linux/drivers/scsi/sata_mv.c	2006-05-22 18:52:37.000000000 -0400
@@ -272,33 +272,33 @@
 
 /* Command ReQuest Block: 32B */
 struct mv_crqb {
-	u32			sg_addr;
-	u32			sg_addr_hi;
-	u16			ctrl_flags;
-	u16			ata_cmd[11];
+	__u32			sg_addr;
+	__u32			sg_addr_hi;
+	__u16			ctrl_flags;
+	__u16			ata_cmd[11];
 };
 
 struct mv_crqb_iie {
-	u32			addr;
-	u32			addr_hi;
-	u32			flags;
-	u32			len;
-	u32			ata_cmd[4];
+	__u32			addr;
+	__u32			addr_hi;
+	__u32			flags;
+	__u32			len;
+	__u32			ata_cmd[4];
 };
 
 /* Command ResPonse Block: 8B */
 struct mv_crpb {
-	u16			id;
-	u16			flags;
-	u32			tmstmp;
+	__u16			id;
+	__u16			flags;
+	__u32			tmstmp;
 };
 
 /* EDMA Physical Region Descriptor (ePRD); A.K.A. SG */
 struct mv_sg {
-	u32			addr;
-	u32			flags_size;
-	u32			addr_hi;
-	u32			reserved;
+	__u32			addr;
+	__u32			flags_size;
+	__u32			addr_hi;
+	__u32			reserved;
 };
 
 struct mv_port_priv {
@@ -1028,7 +1028,7 @@
 	return (index + 1) & MV_MAX_Q_DEPTH_MASK;
 }
 
-static inline void mv_crqb_pack_cmd(u16 *cmdw, u8 data, u8 addr, unsigned last)
+static inline void mv_crqb_pack_cmd(__u16 *cmdw, u8 data, u8 addr, unsigned last)
 {
 	u16 tmp = data | (addr << CRQB_CMD_ADDR_SHIFT) | CRQB_CMD_CS |
 		(last ? CRQB_CMD_LAST : 0);
@@ -1051,7 +1051,7 @@
 {
 	struct ata_port *ap = qc->ap;
 	struct mv_port_priv *pp = ap->private_data;
-	u16 *cw;
+	__u16 *cw;
 	struct ata_taskfile *tf;
 	u16 flags = 0;
 	unsigned in_index;

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

* Re: [PATCH] sata_mv: endian annotations
  2006-05-22 22:56   ` Mark Lord
@ 2006-05-22 22:58     ` Mark Lord
  2006-05-22 23:02     ` Mark Lord
  1 sibling, 0 replies; 6+ messages in thread
From: Mark Lord @ 2006-05-22 22:58 UTC (permalink / raw)
  To: Mark Lord; +Cc: Jeff Garzik, Alexey Dobriyan, Al Viro, linux-ide

Mark Lord wrote:
> On Monday 22 May 2006 02:37, Jeff Garzik wrote:
>> Alexey Dobriyan wrote:
>>> Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
>> Unless Mark objects, I'll merge this into #upstream (2.6.18) soon.
>>
>> 	Jeff
> 
> Well, if we're going to use the endian annotation types,
> then we may as well mark *all* of the __le* hardware fields,
> not just a few of them.
> 
> Thus, this extended version of Alexey's original patch:
> 
..

Scrub that.. I'll redo it and repost shortly, after gcc finishes with it.

-ml

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

* Re: [PATCH] sata_mv: endian annotations
  2006-05-22 22:56   ` Mark Lord
  2006-05-22 22:58     ` Mark Lord
@ 2006-05-22 23:02     ` Mark Lord
  2006-05-22 23:16       ` Jeff Garzik
  1 sibling, 1 reply; 6+ messages in thread
From: Mark Lord @ 2006-05-22 23:02 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: Alexey Dobriyan, Al Viro, linux-ide

On Monday 22 May 2006 18:56, Mark Lord wrote:
> On Monday 22 May 2006 02:37, Jeff Garzik wrote:
> > Alexey Dobriyan wrote:
> > > Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
> > 
> > Unless Mark objects, I'll merge this into #upstream (2.6.18) soon.
> > 
> > 	Jeff
> 
> Well, if we're going to use the endian annotation types,
> then we may as well mark *all* of the __le* hardware fields,
> not just a few of them.
> 
> Thus, this extended version of Alexey's original patch:

Okay, for real this time:

Signed-off-by: Mark Lord <liml@rtr.ca>

---
--- linux/drivers/scsi/sata_mv.c.orig	2006-05-19 15:59:51.000000000 -0400
+++ linux/drivers/scsi/sata_mv.c	2006-05-22 18:58:38.000000000 -0400
@@ -272,33 +272,33 @@
 
 /* Command ReQuest Block: 32B */
 struct mv_crqb {
-	u32			sg_addr;
-	u32			sg_addr_hi;
-	u16			ctrl_flags;
-	u16			ata_cmd[11];
+	__le32			sg_addr;
+	__le32			sg_addr_hi;
+	__le16			ctrl_flags;
+	__le16			ata_cmd[11];
 };
 
 struct mv_crqb_iie {
-	u32			addr;
-	u32			addr_hi;
-	u32			flags;
-	u32			len;
-	u32			ata_cmd[4];
+	__le32			addr;
+	__le32			addr_hi;
+	__le32			flags;
+	__le32			len;
+	__le32			ata_cmd[4];
 };
 
 /* Command ResPonse Block: 8B */
 struct mv_crpb {
-	u16			id;
-	u16			flags;
-	u32			tmstmp;
+	__le16			id;
+	__le16			flags;
+	__le32			tmstmp;
 };
 
 /* EDMA Physical Region Descriptor (ePRD); A.K.A. SG */
 struct mv_sg {
-	u32			addr;
-	u32			flags_size;
-	u32			addr_hi;
-	u32			reserved;
+	__le32			addr;
+	__le32			flags_size;
+	__le32			addr_hi;
+	__le32			reserved;
 };
 
 struct mv_port_priv {
@@ -1028,7 +1028,7 @@
 	return (index + 1) & MV_MAX_Q_DEPTH_MASK;
 }
 
-static inline void mv_crqb_pack_cmd(u16 *cmdw, u8 data, u8 addr, unsigned last)
+static inline void mv_crqb_pack_cmd(__le16 *cmdw, u8 data, u8 addr, unsigned last)
 {
 	u16 tmp = data | (addr << CRQB_CMD_ADDR_SHIFT) | CRQB_CMD_CS |
 		(last ? CRQB_CMD_LAST : 0);
@@ -1051,7 +1051,7 @@
 {
 	struct ata_port *ap = qc->ap;
 	struct mv_port_priv *pp = ap->private_data;
-	u16 *cw;
+	__le16 *cw;
 	struct ata_taskfile *tf;
 	u16 flags = 0;
 	unsigned in_index;


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

* Re: [PATCH] sata_mv: endian annotations
  2006-05-22 23:02     ` Mark Lord
@ 2006-05-22 23:16       ` Jeff Garzik
  0 siblings, 0 replies; 6+ messages in thread
From: Jeff Garzik @ 2006-05-22 23:16 UTC (permalink / raw)
  To: Mark Lord; +Cc: Alexey Dobriyan, Al Viro, linux-ide

Mark Lord wrote:
> On Monday 22 May 2006 18:56, Mark Lord wrote:
>> On Monday 22 May 2006 02:37, Jeff Garzik wrote:
>>> Alexey Dobriyan wrote:
>>>> Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
>>> Unless Mark objects, I'll merge this into #upstream (2.6.18) soon.
>>>
>>> 	Jeff
>> Well, if we're going to use the endian annotation types,
>> then we may as well mark *all* of the __le* hardware fields,
>> not just a few of them.
>>
>> Thus, this extended version of Alexey's original patch:
> 
> Okay, for real this time:
> 
> Signed-off-by: Mark Lord <liml@rtr.ca>

Thanks, it's in my 'Pending' folder now.

If you would, install sparse and make sure 'make check' (kernel makefile 
target) continues to be happy with sata_mv.  That's largely what the 
endian types are for -- advanced source analysis tools like sparse.

	Jeff




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

end of thread, other threads:[~2006-05-22 23:16 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-05-21 11:51 [PATCH] sata_mv: endian annotations Alexey Dobriyan
2006-05-22  6:37 ` Jeff Garzik
2006-05-22 22:56   ` Mark Lord
2006-05-22 22:58     ` Mark Lord
2006-05-22 23:02     ` Mark Lord
2006-05-22 23:16       ` Jeff Garzik

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