[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <644c72e8e967591cad8c32a13b358ed8b28d5285.camel@sipsolutions.net>
Date: Mon, 15 Oct 2018 16:54:14 +0200
From: Johannes Berg <johannes@...solutions.net>
To: John Garry <john.garry@...wei.com>, linux-wireless@...r.kernel.org
Cc: linux-kernel@...r.kernel.org, nbd@....name
Subject: Re: [PATCH] bitfield: add constant field preparation macros
On Mon, 2018-10-15 at 09:53 +0100, John Garry wrote:
> > +/**
> > + * __FIELD_PREP() - prepare a constant bitfield element
>
> My impression is that the name prefix - '__' - tells little about the
> function. If you agree, how about even CFIELD_PREP() or
> FIELD_PREP_CONST() or similar? I preper the latter, but becomes rather long.
I was following the __cpu_to_{be,le}{16,32,64} playbook, but don't
really care much. I'd prefer FIELD_PREP_CONST() over CFIELD_PREP()
though, so we can change this.
> > + * @_mask: shifted mask defining the field's length and position
> > + * @_val: value to put in the field
> > + *
> > + * __FIELD_PREP() masks and shifts up the value. The result should
> > + * be combined with other fields of the bitfield using local OR.
>
> should this be 'logical OR', or indeed 'bitwise OR'?
I'm not sure what happened there ... I copy/pasted the comment from
FIELD_PREP() but that says "logical OR" (which is in fact wrong, yes, it
should be say "bitwise OR").
johannes
Powered by blists - more mailing lists