From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 48E4FC433E0 for ; Wed, 3 Jun 2020 03:18:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 286B5206E6 for ; Wed, 3 Jun 2020 03:18:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725890AbgFCDSE (ORCPT ); Tue, 2 Jun 2020 23:18:04 -0400 Received: from regular1.263xmail.com ([211.150.70.195]:43316 "EHLO regular1.263xmail.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725780AbgFCDSD (ORCPT ); Tue, 2 Jun 2020 23:18:03 -0400 X-Greylist: delayed 446 seconds by postgrey-1.27 at vger.kernel.org; Tue, 02 Jun 2020 23:18:02 EDT Received: from localhost (unknown [192.168.167.235]) by regular1.263xmail.com (Postfix) with ESMTP id 022B71325; Wed, 3 Jun 2020 11:10:28 +0800 (CST) X-MAIL-GRAY: 0 X-MAIL-DELIVERY: 1 X-ADDR-CHECKED4: 1 X-ANTISPAM-LEVEL: 2 X-SKE-CHECKED: 1 X-ABS-CHECKED: 1 Received: from [192.168.0.122] (unknown [103.29.142.67]) by smtp.263.net (postfix) whith ESMTP id P31254T139913132439296S1591153826661362_; Wed, 03 Jun 2020 11:10:27 +0800 (CST) X-IP-DOMAINF: 1 X-UNIQUE-TAG: <57c229d03dbe2bff381c71644df05028> X-RL-SENDER: david.wu@rock-chips.com X-SENDER: wdc@rock-chips.com X-LOGIN-NAME: david.wu@rock-chips.com X-FST-TO: linux-kernel@vger.kernel.org X-SENDER-IP: 103.29.142.67 X-ATTACHMENT-NUM: 0 X-DNS-TYPE: 0 X-System-Flag: 0 Subject: Re: [PATCH] pwm: rockchip: simplify rockchip_pwm_get_state() To: Thierry Reding , Rasmus Villemoes Cc: Heiko Stuebner , linux-pwm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org References: <20190919091728.24756-1-linux@rasmusvillemoes.dk> <20200602123914.GA3360525@ulmo> From: David Wu Message-ID: <2f860dba-26c7-c670-58e2-9ef502881522@rock-chips.com> Date: Wed, 3 Jun 2020 11:10:26 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <20200602123914.GA3360525@ulmo> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This change is very good, thank you. The code continues from the original code(get_state_v1 and get_state_v2), didn’t make any changes at that time, and sorry I have not seen linux-rockchip@lists.infradead.org mail recently. 在 2020/6/2 下午8:39, Thierry Reding 写道: > 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". >> >> drivers/pwm/pwm-rockchip.c | 7 +------ >> 1 file changed, 1 insertion(+), 6 deletions(-) > > I've applied this. Irrespective of any feedback David would have this is > correct and a nice simplification. > > Thierry >