Skip to contentSkip to conversation

misc: atsha204a: Fix big endian support

PATCH In review Pali Rohár 4 participants 8 messages Apr 2, 2022 – Apr 15, 2022 Char and misc drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 misc: atsha204a: Fix big endian support

Callers of function atsha204a_crc16() expect to return value in host cpu endianity. So remove cpu_to_le16() conversion.

---
 drivers/misc/atsha204a-i2c.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/misc/atsha204a-i2c.c +1 -1
index b89463babb56..63fe541dade3 100644
@@ -146,7 +146,7 @@ static u16 atsha204a_crc16(const u8 *buffer, size_t len)
 	while (len--)
 		crc = crc16_byte(crc, *buffer++);
 
-	return cpu_to_le16(crc);
+	return crc;
 }
 
 static int atsha204a_send(struct udevice *dev, const u8 *buf, u8 len)
Signature · 1 line
2.20.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 4 lines · Pali Rohár

Callers of function atsha204a_crc16() expect to return value in host cpu endianity. So remove cpu_to_le16() conversion.

Thanks,
Stefan

Quoted 9 lines
---
  drivers/misc/atsha204a-i2c.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/misc/atsha204a-i2c.c +0 -0
index b89463babb56..63fe541dade3 100644

drivers/misc/atsha204a-i2c.c static u16 atsha204a_crc16(const u8 *buffer, size_t len) · line 152

Quoted 8 lines
drivers/misc/atsha204a-i2c.c +1 -1
@@ -146,7 +146,7 @@ static u16 atsha204a_crc16(const u8 *buffer, size_t len)
  	while (len--)
  		crc = crc16_byte(crc, *buffer++);
 
-	return cpu_to_le16(crc);
+	return crc;
  }
 
  static int atsha204a_send(struct udevice *dev, const u8 *buf, u8 len)

Viele Grüße,
Stefan Roese

Signature · 3 lines
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: [email protected]
#2 lore raw
Quoted 7 lines · On Monday 04 April 2022 09:43:21 Stefan Roese wrote:
Quoted 4 lines · Pali Rohár

Callers of function atsha204a_crc16() expect to return value in host cpu endianity. So remove cpu_to_le16() conversion.

Hello Stefan! Would you or somebody else take this patch?

Because I have some other u-boot generic patches which touches this driver and I'm waiting until this simple change would be merged first.

Quoted 26 lines

Thanks,
Stefan

Quoted 9 lines
---
  drivers/misc/atsha204a-i2c.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/misc/atsha204a-i2c.c +0 -0
index b89463babb56..63fe541dade3 100644

drivers/misc/atsha204a-i2c.c static u16 atsha204a_crc16(const u8 *buffer, size_t len) · line 150

Quoted 6 lines
drivers/misc/atsha204a-i2c.c +1 -1
@@ -146,7 +146,7 @@ static u16 atsha204a_crc16(const u8 *buffer, size_t len)
  	while (len--)
  		crc = crc16_byte(crc, *buffer++);
-	return cpu_to_le16(crc);
+	return crc;
  }
  static int atsha204a_send(struct udevice *dev, const u8 *buf, u8 len)

Viele Grüße,
Stefan Roese

Signature · 3 lines
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: [email protected]
#3 lore raw

Added Tom to To...

Quoted 5 lines · Pali Rohár
Quoted 4 lines · On Monday 04 April 2022 09:43:21 Stefan Roese wrote:
Quoted 3 lines · Pali Rohár

Callers of function atsha204a_crc16() expect to return value in host cpu endianity. So remove cpu_to_le16() conversion.

Quoted 8 lines
Quoted 3 lines
Quoted 1 line

Hello Stefan! Would you or somebody else take this patch?

Because I have some other u-boot generic patches which touches this driver and I'm waiting until this simple change would be merged first.

In general I could do this. But I'm leaving for a vacation in a few days and I'm not sure, if I can squeeze enough "free time" to handle my "U-Boot work".

Tom, could you please pull this patch directly?

Thanks,
Stefan

Quoted 23 lines
Quoted 23 lines

Thanks,
Stefan

