From: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
To: Michael Buesch <mb@bu3sch.de>
Cc: Aurelien Jarno <aurelien@aurel32.net>,
netdev@vger.kernel.org, Felix Fietkau <nbd@openwrt.org>
Subject: Re: [PATCH 2/4][SSB] EXTIF serial port initialization
Date: Mon, 6 Aug 2007 10:14:52 -0300 [thread overview]
Message-ID: <20070806131452.GM2469@ghostprotocols.net> (raw)
In-Reply-To: <200708061051.05769.mb@bu3sch.de>
Em Mon, Aug 06, 2007 at 10:51:05AM +0200, Michael Buesch escreveu:
> On Monday 06 August 2007, Arnaldo Carvalho de Melo wrote:
> > Em Mon, Aug 06, 2007 at 01:19:59AM +0200, Aurelien Jarno escreveu:
> > > The patch below against 2.6.23-rc1-mm2 implements EXTIF serial
> > > initialization, currently marked as TODO.
> > >
> > > It originally comes from the OpenWrt patches.
> >
> > Comments below
> >
> > > Cc: Felix Fietkau <nbd@openwrt.org>
> > > Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
> > >
> > > --- a/drivers/ssb/driver_mipscore.c
> > > +++ b/drivers/ssb/driver_mipscore.c
> > > @@ -128,51 +128,52 @@
> > > ssb_write32(mdev, SSB_IPSFLAG, irqflag);
> > > }
> > >
> > > -/* XXX: leave here or move into separate extif driver? */
> > > -static int ssb_extif_serial_init(struct ssb_device *dev, struct ssb_serial_ports *ports)
> > > +static inline bool serial_exists(u8 *regs)
> > > {
> > > + u8 save_mcr, msr = 0;
> >
> > Why declare save_mcr here...
> >
> > >
> > > + if (regs) {
> >
> > if it is just used here?
>
> There is almost never an advantage when declaring variables at the beginning
> of a statement block instead of the function start.
> The only thing you "gain" is that you don't easily see anymore how much
> stackspace is used by the funtions.
Well, I disagree, your argument is flawed because if the function is too
big to have so many variables it should be split in smaller functions
anyway, and when it is not that big, like in the above case one can see
the stack usage just fine on the same screen.
> So I really suggest to declare variables at the beginning of functions,
> except for some rare circumstances maybe. Which is not the case here.
I'd recommend the reverse, but anyway, it is just a suggestion.
- Arnaldo
next prev parent reply other threads:[~2007-08-06 13:15 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-08-05 23:19 [PATCH 2/4][SSB] EXTIF serial port initialization Aurelien Jarno
2007-08-06 0:21 ` Arnaldo Carvalho de Melo
2007-08-06 8:51 ` Michael Buesch
2007-08-06 13:14 ` Arnaldo Carvalho de Melo [this message]
2007-08-06 8:43 ` Michael Buesch
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=20070806131452.GM2469@ghostprotocols.net \
--to=acme@ghostprotocols.net \
--cc=aurelien@aurel32.net \
--cc=mb@bu3sch.de \
--cc=nbd@openwrt.org \
--cc=netdev@vger.kernel.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).