mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Alexey Dobriyan <adobriyan@gmail.com>
To: Vegard Nossum <vegard.nossum@gmail.com>
Cc: David Miller <davem@davemloft.net>, Ingo Molnar <mingo@elte.hu>,
	Andrew Morton <akpm@linux-foundation.org>,
	Pekka Enberg <penberg@cs.helsinki.fi>,
	linux-kernel@vger.kernel.org
Subject: Re: [RFC][PATCH] bitfields API
Date: Thu, 28 Aug 2008 23:05:33 +0400	[thread overview]
Message-ID: <20080828190533.GA22416@x200.localdomain> (raw)
In-Reply-To: <19f34abd0808281146o7a00388eie9322ff778665961@mail.gmail.com>

On Thu, Aug 28, 2008 at 08:46:43PM +0200, Vegard Nossum wrote:
> On Thu, Aug 28, 2008 at 8:40 PM, Alexey Dobriyan <adobriyan@gmail.com> wrote:
> > On Thu, Aug 28, 2008 at 08:32:23PM +0200, Vegard Nossum wrote:
> >> How do you feel about this patch? It's all about making kmemcheck more
> >> useful... and not much else. Does it have any chance of entering the
> >> kernel along with kmemcheck (when/if that happens)?
> >
> > DEFINE_BITFIELD is horrible.
> >
> >> @@ -285,11 +286,12 @@ struct sk_buff {
> >>               };
> >>       };
> >>       __u32                   priority;
> >> -     __u8                    local_df:1,
> >> +     DEFINE_BITFIELD(__u8,   flags1,
> >> +                             local_df:1,
> >>                               cloned:1,
> >>                               ip_summed:2,
> >>                               nohdr:1,
> >> -                             nfctinfo:3;
> >> +                             nfctinfo:3);
> >>       __u8                    pkt_type:3,
> >>                               fclone:2,
> >>                               ipvs_property:1,
> 
> Ok, that's constructive :-P
> 
> Can we skip the type and always assume that it should be __u8/uint8_t?

Of course, no.

> I read somewhere that bitfields should anyway always be 1 byte wide if
> the bitfield should be "portable".

It should be signed int or unsigned int for maximum portability.

> Would it help (to make this less
> horrible) to omit the type declaration and have just the bitfield
> members as arguments to the macro?

Or you can parse instruction stream a bit more.


  parent reply	other threads:[~2008-08-28 19:04 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-28 18:32 Vegard Nossum
2008-08-28 18:40 ` Alexey Dobriyan
2008-08-28 18:40   ` Pekka Enberg
2008-08-28 20:27     ` Adrian Bunk
2008-08-28 20:54       ` Pekka Enberg
2008-08-28 20:59       ` Vegard Nossum
2008-08-28 18:46   ` Vegard Nossum
2008-08-28 19:02     ` Pekka J Enberg
2008-08-28 19:38       ` Vegard Nossum
2008-08-30  8:28         ` Vegard Nossum
2008-08-28 19:05     ` Alexey Dobriyan [this message]
2008-08-28 19:07       ` Pekka Enberg
2008-08-28 19:18       ` Vegard Nossum

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=20080828190533.GA22416@x200.localdomain \
    --to=adobriyan@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=penberg@cs.helsinki.fi \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®