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] [thread-next>] [day] [month] [year] [list]
Message-Id: <200610021310.15374.david-b@pacbell.net>
Date:	Mon, 2 Oct 2006 13:10:14 -0700
From:	David Brownell <david-b@...bell.net>
To:	"Thiago Galesi" <thiagogalesi@...il.com>
Cc:	"Andrew Morton" <akpm@...l.org>,
	"Andrea Paterniani" <a.paterniani@...pp-eng.it>,
	"Linux Kernel list" <linux-kernel@...r.kernel.org>
Subject: Re: [patch 2.6.18-git] SPI -- Freescale iMX SPI controller driver

On Monday 02 October 2006 11:37 am, Thiago Galesi wrote:
> <nitpickery on>

Similarly: the TO: should be "Andrea Paterniani" <a.paterniani@...pp-eng.it>.  :)


> > +/*-------------------------------------------------------------------------*/
> > +/* SPI Control Register Bit Fields & Masks */
> > +#define SPI_CONTROL_BITCOUNT   (0xF)           /* Bit Count Mask */
> > +#define SPI_CONTROL_BITCOUNT_1 (0x0)           /* Bit Count = 1 */
> > +#define SPI_CONTROL_BITCOUNT_2 (0x1)           /* Bit Count = 2 */
> > +#define SPI_CONTROL_BITCOUNT_3 (0x2)           /* Bit Count = 3 */
> 
> I thinking these comments are awfully confusing (bitcount_1 == 0
> ?!?!?) and maybe redundant.

Those parentheses are redundant too ... :)


> It would be much more useful to explain the logic behind why
> (bitcount_1 == 0) and remove the /* Bit Count = X */ comments
> 
> 
> > +/* SPI Soft Reset Register Bit Fields & Masks */
> > +#define SPI_RESET_START                (0x1 << 0)      /* Start */
> 
> Wouldn't only (0x1) be better?
> 
> > +
> > +/* Message state */
> > +#define START_STATE                    ((void*)0)
> > +#define RUNNING_STATE                  ((void*)1)
> > +#define DONE_STATE                     ((void*)2)
> > +#define ERROR_STATE                    ((void*)-1)
> 
> !?!??!?!

Now that you mention it ... let me second that comment!

I guess that in the middle of reviewing ~250K lines of new driver,
it's perhaps too easy to overlook wierdness with constants.

- Dave

> All in all, except for what Andrew has pointed out, it looks good,
> maybe a little bit overengineered...
> 
> -- 
> -
> Thiago Galesi
> 
-
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