Re: [PATCH] leds: Add support for Philips PCA955x I2C LED drivers

From: Nate Case
Date: Fri May 16 2008 - 16:53:58 EST


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@xxxxxxxxxxx>

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/