lkml.org 
[lkml]   [2018]   [Oct]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] bitfield: add constant field preparation macros
From
Date
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

\
 
 \ /
  Last update: 2018-10-15 16:55    [W:0.375 / U:0.296 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site