From: Wolfram Sang <w.sang@pengutronix.de>
To: Arnd Bergmann <arnd@arndb.de>
Cc: linuxppc-dev@ozlabs.org, Kevin Diggs <kevdig@hypersurf.com>
Subject: Re: checkpatch nits ...
Date: Wed, 27 Aug 2008 09:49:44 +0200 [thread overview]
Message-ID: <20080827074944.GA4259@pengutronix.de> (raw)
In-Reply-To: <200808231057.22399.arnd@arndb.de>
[-- Attachment #1: Type: text/plain, Size: 1450 bytes --]
On Sat, Aug 23, 2008 at 10:57:21AM +0200, Arnd Bergmann wrote:
> On Saturday 23 August 2008, Kevin Diggs wrote:
> > WARNING: externs should be avoided in .c files
> > #1137: FILE: powerpc/kernel/cpu/pll_if.c:369:
> > + __asm__ __volatile__ (
> >
> > ??? I don't know what this is?
> >
> > The entire block is:
> >
> > __asm__ __volatile__ (
> > "addi %0,%3,-1\n"
> > "andc %1,%3,%0\n"
> > "cntlzw %1,%1\n"
> > "subfic %1,%1,31\n"
> > "cntlzw %0,%2\n":
> > "=r"(cntlz), "=r"(cnttz):
> > "r"(tmp), "b"(cnttz)
> > );
> >
>
> It's a bug in checkpatch, your code is correct (although I would write
> asm volatile, not __asm__ __volatile__, and add \t after each \n).
> Can you explain why you need that inline assembly? All you do in there
> are arithmetic operations, so you should be able to express that using
> C, or at least using the helpers we already have.
>
> Checkpatch thinks that what you wrote is a declaration for a function
> named __volatile__ returning a variable of type __asm__, and complains
> that this declaration belongs into a header file.
I wonder if checkpatch-maintainers read this list, so I put Andy
Whitcroft to CC.
Wolfram
--
Dipl.-Ing. Wolfram Sang | http://www.pengutronix.de
Pengutronix - Linux Solutions for Science and Industry
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
next prev parent reply other threads:[~2008-08-27 7:49 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-08-23 0:21 checkpatch nits Kevin Diggs
2008-08-23 0:40 ` Sean MacLennan
2008-08-23 8:57 ` Arnd Bergmann
2008-08-27 7:49 ` Wolfram Sang [this message]
2008-08-28 7:51 ` Andy Whitcroft
2008-08-24 12:23 ` David Howells
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=20080827074944.GA4259@pengutronix.de \
--to=w.sang@pengutronix.de \
--cc=arnd@arndb.de \
--cc=kevdig@hypersurf.com \
--cc=linuxppc-dev@ozlabs.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).