Re: [PATCH 1/1] clk-divider: fix is_power_of_two()

2013-01-16 Thread James Hogan
On 16/01/13 00:56, Mike Turquette wrote: > Quoting Joe Perches (2013-01-15 10:31:05) >> On Tue, 2013-01-15 at 10:28 +, James Hogan wrote: >>> The macro is_power_of_two() in clk-divider.c was defined as !(i & ~i) >>> which is always true. Correct it to !(i & (i - 1)). >> [] >>> diff --git a/driv

Re: [PATCH 1/1] clk-divider: fix is_power_of_two()

2013-01-15 Thread Mike Turquette
Quoting Joe Perches (2013-01-15 10:31:05) > On Tue, 2013-01-15 at 10:28 +, James Hogan wrote: > > The macro is_power_of_two() in clk-divider.c was defined as !(i & ~i) > > which is always true. Correct it to !(i & (i - 1)). > [] > > diff --git a/drivers/clk/clk-divider.c b/drivers/clk/clk-divid

Re: [PATCH 1/1] clk-divider: fix is_power_of_two()

2013-01-15 Thread Joe Perches
On Tue, 2013-01-15 at 10:28 +, James Hogan wrote: > The macro is_power_of_two() in clk-divider.c was defined as !(i & ~i) > which is always true. Correct it to !(i & (i - 1)). [] > diff --git a/drivers/clk/clk-divider.c b/drivers/clk/clk-divider.c [] > @@ -29,8 +29,8 @@ [] > -#define div_mask(d

[PATCH 1/1] clk-divider: fix is_power_of_two()

2013-01-15 Thread James Hogan
The macro is_power_of_two() in clk-divider.c was defined as !(i & ~i) which is always true. Correct it to !(i & (i - 1)). Also add brackets around the macro arguments in div_mask and is_power_of_two, as well as around the is_power_of_two expression as a whole to avoid any future operator precedenc