* [PATCH] unify the macro get_u16 in the file tulip.h
@ 2008-04-30 17:41 gao changli
0 siblings, 0 replies; 4+ messages in thread
From: gao changli @ 2008-04-30 17:41 UTC (permalink / raw)
To: Grant Grundler; +Cc: netdev
Unify the macro get_u16 with le16_to_cpu.
Signed-off-by: Changli Gao <xiaosuo@gmail.com>
---
tulip.h | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
--- linux/drivers/net/tulip/tulip.h 2008-04-30 23:25:24.000000000 +0800
+++ linux-new/drivers/net/tulip/tulip.h 2008-04-30 23:28:04.000000000
+0800
@@ -299,11 +299,7 @@
#define RUN_AT(x) (jiffies + (x))
-#if defined(__i386__) /* AKA get_unaligned() */
-#define get_u16(ptr) (*(u16 *)(ptr))
-#else
-#define get_u16(ptr) (((u8*)(ptr))[0] + (((u8*)(ptr))[1]<<8))
-#endif
+#define get_u16(ptr) le16_to_cpu(*(u16*)(ptr))
struct medialeaf {
u8 type;
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] unify the macro get_u16 in the file tulip.h
[not found] <93C271C5-550E-406B-AE43-C83419EA0BC6@gmail.com>
@ 2008-05-01 0:15 ` Grant Grundler
2008-05-01 0:43 ` Joe Perches
0 siblings, 1 reply; 4+ messages in thread
From: Grant Grundler @ 2008-05-01 0:15 UTC (permalink / raw)
To: Jeff Garzik; +Cc: Grant Grundler, netdev, gao changli
On Thu, May 01, 2008 at 01:34:38AM +0800, gao changli wrote:
> Unify the macro get_u16 with le16_to_cpu.
>
> Signed-off-by: Changli Gao <xiaosuo@gmail.com>
Acked-by: Grant Grundler <grundler@parisc-linux.org>
Jeff,
please apply. Depends on other patches that define le16_to_cpu().
grant
> ---
>
> tulip.h | 6 +-----
> 1 file changed, 1 insertion(+), 5 deletions(-)
>
> --- linux/drivers/net/tulip/tulip.h 2008-04-30 23:25:24.000000000 +0800
> +++ linux-new/drivers/net/tulip/tulip.h 2008-04-30 23:28:04.000000000 +0800
> @@ -299,11 +299,7 @@
>
> #define RUN_AT(x) (jiffies + (x))
>
> -#if defined(__i386__) /* AKA get_unaligned() */
> -#define get_u16(ptr) (*(u16 *)(ptr))
> -#else
> -#define get_u16(ptr) (((u8*)(ptr))[0] + (((u8*)(ptr))[1]<<8))
> -#endif
> +#define get_u16(ptr) le16_to_cpu(*(u16*)(ptr))
>
> struct medialeaf {
> u8 type;
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] unify the macro get_u16 in the file tulip.h
2008-05-01 0:15 ` [PATCH] unify the macro get_u16 in the file tulip.h Grant Grundler
@ 2008-05-01 0:43 ` Joe Perches
2008-05-02 3:52 ` Grant Grundler
0 siblings, 1 reply; 4+ messages in thread
From: Joe Perches @ 2008-05-01 0:43 UTC (permalink / raw)
To: Grant Grundler; +Cc: Jeff Garzik, netdev, gao changli
On Wed, 2008-04-30 at 18:15 -0600, Grant Grundler wrote:
> On Thu, May 01, 2008 at 01:34:38AM +0800, gao changli wrote:
> > Unify the macro get_u16 with le16_to_cpu.
> > Signed-off-by: Changli Gao <xiaosuo@gmail.com>
> Acked-by: Grant Grundler <grundler@parisc-linux.org>
> please apply. Depends on other patches that define le16_to_cpu().
Wouldn't it be better to remove get_u16 altogether
and use le16_to_cpu or __le16_to_cpup directly?
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] unify the macro get_u16 in the file tulip.h
2008-05-01 0:43 ` Joe Perches
@ 2008-05-02 3:52 ` Grant Grundler
0 siblings, 0 replies; 4+ messages in thread
From: Grant Grundler @ 2008-05-02 3:52 UTC (permalink / raw)
To: Joe Perches; +Cc: Grant Grundler, Jeff Garzik, netdev, gao changli
On Wed, Apr 30, 2008 at 05:43:49PM -0700, Joe Perches wrote:
> On Wed, 2008-04-30 at 18:15 -0600, Grant Grundler wrote:
> > On Thu, May 01, 2008 at 01:34:38AM +0800, gao changli wrote:
> > > Unify the macro get_u16 with le16_to_cpu.
> > > Signed-off-by: Changli Gao <xiaosuo@gmail.com>
> > Acked-by: Grant Grundler <grundler@parisc-linux.org>
> > please apply. Depends on other patches that define le16_to_cpu().
>
> Wouldn't it be better to remove get_u16 altogether
> and use le16_to_cpu or __le16_to_cpup directly?
Yes, it would be. But Changli's patch was an improvement in reducing
nested macros across several drivers and he was trying to minimize
churn with that patchset.
Can you please submit a patch that removes get_u16()?
thanks,
grant
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2008-05-02 3:52 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <93C271C5-550E-406B-AE43-C83419EA0BC6@gmail.com>
2008-05-01 0:15 ` [PATCH] unify the macro get_u16 in the file tulip.h Grant Grundler
2008-05-01 0:43 ` Joe Perches
2008-05-02 3:52 ` Grant Grundler
2008-04-30 17:41 gao changli
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).