linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Remove endianness attribute in ata_tf_to_fis
@ 2013-08-31 16:20 Marc C
  2013-08-31 16:20 ` [PATCH] libata: Remove unneeded __le32 " Marc C
  2013-09-01 13:21 ` [PATCH] Remove endianness attribute " Tejun Heo
  0 siblings, 2 replies; 4+ messages in thread
From: Marc C @ 2013-08-31 16:20 UTC (permalink / raw)
  To: tj, linux-ide; +Cc: Marc Carino

From: Marc Carino <marc.ceeeee@gmail.com>

This patch cleans up the following build warning:

---
reproduce: make C=1 CF=-D__CHECK_ENDIAN__


sparse warnings: (new ones prefixed by >>)

>> drivers/ata/libata-core.c:574:19: sparse: restricted __le32 degrades to integer
>> drivers/ata/libata-core.c:575:20: sparse: restricted __le32 degrades to integer
>> drivers/ata/libata-core.c:576:20: sparse: restricted __le32 degrades to integer
>> drivers/ata/libata-core.c:577:20: sparse: restricted __le32 degrades to integer

vim +574 drivers/ata/libata-core.c

   568
   569          fis[12] = tf->nsect;
   570          fis[13] = tf->hob_nsect;
   571          fis[14] = 0;
   572          fis[15] = tf->ctl;
   573
 > 574          fis[16] = aux & 0xff;
   575          fis[17] = (aux >> 8) & 0xff;
   576          fis[18] = (aux >> 16) & 0xff;
   577          fis[19] = (aux >> 24) & 0xff;
   578  }
   579
   580  /**
---

Marc Carino (1):
  libata: Remove unneeded __le32 in ata_tf_to_fis

 drivers/ata/libata-core.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

-- 
1.8.1.2


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

* [PATCH] libata: Remove unneeded __le32 in ata_tf_to_fis
  2013-08-31 16:20 [PATCH] Remove endianness attribute in ata_tf_to_fis Marc C
@ 2013-08-31 16:20 ` Marc C
  2013-09-01 13:21   ` Tejun Heo
  2013-09-01 13:21 ` [PATCH] Remove endianness attribute " Tejun Heo
  1 sibling, 1 reply; 4+ messages in thread
From: Marc C @ 2013-08-31 16:20 UTC (permalink / raw)
  To: tj, linux-ide; +Cc: Marc Carino

From: Marc Carino <marc.ceeeee@gmail.com>

The endianness attribute on the 'aux' local variable wasn't
necessary, so remove it.

Signed-off-by: Marc Carino <marc.ceeeee@gmail.com>
---
 drivers/ata/libata-core.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index a044be9..83b1a9f 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -546,8 +546,6 @@ int atapi_cmd_type(u8 opcode)
  */
 void ata_tf_to_fis(const struct ata_taskfile *tf, u8 pmp, int is_cmd, u8 *fis)
 {
-	const __le32 aux = cpu_to_le32(tf->auxiliary);
-
 	fis[0] = 0x27;			/* Register - Host to Device FIS */
 	fis[1] = pmp & 0xf;		/* Port multiplier number*/
 	if (is_cmd)
@@ -571,10 +569,10 @@ void ata_tf_to_fis(const struct ata_taskfile *tf, u8 pmp, int is_cmd, u8 *fis)
 	fis[14] = 0;
 	fis[15] = tf->ctl;
 
-	fis[16] = aux & 0xff;
-	fis[17] = (aux >> 8) & 0xff;
-	fis[18] = (aux >> 16) & 0xff;
-	fis[19] = (aux >> 24) & 0xff;
+	fis[16] = tf->auxiliary & 0xff;
+	fis[17] = (tf->auxiliary >> 8) & 0xff;
+	fis[18] = (tf->auxiliary >> 16) & 0xff;
+	fis[19] = (tf->auxiliary >> 24) & 0xff;
 }
 
 /**
-- 
1.8.1.2


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

* Re: [PATCH] libata: Remove unneeded __le32 in ata_tf_to_fis
  2013-08-31 16:20 ` [PATCH] libata: Remove unneeded __le32 " Marc C
@ 2013-09-01 13:21   ` Tejun Heo
  0 siblings, 0 replies; 4+ messages in thread
From: Tejun Heo @ 2013-09-01 13:21 UTC (permalink / raw)
  To: Marc C; +Cc: linux-ide

On Sat, Aug 31, 2013 at 09:20:33AM -0700, Marc C wrote:
> From: Marc Carino <marc.ceeeee@gmail.com>
> 
> The endianness attribute on the 'aux' local variable wasn't
> necessary, so remove it.

This is a bug fix on big endian machines, right?  The above
description doesn't match the patch content.

Thanks.

-- 
tejun

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

* Re: [PATCH] Remove endianness attribute in ata_tf_to_fis
  2013-08-31 16:20 [PATCH] Remove endianness attribute in ata_tf_to_fis Marc C
  2013-08-31 16:20 ` [PATCH] libata: Remove unneeded __le32 " Marc C
@ 2013-09-01 13:21 ` Tejun Heo
  1 sibling, 0 replies; 4+ messages in thread
From: Tejun Heo @ 2013-09-01 13:21 UTC (permalink / raw)
  To: Marc C; +Cc: linux-ide

On Sat, Aug 31, 2013 at 09:20:32AM -0700, Marc C wrote:
> From: Marc Carino <marc.ceeeee@gmail.com>
> 
> This patch cleans up the following build warning:

Please roll these two changes into a single patch and state clearly
that it is a bug fix.

Thanks!

-- 
tejun

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

end of thread, other threads:[~2013-09-01 13:21 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-31 16:20 [PATCH] Remove endianness attribute in ata_tf_to_fis Marc C
2013-08-31 16:20 ` [PATCH] libata: Remove unneeded __le32 " Marc C
2013-09-01 13:21   ` Tejun Heo
2013-09-01 13:21 ` [PATCH] Remove endianness attribute " Tejun Heo

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