From: Ben Hutchings <bhutchings@solarflare.com>
To: Vegard Nossum <vegard.nossum@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] Use <asm-generic/bitops/le.h> in <asm-powerpc/bitops.h>
Date: Sun, 1 Jun 2008 00:50:33 +0100 [thread overview]
Message-ID: <20080531235032.GF30769@solarflare.com> (raw)
In-Reply-To: <19f34abd0805311552q342cdc9fp9e08fe1e73696a1@mail.gmail.com>
Vegard Nossum wrote:
> Hi,
>
> On Sun, Jun 1, 2008 at 12:38 AM, Ben Hutchings
> <bhutchings@solarflare.com> wrote:
> > The powerpc little-endian bitops have no arch-specific optimisations.
> >
> > Remove clashing macros from these headers.
> >
> > Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
> > ---
> > include/asm-generic/bitops/le.h | 1 -
> > include/asm-powerpc/bitops.h | 34 +---------------------------------
> > 2 files changed, 1 insertions(+), 34 deletions(-)
> >
> > diff --git a/include/asm-generic/bitops/le.h b/include/asm-generic/bitops/le.h
> > index a51c4ca..08c5df3 100644
> > --- a/include/asm-generic/bitops/le.h
> > +++ b/include/asm-generic/bitops/le.h
> > @@ -4,7 +4,6 @@
> > #include <asm/types.h>
> > #include <asm/byteorder.h>
> >
> > -#define BITOP_WORD(nr) ((nr) / BITS_PER_LONG)
> > #define BITOP_LE_SWIZZLE ((BITS_PER_LONG-1) & ~0x7)
> >
> > #if defined(__LITTLE_ENDIAN)
> > diff --git a/include/asm-powerpc/bitops.h b/include/asm-powerpc/bitops.h
> > index dcbf9a8..afe2fa3 100644
> > --- a/include/asm-powerpc/bitops.h
> > +++ b/include/asm-powerpc/bitops.h
> > @@ -54,7 +54,6 @@
> >
> > #define BITOP_MASK(nr) (1UL << ((nr) % BITS_PER_LONG))
> > #define BITOP_WORD(nr) ((nr) / BITS_PER_LONG)
> > -#define BITOP_LE_SWIZZLE ((BITS_PER_LONG-1) & ~0x7)
> >
> > static __inline__ void set_bit(int nr, volatile unsigned long *addr)
> > {
> > @@ -340,39 +339,8 @@ static __inline__ int fls64(__u64 x)
> >
> > /* Little-endian versions */
> >
> > -static __inline__ int test_le_bit(unsigned long nr,
> > - __const__ unsigned long *addr)
> > -{
> > - __const__ unsigned char *tmp = (__const__ unsigned char *) addr;
> > - return (tmp[nr >> 3] >> (nr & 7)) & 1;
> > -}
> > +#include <asm-generic/bitops/le.h>
>
> Is it completely impossible to move this #include to the top of the file?
It's probably entirely possible.
> I know that a lot of the current headers don't do this, and I don't
> think it's a written rule with the kernel sources, BUT it's a nice
> convention IMHO, and makes headers generally more maintainable. What
> do you think?
If you look at the current version of this header you'll see it
includes several other bitops headers at around this point. I tend
to follow the conventions I see.
Ben.
--
Ben Hutchings, Senior Software Engineer, Solarflare Communications
Not speaking for my employer; that's the marketing department's job.
next prev parent reply other threads:[~2008-05-31 23:50 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <f12db478511ce4ff462d1b236724e4fc46470a4d.1212272760.git.bhutchings@solarflare.com>
2008-05-31 22:34 ` [PATCH 0/2] Expose little-endian bitops Ben Hutchings
2008-05-31 22:37 ` [PATCH 1/2] Remove 'generic_' prefix from generic " Ben Hutchings
2008-05-31 22:38 ` [PATCH 2/2] Use <asm-generic/bitops/le.h> in <asm-powerpc/bitops.h> Ben Hutchings
2008-05-31 22:52 ` Vegard Nossum
2008-05-31 23:50 ` Ben Hutchings [this message]
2008-06-01 4:55 ` [PATCH 0/2] Expose little-endian bitops Christoph Hellwig
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=20080531235032.GF30769@solarflare.com \
--to=bhutchings@solarflare.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=vegard.nossum@gmail.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.