linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: John Garry <john.garry@huawei.com>, linux-wireless@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, nbd@nbd.name
Subject: Re: [PATCH] bitfield: add constant field preparation macros
Date: Mon, 15 Oct 2018 16:54:14 +0200	[thread overview]
Message-ID: <644c72e8e967591cad8c32a13b358ed8b28d5285.camel@sipsolutions.net> (raw)
In-Reply-To: <d250e401-e939-c521-8e66-d9f6648db986@huawei.com>

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


      reply	other threads:[~2018-10-15 14:54 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-12 19:45 [PATCH] bitfield: add constant field preparation macros Johannes Berg
2018-10-15  8:53 ` John Garry
2018-10-15 14:54   ` Johannes Berg [this message]

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=644c72e8e967591cad8c32a13b358ed8b28d5285.camel@sipsolutions.net \
    --to=johannes@sipsolutions.net \
    --cc=john.garry@huawei.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=nbd@nbd.name \
    /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;
as well as URLs for NNTP newsgroup(s).