lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