Re: [PATCH] pwm: atmel-pwm: fix calculation of prescale value

From: Nikolaus Voss
Date: Thu Sep 25 2014 - 03:54:39 EST


Hi Thierry,

On Thu, 25 Sep 2014, Thierry Reding wrote:
Please Cc the linux-pwm@xxxxxxxxxxxxxxx mailing list for PWM-related
patches in the future.

ok, I ran get_maintainer.pl on an old kernel...

Also a couple more comments:

In the patch description: "pwm frequency" should be "PWM frequency".

ok.

+ div = (unsigned long long)clk_get_rate(atmel_pwm->clk) * period_ns;
+ do_div(div, (int)1e9);

1e9 should be NSEC_PER_SEC.


- }
+ div >>= 1;
+ ++pres;

Unless you really need the prefix increment behaviour (you don't in this
case) I prefer using the postfix operator because it is slightly more
idiomatic.

ok (as I mostly do C++ programming, I prefer the prefix as it is usually
more efficient for user-defined types).

No need for you to respin the patch, I've fixed up the above when
applying.

Thanks!

Niko

--
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/