Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753064AbbKPRAU (ORCPT ); Mon, 16 Nov 2015 12:00:20 -0500 Received: from bh-25.webhostbox.net ([208.91.199.152]:34377 "EHLO bh-25.webhostbox.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751905AbbKPRAN (ORCPT ); Mon, 16 Nov 2015 12:00:13 -0500 Subject: Re: [PATCH v4 04/24] hwmon: pwm-fan: use pwm_get_xxx() helpers where appropriate To: Boris Brezillon 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> <20151116175322.48dba6f9@bbrezillon> 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 From: Guenter Roeck Message-ID: <564A0B95.6010603@roeck-us.net> Date: Mon, 16 Nov 2015 09:00:05 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <20151116175322.48dba6f9@bbrezillon> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Authenticated_sender: linux@roeck-us.net X-OutGoing-Spam-Status: No, score=0.0 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - bh-25.webhostbox.net X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - roeck-us.net X-Get-Message-Sender-Via: bh-25.webhostbox.net: authenticated_id: linux@roeck-us.net X-Source: X-Source-Args: X-Source-Dir: Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1553 Lines: 65 On 11/16/2015 08:53 AM, Boris Brezillon wrote: > 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? > 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 -- 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/