linux-rt-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Russell King - ARM Linux <linux@arm.linux.org.uk>
To: Remy Bohmer <linux@bohmer.net>
Cc: Haavard Skinnemoen <hskinnemoen@atmel.com>,
	linux-kernel@vger.kernel.org,
	ARM Linux Mailing List <linux-arm-kernel@lists.arm.linux.org.uk>,
	Andrew Victor <linux@maxim.org.za>,
	Steven Rostedt <rostedt@goodmis.org>,
	RT <linux-rt-users@vger.kernel.org>
Subject: Re: [PATCH]: Atmel Serial Console interrupt handler splitup
Date: Mon, 17 Dec 2007 23:49:32 +0000	[thread overview]
Message-ID: <20071217234932.GH23657@flint.arm.linux.org.uk> (raw)
In-Reply-To: <3efb10970712171256v4230eb38q84d01f2d0d554935@mail.gmail.com>

On Mon, Dec 17, 2007 at 09:56:30PM +0100, Remy Bohmer wrote:
> > > +#define lread(port)          __raw_readl(port)
> > > +#define lwrite(v, port)              __raw_writel(v, port)
> >
> > Why is this necessary, and what does 'l' stand for?
> 
> There is a huge list of macros below these definitions. By doing it
> this way, the macros still fit on 80 characters wide, while without
> them, I had split up the macros over several lines, which does not
> make it more readable. That's all.
> 'l' refers at the last letter of __raw_readl, and writel. Nothing special.

So why not keep to the Linux convention?  How about at_readl() and
at_writel() ?

> > >  /*
> > > + * receive interrupt handler.
> > > + */
> > > +static inline void
> > > +atmel_handle_receive(struct uart_port *port, unsigned int pending)
> >
> > Please drop "inline" here. The compiler will do it automatically if it
> > has only one caller, and if it at some point gets several callers, we
> > might not want to inline it after all.
> 
> Funny, This was the first thing that Andrew started complaining about.
> He suggested to put an inline there which I had not. I already
> mentioned that this was against the CodingStyle, but I also mentioned
> that I did not wanted to start a fight about this :-)
> So, to prevent a discussion, I added the inline...

There's two schools of thought - those who want to add 'inline' keywords
all over the place and those who don't.  It's quite correct that if a
static function will be inlined by the compiler as it sees fit.  It
_can_ be that the compiler will chose not to inline it and that may
result in better register allocation in the caller, resulting in overall
faster code.

> >
> > > +     while (!(UART_GET_CSR(port) & ATMEL_US_TXEMPTY))
> > > +             barrier();
> >
> > Should probably use cpu_relax(), but it's probably out of scope for a
> > codingstyle cleanup patch (and I don't think it matters on AVR32 or
> > ARM.)
> 
> Agree.

Even though it doesn't matter at the moment, I rather like to think a
bit about the future.  If the kernel has a simple and cheap mechanism
there's no reason to avoid using it.

> 
> > >       /*
> > > -      *      First, save IMR and then disable interrupts
> > > +      *      First, save IMR and then disable interrupts
> > >        */
> > >       imr = UART_GET_IMR(port);       /* get interrupt mask */
> > >       UART_PUT_IDR(port, ATMEL_US_RXRDY | ATMEL_US_TXRDY);
> > > @@ -790,30 +828,32 @@ static void atmel_console_write(struct c
> > >       uart_console_write(port, s, count, atmel_console_putchar);
> > >
> > >       /*
> > > -      *      Finally, wait for transmitter to become empty
> > > -      *      and restore IMR
> > > +      *      Finally, wait for transmitter to become empty
> > > +      *      and restore IMR
> > >        */
> >
> > Looks like you're replacing TABs with spaces. Why?
> 
> ????

I think someone's mailer might be messing with the patches.  The above
removed and added lines appear to be identical.

  parent reply	other threads:[~2007-12-17 23:52 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-07 15:24 [PATCH]: Atmel Serial Console interrupt handler splitup Remy Bohmer
2007-12-07 18:31 ` David Brownell
2007-12-07 19:57 ` Andrew Victor
2007-12-07 20:38   ` Remy Bohmer
2007-12-07 21:16     ` Remy Bohmer
2007-12-12 21:10 ` Steven Rostedt
2007-12-12 22:29   ` Remy Bohmer
2007-12-13 16:40     ` Remy Bohmer
2007-12-13 17:33       ` Andrew Victor
2007-12-13 20:32         ` Remy Bohmer
2007-12-13 20:35           ` Remy Bohmer
2007-12-14 11:46             ` Remy Bohmer
2007-12-17 12:17               ` Haavard Skinnemoen
2007-12-17 18:13                 ` Haavard Skinnemoen
2007-12-17 20:56                 ` Remy Bohmer
2007-12-17 23:12                   ` Haavard Skinnemoen
2007-12-18  7:32                     ` Remy Bohmer
2007-12-17 23:49                   ` Russell King - ARM Linux [this message]
2007-12-18  9:07                     ` Haavard Skinnemoen
     [not found] <AANLkTi=TyvXEtoZGatP5pxymLSna9g6ULV46i72bYgc4@mail.gmail.com>
2010-10-29 13:52 ` Remy Bohmer

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=20071217234932.GH23657@flint.arm.linux.org.uk \
    --to=linux@arm.linux.org.uk \
    --cc=hskinnemoen@atmel.com \
    --cc=linux-arm-kernel@lists.arm.linux.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rt-users@vger.kernel.org \
    --cc=linux@bohmer.net \
    --cc=linux@maxim.org.za \
    --cc=rostedt@goodmis.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;
as well as URLs for NNTP newsgroup(s).