Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp3470267ybb; Mon, 23 Mar 2020 01:29:55 -0700 (PDT) X-Google-Smtp-Source: ADFU+vtkZ9ZqVuKwtSCGpW5/li7DmJ9wcLv/Y9cE68XvUmBKlwQR6P188dxrQyO2+YdVeuJjoBk/ X-Received: by 2002:a05:6830:1c77:: with SMTP id s23mr17283089otg.191.1584952195670; Mon, 23 Mar 2020 01:29:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584952195; cv=none; d=google.com; s=arc-20160816; b=LhB7/+6Vk0uubh88YTYbrsSqhmlxL2BtUN/9i7mcnrhFBxGYIiLeaX21jubqmlLYYF Iy3H2nw/Or+Nr8+WqUA2M45W3O0cnl8bQLsZK/oSmsFTMjwz9e5rcMrTv4Dtsmlous9Z bndkkY3i5DdimNwWdzvzb4cierHACL7naT6ukViSGxNDSi/+ZgCBBAao+d1dpk9YZ/W/ MIvU7S3yYiNc1s48yjDu51wuTcLnhX0GttRPjhDAL4aweKosg1dZ72gyeVYDqelPItIg GPgtuPjTllb6ERAr3zUeE4ESDT59tf04QAaiOd+nQibA3drIkOdXB4aqTPXUSZQgs+aK iqjQ== 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=E93MZ965p8VwYTG8TDNVgx+M3BK1rQQ0/fLXxCnoRxU=; b=wm4e6A0umIeOAV0RiJbUDnM2lzA1gVREdA26dSUhXJhv7ywSPQFe4GxrRCjsLOt5Wv cwYSOK4Uqdx+8ozejbHwgp7jMzTuOSllxCwVTnLEflWUQm+q4dnBCdI/+iRqWq5VNkH5 zKE5swVUQOMsDykqqD8adJw8LzYXloEXAh9teip9r7tXHZI7IHqpshpbQbtoRIvuClbr fn/raRJmk16lOKWJ/hExYoMIuCyQ0Z28vsf+PbbFWXl8g1XWp2+qN++f2/DMep7zHfjJ wubc/bAtiVzGZehYG7+MmUUqqK8UkQY++YyfKldI59nWC1Dqc2GSkdupICgmYBC97UK0 9ksQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t11si814325otp.314.2020.03.23.01.29.43; Mon, 23 Mar 2020 01:29:55 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727572AbgCWI22 (ORCPT + 99 others); Mon, 23 Mar 2020 04:28:28 -0400 Received: from metis.ext.pengutronix.de ([85.220.165.71]:52751 "EHLO metis.ext.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727451AbgCWI22 (ORCPT ); Mon, 23 Mar 2020 04:28:28 -0400 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 1jGIRc-0004iF-7Y; Mon, 23 Mar 2020 09:28:24 +0100 Received: from ukl by pty.hi.pengutronix.de with local (Exim 4.89) (envelope-from ) id 1jGIRb-0007aD-TB; Mon, 23 Mar 2020 09:28:23 +0100 Date: Mon, 23 Mar 2020 09:28:23 +0100 From: Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= To: Rayagonda Kokatanur Cc: Thierry Reding , Ray Jui , Scott Branden , bcm-kernel-feedback-list@broadcom.com, Yendapally Reddy Dhananjaya Reddy , linux-pwm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v1 2/2] pwm: bcm-iproc: remove unnecessary check of 'duty' Message-ID: <20200323082823.twvpagq7tvrt76ws@pengutronix.de> References: <20200323065318.16533-1-rayagonda.kokatanur@broadcom.com> <20200323065318.16533-3-rayagonda.kokatanur@broadcom.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20200323065318.16533-3-rayagonda.kokatanur@broadcom.com> 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 On Mon, Mar 23, 2020 at 12:23:18PM +0530, Rayagonda Kokatanur wrote: > Variable 'duty' is u32. Hence the less-than zero > comparison is never true, remove the check. How did you find that one? I assume it was a compiler warning you fixed here? In this case quoting the warning improves the commit log. Also the commit log suggests that IPROC_PWM_DUTY_CYCLE_MIN is zero. Maybe mentioning that explicitly is a nice addition, too. > Fixes: daa5abc41c80 ("pwm: Add support for Broadcom iProc PWM controller") > Signed-off-by: Rayagonda Kokatanur > --- > drivers/pwm/pwm-bcm-iproc.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/drivers/pwm/pwm-bcm-iproc.c b/drivers/pwm/pwm-bcm-iproc.c > index 8bbd2a04fead..1bb66721f985 100644 > --- a/drivers/pwm/pwm-bcm-iproc.c > +++ b/drivers/pwm/pwm-bcm-iproc.c > @@ -149,8 +149,7 @@ static int iproc_pwmc_apply(struct pwm_chip *chip, struct pwm_device *pwm, > value = rate * state->duty_cycle; > duty = div64_u64(value, div); > > - if (period < IPROC_PWM_PERIOD_MIN || > - duty < IPROC_PWM_DUTY_CYCLE_MIN) > + if (period < IPROC_PWM_PERIOD_MIN) > return -EINVAL; Best regards Uwe -- Pengutronix e.K. | Uwe Kleine-K?nig | Industrial Linux Solutions | https://www.pengutronix.de/ |