[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20150317063930.GC10181@1wt.eu>
Date: Tue, 17 Mar 2015 07:39:30 +0100
From: Willy Tarreau <w@....eu>
To: Dan Carpenter <dan.carpenter@...cle.com>
Cc: Isaac Lleida <illeida@...naliasbox.org>,
devel@...verdev.osuosl.org, armand.bastien@...oste.net,
gregkh@...uxfoundation.org, linux-kernel@...r.kernel.org,
marius.gorski@...il.com, domdevlin@...e.fr,
kernel-janitors-owner@...r.kernel.org, sudipm.mukherjee@...il.com
Subject: Re: [PATCH v4] staging: panel: change struct bits to a bit array
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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists