All of lore.kernel.org
 help / color / mirror / Atom feed
From: Willy Tarreau <w@1wt.eu>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Isaac Lleida <illeida@openaliasbox.org>,
	devel@driverdev.osuosl.org, armand.bastien@laposte.net,
	gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org,
	marius.gorski@gmail.com, domdevlin@free.fr,
	kernel-janitors-owner@vger.kernel.org,
	sudipm.mukherjee@gmail.com
Subject: Re: [PATCH v4] staging: panel: change struct bits to a bit array
Date: Tue, 17 Mar 2015 07:39:30 +0100	[thread overview]
Message-ID: <20150317063930.GC10181@1wt.eu> (raw)
In-Reply-To: <20150316092531.GI10964@mwanda>

On Mon, Mar 16, 2015 at 12:25:31PM +0300, Dan Carpenter wrote:
> Both "bits.e" and "BIT_CHK(bits, LCD_BIT_E_MASK)" are terrible.  The new
> one is worse because it takes more words to tell you nothing and because
> it is wrong since E is a flag not a mask.

Yep, I agree. Maybe simply renaming "bits" to "lcd_pin" in the original
code would make it more obvious what the original ones meant.

Isaac BTW, if you only want to shrink the structure, you can do it using
a single bit per pin this way :

    struct {
      char e:1;
      char rw:1;
      char rs:1;
      char sda:1;
      char scl:1;
	...
    } pins;

Sorry I don't remember exactly the list of pins, but you get the idea.

Willy


      reply	other threads:[~2015-03-17  6:39 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-15  9:03 [PATCH v4] staging: panel: change struct bits to a bit array Isaac Lleida
2015-03-16  9:25 ` Dan Carpenter
2015-03-17  6:39   ` Willy Tarreau [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=20150317063930.GC10181@1wt.eu \
    --to=w@1wt.eu \
    --cc=armand.bastien@laposte.net \
    --cc=dan.carpenter@oracle.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=domdevlin@free.fr \
    --cc=gregkh@linuxfoundation.org \
    --cc=illeida@openaliasbox.org \
    --cc=kernel-janitors-owner@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marius.gorski@gmail.com \
    --cc=sudipm.mukherjee@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.