Received: by 2002:a25:d80d:0:0:0:0:0 with SMTP id p13csp251426ybg; Sat, 23 May 2020 13:05:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxKNpXUESmY0KbGlWHvWzJObeX08AijP2UL9rSjBREbJIUYzOXcSEc3I7BKhNCtaqkZJgV0 X-Received: by 2002:aa7:cb94:: with SMTP id r20mr8523586edt.215.1590264356928; Sat, 23 May 2020 13:05:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590264356; cv=none; d=google.com; s=arc-20160816; b=RaHo6akvZ5GV1836zJ6bmLd53qJk+7A+i4UTq4BqO9lRPeS8p3OkWCwFRHnBlcoyqX tZMG2YIud3uvART1p3XoVkjI/gjG+gATla0xNsr2g6/NcQ24kKSu79XePp5MD0MBoW+d Eo1qAYpL9VuRVjV2YlhG/o6Je1KzGf9ELr8sxHAm+ahyTHhBTfIuMtrsLFSpH/O8eOZG sV/C+i8NlotSOgHAWiDhtVQPxVsXSsbuTX5Z8B/2VGOrx8kDn1QK6uv2oZgxbl201F+r kYz9PkpiZjaZ/3zEDmXN8i2Zrwcgkis2ZuCPrxiTo+fFgop78Xfpk1Wr81keNzHzVrVS tuLQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=ytokAtVo7vYq6gN1q6f3T1aTnwJmO9KMYffQJdhqje8=; b=iq2XJZMZo86zjvdDj6Oo0VucLlA+C1euZpUwNbx2j1V7oL5vTzLENewRbyLQZEWMBw O/PkvFAB+2AHm5e/vfgulHHBeoDNy4vCTOM/dZD1xeKcZnjo3i0dZpR437Y+qPyOuomL HSSzmM1Zlgv9axAni/QRP2EOHSxA4SwTMz6HS4LWSOmqEuHTo6iagvlSASH8yz8o1ail s/qqEAMewoD7aruU2Kx30MU6p1zhFGE3swKot/P9cPOeeIOJgJIQfxXC65obReOfKznX ztmMJZ08pW5lToJs8dylWYxsHG7g2PVpZT0I9Hel5/7EiFzOFrkdshcuJ1SgrUH8erza vlAw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b6si6464100edw.590.2020.05.23.13.05.34; Sat, 23 May 2020 13:05:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387847AbgEWUBo (ORCPT + 99 others); Sat, 23 May 2020 16:01:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46506 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727962AbgEWUBn (ORCPT ); Sat, 23 May 2020 16:01:43 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BC986C061A0E for ; Sat, 23 May 2020 13:01:43 -0700 (PDT) Received: from pty.hi.pengutronix.de ([2001:67c:670:100:1d::c5]) by metis.ext.pengutronix.de with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jcaKt-0007U9-AD; Sat, 23 May 2020 22:01:35 +0200 Received: from ukl by pty.hi.pengutronix.de with local (Exim 4.89) (envelope-from ) id 1jcaKj-0002Ig-7H; Sat, 23 May 2020 22:01:25 +0200 Date: Sat, 23 May 2020 22:01:25 +0200 From: Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= To: David Wu Cc: Thierry Reding , Heiko Stuebner , linux-pwm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, Rasmus Villemoes Subject: Re: [PATCH] pwm: rockchip: simplify rockchip_pwm_get_state() Message-ID: <20200523200125.khdw3eau5eakxqy6@pengutronix.de> References: <20190919091728.24756-1-linux@rasmusvillemoes.dk> <20190919111115.5oraof2bdl4627xv@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20190919111115.5oraof2bdl4627xv@pengutronix.de> User-Agent: NeoMutt/20170113 (1.7.2) X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::c5 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello David, On Thu, Sep 19, 2019 at 01:11:15PM +0200, oUwe Kleine-K?nig wrote: > On Thu, Sep 19, 2019 at 11:17:27AM +0200, Rasmus Villemoes wrote: > > The way state->enabled is computed is rather convoluted and hard to > > read - both branches of the if() actually do the exact same thing. So > > remove the if(), and further simplify " ? true : > > false" to "". > > > > Signed-off-by: Rasmus Villemoes > > --- > > I stumbled on this while trying to understand how the pwm subsystem > > works. This patch is a semantic no-op, but it's also possible that, > > say, the first branch simply contains a "double negative" so either > > the != should be == or the "false : true" should be "true : false". > > The change looks obviously right, it's a noop. > > I share your doubts however. The construct was introduced in commit > 831b2790507b ("pwm: rockchip: Use same PWM ops for each IP") by David > Wu. > > Before there were rockchip_pwm_get_state_v1 for the supports_polarity = > false case and rockchip_pwm_get_state_v2 for supports_polarity = true. > > In both state->enabled was assigned true if ((val & enable_conf) == > enable_conf). So I assume everything is fine. > > A confirmation by David would be great though. This is still open. Can you please have a look at https://patchwork.ozlabs.org/project/linux-pwm/patch/20190919091728.24756-1-linux@rasmusvillemoes.dk/ and verify it's correct? Best regards Uwe -- Pengutronix e.K. | Uwe Kleine-K?nig | Industrial Linux Solutions | https://www.pengutronix.de/ |