Skip to contentSkip to conversation

i2c: trivial endian casting fixes in i2c-highlander.c

PATCH Jean Delvare 2 participants 4 messages Dec 5, 2008 – Dec 8, 2008 5 messages not in the archive I2C subsystem host drivers

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): 200812012217.mB1MHeUA011076-AB4EexQrvXRQetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org

#2 lore raw
Quoted 30 lines · On Mon, 01 Dec 2008 14:17:40 -0800, akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@publi…

From: Harvey Harrison <[email protected]>

Fixes sparse warnings:
drivers/i2c/busses/i2c-highlander.c:95:26: warning: incorrect type in argument 1 (different base types)
drivers/i2c/busses/i2c-highlander.c:95:26: expected restricted __be16 const [usertype] *p
drivers/i2c/busses/i2c-highlander.c:95:26: got unsigned short [usertype] *<noident>
drivers/i2c/busses/i2c-highlander.c:106:15: warning: incorrect type in assignment (different base types)
drivers/i2c/busses/i2c-highlander.c:106:15: expected unsigned short [unsigned] [short] [usertype] <noident>
drivers/i2c/busses/i2c-highlander.c:106:15: got restricted __be16

---

 drivers/i2c/busses/i2c-highlander.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff -puN drivers/i2c/busses/i2c-highlander.c~i2c-trivial-endian-casting-fixes-in-i2c-highlanderc drivers/i2c/busses/i2c-highlander.c

