lkml.org 
[lkml]   [2008]   [May]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] leds: Add support for Philips PCA955x I2C LED drivers
From
Date
On Thu, 2008-05-15 at 16:33 -0700, Andrew Morton wrote:
> Please prefer to implement code in C rather than as a macro. Only use
> macros when the code *must* be a macro.
[snip]

Thanks for the feedback. I've implemented all of your suggestions and
tested them. The only place I deviated was here:

> > + if (((client->addr >> chip->slv_addr_shift) << chip->slv_addr_shift)
> > + != chip->slv_addr) {
>
> equivalent to the simpler
>
> if (client->addr & ((1 << chip->slv_addr_shift) - 1)) {
>
> I think?

I inserted the missing "~" from your version:

if (client->addr & ~((1 << chip->slv_addr_shift) - 1)) !=

I'll send v2 of the patch shortly.

--
Nate Case <ncase@xes-inc.com>



\
 
 \ /
  Last update: 2008-05-16 22:57    [W:0.044 / U:0.320 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site