Quoted 9 lines
---
   drivers/misc/atsha204a-i2c.c | 2 +-
   1 file changed, 1 insertion(+), 1 deletion(-)
drivers/misc/atsha204a-i2c.c +0 -0
index b89463babb56..63fe541dade3 100644

drivers/misc/atsha204a-i2c.c static u16 atsha204a_crc16(const u8 *buffer, size_t len) · line 150

Quoted 6 lines
drivers/misc/atsha204a-i2c.c +1 -1
@@ -146,7 +146,7 @@ static u16 atsha204a_crc16(const u8 *buffer, size_t len)
   	while (len--)
   		crc = crc16_byte(crc, *buffer++);
-	return cpu_to_le16(crc);
+	return crc;
   }
   static int atsha204a_send(struct udevice *dev, const u8 *buf, u8 len)

Viele Grüße,
Stefan Roese

Quoted 4 lines
Quoted 4 lines
Signature · 3 lines
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: [email protected]

Viele Grüße,
Stefan Roese

Signature · 3 lines
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: [email protected]
#4 lore raw
Quoted 14 lines · Stefan Roese

Added Tom to To...

Quoted 11 lines · Pali Rohár
Quoted 7 lines · On Monday 04 April 2022 09:43:21 Stefan Roese wrote:
Quoted 4 lines · Pali Rohár

Callers of function atsha204a_crc16() expect to return value in host cpu endianity. So remove cpu_to_le16() conversion.

Hello Stefan! Would you or somebody else take this patch?

Quoted 8 lines
Quoted 2 lines

Because I have some other u-boot generic patches which touches this driver and I'm waiting until this simple change would be merged first.

In general I could do this. But I'm leaving for a vacation in a few days and I'm not sure, if I can squeeze enough "free time" to handle my "U-Boot work".

Tom, could you please pull this patch directly?

OK, I'll assign it to myself in patchwork.

Signature · 1 line
Tom
#5 lore raw
Quoted 19 lines · On Thursday 07 April 2022 09:47:09 Tom Rini wrote:
Quoted 17 lines · Stefan Roese

Added Tom to To...

Quoted 13 lines · Pali Rohár
Quoted 7 lines · On Monday 04 April 2022 09:43:21 Stefan Roese wrote:
Quoted 4 lines · Pali Rohár

Callers of function atsha204a_crc16() expect to return value in host cpu endianity. So remove cpu_to_le16() conversion.

Hello Stefan! Would you or somebody else take this patch?

Because I have some other u-boot generic patches which touches this driver and I'm waiting until this simple change would be merged first.

Quoted 10 lines
Quoted 5 lines

In general I could do this. But I'm leaving for a vacation in a few days and I'm not sure, if I can squeeze enough "free time" to handle my "U-Boot work".

Tom, could you please pull this patch directly?

OK, I'll assign it to myself in patchwork.

Signature · 1 line
Tom

I sent crc16 patch series which depends on this particular patch:
https://patchwork.ozlabs.org/project/uboot/list/?series=294691&state=*

Reviewed-by on v1 1/1
#6 lore raw
In reply to Pali Rohár
Quoted 13 lines · On Sun, 3 Apr 2022 00:36:34 +0200 Pali Rohár <[email protected]> wrote:

Callers of function atsha204a_crc16() expect to return value in host cpu endianity. So remove cpu_to_le16() conversion.

---
 drivers/misc/atsha204a-i2c.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/misc/atsha204a-i2c.c +0 -0
index b89463babb56..63fe541dade3 100644

drivers/misc/atsha204a-i2c.c static u16 atsha204a_crc16(const u8 *buffer, size_t len) · line 152

Quoted 8 lines
drivers/misc/atsha204a-i2c.c +1 -1
@@ -146,7 +146,7 @@ static u16 atsha204a_crc16(const u8 *buffer, size_t len)
 	while (len--)
 		crc = crc16_byte(crc, *buffer++);
 
-	return cpu_to_le16(crc);
+	return crc;
 }
 
 static int atsha204a_send(struct udevice *dev, const u8 *buf, u8 len)