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, 29 Aug 2011 14:15:38 +0200
From:	Linus Walleij <linus.walleij@...aro.org>
To:	Barry Song <21cnbao@...il.com>
Cc:	Barry Song <Baohua.Song@....com>, linus.walleij@...ricsson.com,
	linux-kernel@...r.kernel.org, workgroup.linux@....com,
	grant.likely@...retlab.ca, Rongjun Ying <rongjun.ying@....com>,
	linux-arm-kernel@...ts.infradead.org
Subject: Re: [PATCH] pinmux: add a driver for the CSR SiRFprimaII pinmux

On Mon, Aug 29, 2011 at 1:58 PM, Barry Song <21cnbao@...il.com> wrote:
>> > +static const struct sirfsoc_muxmask lcd_16bits_sirfsoc_muxmask[] = {
>> > +       {
>> > +               .group = 3,
>> > +               .mask = 0x7FFFF,
>>
>> These things look a bit magic...
>
> register seems to be magic by itself. this is register set mask of
> group 3 for LCD. group in the structure is also an offset of register
> layout.

No big deal anyway.

What some people like myself do is make #defines for most
things:

#define SIRFSOC_LCD_GROUP_OFFSET 3
#define SIRFSOC_LCD_GROUP_MASK 0x7FFFF
#define SIRFSOC_LCD_ENABLE BIT(5)

sometimes I even define shifts for masks etc.

But a comment inline explaining the magic bits is just as
fine with me.

Yours,
Linus Walleij
--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