Skip to contentSkip to conversation

ARM: mach-orion5x: Use hex2bin that is present in kernel lib

PATCH New plaes at plaes.org 2 participants 3 messages Nov 23, 2011 – Nov 24, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARM: mach-orion5x: Use hex2bin that is present in kernel lib

Hey!

I noticed there was some duplicate code under arm/mach-orion5x directory so I ended up with a patch that uses existing library function present in kernel code.

I regretfully have to admit that this patch is NOT even compile-tested, but I hope that it still useful in case it happens to break something...

P?ikest,
Priit ;)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-ARM-mach-orion5x-Use-hex2bin-that-is-present-in-kern.patch
Type: text/x-patch
Size: 3160 bytes
Desc:
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20111123/fc6de17f/attachment.bin>

#1 lore raw

PATCH 1/1 ARM: mach-orion5x: Use hex2bin that is present in kernel lib

Quoted 1 line · plaes at plaes.org

Hey!

Hello!

Quoted 9 lines

I noticed there was some duplicate code under arm/mach-orion5x directory so I ended up with a patch that uses existing library function present in kernel code.

I regretfully have to admit that this patch is NOT even compile-tested, but I hope that it still useful in case it happens to break something...

[...]

Review

Quoted 7 lines
(quoted diff) +1 -4
 	for (i = 0; i < 6; i++)	{
-		int byte;
-
-		byte = dns323_parse_hex_byte(mac_page + (i * 3));
-		if (byte < 0) {
+		if (hex2bin(addr[i], mac_page + (i * 3), 2))
 			goto error_fail;

I don't think that this does what you think it does...

thanks,
Lennert

#2 lore raw

PATCH 1/1 ARM: mach-orion5x: Use hex2bin that is present in kernel lib

?hel kenal p?eval, N, 2011-11-24 kell 07:40, kirjutas Lennert Buytenhek:

Quoted 2 lines · plaes at plaes.org

[...]

Quoted 12 lines

Review

Quoted 10 lines

[...]

(quoted diff) +1 -4
 	for (i = 0; i < 6; i++)	{
-		int byte;
-
-		byte = dns323_parse_hex_byte(mac_page + (i * 3));
-		if (byte < 0) {
+		if (hex2bin(addr[i], mac_page + (i * 3), 2))
 			goto error_fail;

I don't think that this does what you think it does...

Indeed. I assume that it didn't even compile. I have fixed the two issues I found in the previous patch and tweaked the printk output for TS-x09. Run-tested with similar code on x86 so now I'm confident enough to sign it off ;)

P?ikest,
Priit Laes ;)

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-ARM-mach-orion5x-Use-hex2bin-that-is-present-in-kern.patch
Type: text/x-patch
Size: 3353 bytes
Desc:
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20111124/e786a30b/attachment.bin>