Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753202AbbKPQxa (ORCPT ); Mon, 16 Nov 2015 11:53:30 -0500 Received: from down.free-electrons.com ([37.187.137.238]:50542 "EHLO mail.free-electrons.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751905AbbKPQx0 (ORCPT ); Mon, 16 Nov 2015 11:53:26 -0500 Date: Mon, 16 Nov 2015 17:53:22 +0100 From: Boris Brezillon To: Guenter Roeck Cc: Thierry Reding , linux-pwm@vger.kernel.org, Mike Turquette , Stephen Boyd , linux-clk@vger.kernel.org, Mark Brown , Liam Girdwood , Kamil Debski , lm-sensors@lm-sensors.org, Jean Delvare , Dmitry Torokhov , linux-input@vger.kernel.org, Bryan Wu , Richard Purdie , Jacek Anaszewski , linux-leds@vger.kernel.org, Maxime Ripard , Chen-Yu Tsai , linux-sunxi@googlegroups.com, Joachim Eastwood , Thomas Petazzoni , Heiko Stuebner , linux-rockchip@lists.infradead.org, Jingoo Han , Lee Jones , linux-fbdev@vger.kernel.org, Jean-Christophe Plagniol-Villard , Tomi Valkeinen , Robert Jarzmik , Alexandre Belloni , Julia Lawall , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v4 04/24] hwmon: pwm-fan: use pwm_get_xxx() helpers where appropriate Message-ID: <20151116175322.48dba6f9@bbrezillon> In-Reply-To: <5649FD5B.3000208@roeck-us.net> References: <1447664207-24370-1-git-send-email-boris.brezillon@free-electrons.com> <1447664207-24370-5-git-send-email-boris.brezillon@free-electrons.com> <5649FD5B.3000208@roeck-us.net> X-Mailer: Claws Mail 3.11.1 (GTK+ 2.24.27; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1327 Lines: 58 On Mon, 16 Nov 2015 07:59:23 -0800 Guenter Roeck wrote: > On 11/16/2015 12:56 AM, Boris Brezillon wrote: > > 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 > > --- > > 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)/ > > > | > > -(p)->period = e; > > +pwm_set_period((p), e); > > | > > -(p)->period > > +pwm_get_period((p)) > > s/((p))/(p)/ > > > | > > -(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? -- Boris Brezillon, Free Electrons Embedded Linux and Kernel engineering http://free-electrons.com -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/