Thread (51 messages) 51 messages, 8 authors, 2016-03-16

Re: [PATCH v4 04/24] hwmon: pwm-fan: use pwm_get_xxx() helpers where appropriate

From: Guenter Roeck <hidden>
Date: 2015-11-16 17:00:20
Also in: linux-arm-kernel, linux-clk, linux-fbdev, linux-leds, linux-pwm, linux-rockchip, lkml

On 11/16/2015 08:53 AM, Boris Brezillon wrote:
On Mon, 16 Nov 2015 07:59:23 -0800
Guenter Roeck [off-list ref] wrote:
quoted
On 11/16/2015 12:56 AM, Boris Brezillon wrote:
quoted
Use pwm_get_xxx() helpers instead of directly accessing the pwm->xxx field.
Doing that will ease adaptation of the PWM framework to support atomic
update.

Signed-off-by: Boris Brezillon <boris.brezillon-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
---
Patch generated with the following coccinelle script:

--->8---
virtual patch

@@
struct pwm_device *p;
expression e;
@@
(
-(p)->polarity = e;
+pwm_set_polarity((p), e);
|
-(p)->polarity
+pwm_get_polarity((p))
s/((p))/(p)/
quoted
|
-(p)->period = e;
+pwm_set_period((p), e);
|
-(p)->period
+pwm_get_period((p))
s/((p))/(p)/
quoted
|
-(p)->duty_cycle = e;
+pwm_set_duty_cycle((p), e);
The (p) seems unnecessary here.
I don't get this one. You mean I should drop one the parenthesis around
p, right?
Same as above - s/(p)/p/. It should never be necessary to write
	pwm_set_duty_cycle((p), e)
since
	pwm_set_duty_cycle(p, e)
should be the same.

On the other side, I did not see this expression used in any of the patches,
though maybe I missed it.

Thanks,
Guenter
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help