From: Chris Snook <csnook@redhat.com>
To: Jan Engelhardt <jengelh@linux01.gwdg.de>
Cc: Jay Cliburn <jacliburn@bellsouth.net>,
jeff@garzik.org, shemminger@osdl.org, romieu@fr.zoreil.com,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/4] atl1: Header files for Attansic L1 driver
Date: Mon, 20 Nov 2006 01:01:37 -0500 [thread overview]
Message-ID: <456144C1.8040809@redhat.com> (raw)
In-Reply-To: <Pine.LNX.4.61.0611192233270.6324@yvahk01.tjqt.qr>
Jan Engelhardt wrote:
> On Nov 19 2006 14:30, Jay Cliburn wrote:
>> +
>> +#define LBYTESWAP( a ) ( ( ( (a) & 0x00ff00ff ) << 8 ) | ( ( (a) & 0xff00ff00 ) >> 8 ) )
>> +#define LONGSWAP( a ) ( ( LBYTESWAP( a ) << 16 ) | ( LBYTESWAP( a ) >> 16 ) )
>> +#define SHORTSWAP( a ) ( ( (a) << 8 ) | ( (a) >> 8 ) )
>
> Please use swab16/swab32 for these.
Thanks for pointing this out. There's a lot of self-rolled stuff in the
vendor driver, and we haven't removed it all yet. That one should be
easy though.
>> +#define AT_DESC_UNUSED(R) \
>> + ((((R)->next_to_clean > (R)->next_to_use) ? 0 : (R)->count) + \
>> + (R)->next_to_clean - (R)->next_to_use - 1)
>> +
>> +#define AT_DESC_USED(R) \
>> + (((R)->next_to_clean > (R)->next_to_use) ? \
>> + ((R)->count+(R)->next_to_use-(R)->next_to_clean+1) : \
>> + ((R)->next_to_use-(R)->next_to_clean+1))
>
> These look like they are on the edge to be written as a static-inline function.
> What do others think?
I agree. There's a lot of cosmetic work left to do on this driver, but
we felt it was time to get more eyes on it.
>> +#define AT_WRITE_REG(a, reg, value) ( \
>> + writel((value), ((a)->hw_addr + reg)))
>> +
>> +#define AT_READ_REG(a, reg) ( \
>> + readl((a)->hw_addr + reg ))
>> +
>> +#define AT_WRITE_REGB(a, reg, value) (\
>> + writeb((value), ((a)->hw_addr + reg)))
>> +
>> +#define AT_READ_REGB(a, reg) (\
>> + readb((a)->hw_addr + reg))
>> +
>> +#define AT_WRITE_REGW(a, reg, value) (\
>> + writew((value), ((a)->hw_addr + reg)))
>> +
>> +#define AT_READ_REGW(a, reg) (\
>> + readw((a)->hw_addr + reg))
>> +
>> +#define AT_WRITE_REG_ARRAY(a, reg, offset, value) ( \
>> + writel((value), (((a)->hw_addr + reg) + ((offset) << 2))))
>> +
>> +#define AT_READ_REG_ARRAY(a, reg, offset) ( \
>> + readl(((a)->hw_addr + reg) + ((offset) << 2)))
>
> Possibly similarly.
Yeah, we'll inline these as well. Would you say that level of cosmetic
cleanliness is required for merging, or should we focus solely on the
functional issues for now?
-- Chris
next prev parent reply other threads:[~2006-11-20 6:02 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-11-19 20:30 [PATCH 2/4] atl1: Header files for Attansic L1 driver Jay Cliburn
2006-11-19 21:36 ` Jan Engelhardt
2006-11-20 6:01 ` Chris Snook [this message]
2006-11-20 11:02 ` Jan Engelhardt
2006-11-20 5:54 ` Chris Snook
-- strict thread matches above, loose matches on Subject: below --
2007-01-11 0:41 Jay Cliburn
2007-01-11 9:27 ` Christoph Hellwig
2007-01-11 16:53 ` Jay Cliburn
2007-01-11 17:44 ` Stephen Hemminger
2007-01-11 17:58 ` Christoph Hellwig
2007-01-15 19:21 ` Jay Cliburn
2007-01-15 20:33 ` Francois Romieu
2007-01-15 20:45 ` Jay Cliburn
2007-01-21 21:06 Jay Cliburn
2007-01-22 11:31 ` Francois Romieu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=456144C1.8040809@redhat.com \
--to=csnook@redhat.com \
--cc=jacliburn@bellsouth.net \
--cc=jeff@garzik.org \
--cc=jengelh@linux01.gwdg.de \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=romieu@fr.zoreil.com \
--cc=shemminger@osdl.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox