linux-mips
[Top] [All Lists]

Re: [PATCH] Fix/Rewrite of the mipsnet driver

To: Stephen Hemminger <shemminger@linux-foundation.org>
Subject: Re: [PATCH] Fix/Rewrite of the mipsnet driver
From: Ralf Baechle <ralf@linux-mips.org>
Date: Sun, 28 Oct 2007 20:40:10 +0000
Cc: Thiemo Seufer <ths@networkno.de>, linux-mips@linux-mips.org, netdev@vger.kernel.org
In-reply-to: <20071028132204.5ab09c10@freepuppy.rosehill>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <20071028043846.GM29176@networkno.de> <20071029002517.GB16913@linux-mips.org> <20071028200308.GB22287@networkno.de> <20071028132204.5ab09c10@freepuppy.rosehill>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Mutt/1.5.14 (2007-02-12)
On Sun, Oct 28, 2007 at 01:22:04PM -0700, Stephen Hemminger wrote:

> > -#define MIPSNET_INTCTL_TXDONE     ((uint32_t)(1 <<  0))
> > -#define MIPSNET_INTCTL_RXDONE     ((uint32_t)(1 <<  1))
> > -#define MIPSNET_INTCTL_TESTBIT    ((uint32_t)(1 << 31))
> > -#define MIPSNET_INTCTL_ALLSOURCES  (MIPSNET_INTCTL_TXDONE | \
> > -                                    MIPSNET_INTCTL_RXDONE | \
> > -                                    MIPSNET_INTCTL_TESTBIT)
> 
> It is standard practice in the kernel to use u32 rather than uint32_t.

uint32_t has widely leaked in and as long as it's not used in headers
exported to userland is perfectly fine.  But if we want to achieve
consistence throughout the kernel it'll take a little witch hunt for
uint32_t and co.

> Also cast of shift is unneeded  (1u << 0) works fine.

Old sins of mipsnet.h which was just copied into mipsnet.c.  Or toothing
pains of a driver on its way to sanity.

  Ralf

<Prev in Thread] Current Thread [Next in Thread>