From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752266AbbCQGjv (ORCPT ); Tue, 17 Mar 2015 02:39:51 -0400 Received: from 1wt.eu ([62.212.114.60]:13873 "EHLO 1wt.eu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751788AbbCQGju (ORCPT ); Tue, 17 Mar 2015 02:39:50 -0400 Date: Tue, 17 Mar 2015 07:39:30 +0100 From: Willy Tarreau To: Dan Carpenter Cc: Isaac Lleida , 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 Message-ID: <20150317063930.GC10181@1wt.eu> References: <1426410236-16509-1-git-send-email-illeida@openaliasbox.org> <20150316092531.GI10964@mwanda> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150316092531.GI10964@mwanda> User-Agent: Mutt/1.4.2.3i Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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