drivers/i2c/busses/i2c-highlander.c renamed from drivers/i2c/busses/i2c-highlander.c~i2c-trivial-endian-casting-fixes-in-i2c-highlanderc +1 -1
@@ -92,7 +92,7 @@ static void highlander_i2c_setup(struct 
 static void smbus_write_data(u8 *src, u16 *dst, int len)
 {
 	for (; len > 1; len -= 2) {
-		*dst++ = be16_to_cpup((u16 *)src);
+		*dst++ = be16_to_cpup((__be16 *)src);
 		src += 2;
 	}
 

drivers/i2c/busses/i2c-highlander.c static void smbus_write_data(u8 *src, u1 · line 109

Quoted 8 lines
drivers/i2c/busses/i2c-highlander.c renamed from drivers/i2c/busses/i2c-highlander.c~i2c-trivial-endian-casting-fixes-in-i2c-highlanderc +1 -1
@@ -103,7 +103,7 @@ static void smbus_write_data(u8 *src, u1
 static void smbus_read_data(u16 *src, u8 *dst, int len)
 {
 	for (; len > 1; len -= 2) {
-		*(u16 *)dst = cpu_to_be16p(src++);
+		*(__be16 *)dst = cpu_to_be16p(src++);
 		dst += 2;
 	}
 

Ben, Paul, any comment on this?

Signature · 1 line
Jean Delvare

A message that is not in the archive (sent off-list or not yet received): [email protected]

Acked-by
#4 lore raw
Quoted 30 lines · Jean Delvare
Quoted 29 lines · On Mon, 01 Dec 2008 14:17:40 -0800, akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@publi…

From: Harvey Harrison <[email protected]>

Fixes sparse warnings:
drivers/i2c/busses/i2c-highlander.c:95:26: warning: incorrect type in argument 1 (different base types)
drivers/i2c/busses/i2c-highlander.c:95:26: expected restricted __be16 const [usertype] *p
drivers/i2c/busses/i2c-highlander.c:95:26: got unsigned short [usertype] *<noident>
drivers/i2c/busses/i2c-highlander.c:106:15: warning: incorrect type in assignment (different base types)
drivers/i2c/busses/i2c-highlander.c:106:15: expected unsigned short [unsigned] [short] [usertype] <noident>
drivers/i2c/busses/i2c-highlander.c:106:15: got restricted __be16

---

 drivers/i2c/busses/i2c-highlander.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff -puN drivers/i2c/busses/i2c-highlander.c~i2c-trivial-endian-casting-fixes-in-i2c-highlanderc drivers/i2c/busses/i2c-highlander.c

drivers/i2c/busses/i2c-highlander.c renamed from drivers/i2c/busses/i2c-highlander.c~i2c-trivial-endian-casting-fixes-in-i2c-highlanderc +1 -1
@@ -92,7 +92,7 @@ static void highlander_i2c_setup(struct 
 static void smbus_write_data(u8 *src, u16 *dst, int len)
 {
 	for (; len > 1; len -= 2) {
-		*dst++ = be16_to_cpup((u16 *)src);
+		*dst++ = be16_to_cpup((__be16 *)src);
 		src += 2;
 	}
 
Quoted 12 lines

drivers/i2c/busses/i2c-highlander.c static void smbus_write_data(u8 *src, u1 · line 109

Quoted 9 lines
drivers/i2c/busses/i2c-highlander.c renamed from drivers/i2c/busses/i2c-highlander.c~i2c-trivial-endian-casting-fixes-in-i2c-highlanderc +1 -1
@@ -103,7 +103,7 @@ static void smbus_write_data(u8 *src, u1
 static void smbus_read_data(u16 *src, u8 *dst, int len)
 {
 	for (; len > 1; len -= 2) {
-		*(u16 *)dst = cpu_to_be16p(src++);
+		*(__be16 *)dst = cpu_to_be16p(src++);
 		dst += 2;
 	}
 

Ben, Paul, any comment on this?

It's fine with me, do you want to take this, or should I fold it in to my tree?

A message that is not in the archive (sent off-list or not yet received): [email protected]

#6 lore raw

Hi Paul,

Quoted 43 lines · Paul Mundt
Quoted 30 lines · Jean Delvare
Quoted 29 lines · On Mon, 01 Dec 2008 14:17:40 -0800, akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@publi…

From: Harvey Harrison <[email protected]>

Fixes sparse warnings:
drivers/i2c/busses/i2c-highlander.c:95:26: warning: incorrect type in argument 1 (different base types)
drivers/i2c/busses/i2c-highlander.c:95:26: expected restricted __be16 const [usertype] *p
drivers/i2c/busses/i2c-highlander.c:95:26: got unsigned short [usertype] *<noident>
drivers/i2c/busses/i2c-highlander.c:106:15: warning: incorrect type in assignment (different base types)
drivers/i2c/busses/i2c-highlander.c:106:15: expected unsigned short [unsigned] [short] [usertype] <noident>
drivers/i2c/busses/i2c-highlander.c:106:15: got restricted __be16

---

 drivers/i2c/busses/i2c-highlander.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff -puN drivers/i2c/busses/i2c-highlander.c~i2c-trivial-endian-casting-fixes-in-i2c-highlanderc drivers/i2c/busses/i2c-highlander.c

drivers/i2c/busses/i2c-highlander.c renamed from drivers/i2c/busses/i2c-highlander.c~i2c-trivial-endian-casting-fixes-in-i2c-highlanderc +1 -1
@@ -92,7 +92,7 @@ static void highlander_i2c_setup(struct 
 static void smbus_write_data(u8 *src, u16 *dst, int len)
 {
 	for (; len > 1; len -= 2) {
-		*dst++ = be16_to_cpup((u16 *)src);
+		*dst++ = be16_to_cpup((__be16 *)src);
 		src += 2;
 	}
 
Quoted 12 lines

drivers/i2c/busses/i2c-highlander.c static void smbus_write_data(u8 *src, u1 · line 109

Quoted 9 lines
drivers/i2c/busses/i2c-highlander.c renamed from drivers/i2c/busses/i2c-highlander.c~i2c-trivial-endian-casting-fixes-in-i2c-highlanderc +1 -1
@@ -103,7 +103,7 @@ static void smbus_write_data(u8 *src, u1
 static void smbus_read_data(u16 *src, u8 *dst, int len)
 {
 	for (; len > 1; len -= 2) {
-		*(u16 *)dst = cpu_to_be16p(src++);
+		*(__be16 *)dst = cpu_to_be16p(src++);
 		dst += 2;
 	}
 

Ben, Paul, any comment on this?

Quoted 4 lines

It's fine with me, do you want to take this, or should I fold it in to my tree?

This patch is in my tree and will go to Linus at the end of the week, unless you prefer to pick it.

Thanks,

Signature · 1 line
Jean Delvare

A message that is not in the archive (sent off-list or not yet received): [email protected]

#8 lore raw
Quoted 4 lines · Jean Delvare
Quoted 3 lines · Paul Mundt
Quoted 2 lines · Jean Delvare

Ben, Paul, any comment on this?

Quoted 8 lines
Quoted 4 lines

It's fine with me, do you want to take this, or should I fold it in to my tree?

This patch is in my tree and will go to Linus at the end of the week, unless you prefer to pick it.

Through your tree is fine, thanks.