Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp3502109ybb; Mon, 23 Mar 2020 02:15:06 -0700 (PDT) X-Google-Smtp-Source: ADFU+vucJsYj9pYDokOySzcnd6fVRkx+/018+x9GhPCDyu5q0rxkileiMfGKRssFq2FcZ2jM5R5o X-Received: by 2002:a05:6830:196:: with SMTP id q22mr16993200ota.98.1584954906495; Mon, 23 Mar 2020 02:15:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584954906; cv=none; d=google.com; s=arc-20160816; b=r2rd7m9zQUegPxfXs9/ETdLJELt4joTnnFAMY7Ag6JCASLBaHMYCXn5gIEYJUoMvOB TGZdre65aT04Jj8vv8GP2c7X2xVB3QkDigNZe2UZqn9/TtzUZAMEsaPvAxSqNc7fYc07 X5gSNoe/S7sg0kkjECRG8gXdZXyncdKQJcLKqB5LQmLbx7SabOtX6CGiZ7+5Zd1TRdJb WQMH4WG3h4H7JICcnFOPQL7y8xMhdmXv2xMHVvuerebDM9/xrBSCCVe+qq6Qp1GMxmqp VsKuMKqmLxXLgIxRQoQpGBiO0Wz+GzIUm1I3YNLvSgr9PEGCthqc6rnjV5Bz6VHdwJtO ib7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=wWs92IouvEIpZgtyLlUCar33wlELXd5YoEyPXlLiTro=; b=YI/qrjGk4WXrHf/hLifpOz0PFcvrdO2y8HOBQAMVEEZ6CAPkpNN4KRNvYh/0fzcIoR 2xsPp+caN1kVL2UWmEeZMDE+2Q4FWIWXza/m8yhQrBtD7nsP5jf4CTGyc/s9VqRywaus 7dHZMzsS/Jta4wZ+C7geCeQHjEuDHOjYr4TCUnYqW/2TYib5qrMsqANHiylqwXqheVJc 3UNXq0HJP5Z/wVYwF6Yh9nPSlOOzC9P+y2LGSgSrP2Ty9/+eaDNYF9JxSDYFEbCKjZTy 9Y2vXzpCskmFq75xC6Q7GCGn6GGnBlqJhfx9Lr2mx8W7PBFx2efAAuwSeImOZT0gsSQO WA2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@broadcom.com header.s=google header.b=QbDeCI7d; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 7si46559ooy.80.2020.03.23.02.14.53; Mon, 23 Mar 2020 02:15:06 -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; dkim=pass header.i=@broadcom.com header.s=google header.b=QbDeCI7d; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727698AbgCWJN7 (ORCPT + 99 others); Mon, 23 Mar 2020 05:13:59 -0400 Received: from mail-lf1-f65.google.com ([209.85.167.65]:34365 "EHLO mail-lf1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726037AbgCWJN7 (ORCPT ); Mon, 23 Mar 2020 05:13:59 -0400 Received: by mail-lf1-f65.google.com with SMTP id e7so607675lfq.1 for ; Mon, 23 Mar 2020 02:13:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=wWs92IouvEIpZgtyLlUCar33wlELXd5YoEyPXlLiTro=; b=QbDeCI7dYNFzd6fyHyqfAHAq63bQLRiJHT19fT4MkRi6jTMuI0QC28e9a4Pak1jEUa s11EYGMPEm6ADD5Mq5hQuV9351l3yGYjAbg+dzzd7aio3ISGAIuswd0yNbbHR9YIu30S M+ZYpecb4mDH7vTudL1qV/c8X68h61ZfXm89Y= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=wWs92IouvEIpZgtyLlUCar33wlELXd5YoEyPXlLiTro=; b=BlYJTQ+NCrlCUU/7igvXMczcKT07LuaEvHpNLO2lBoiyesSxtFLfCOWOPZH8iD1Tfx JvIlXTQgarWvroT0Chw9OZUHogPx7IU+kaMsedRT7ihJIK00UGqIiGxmsdO+446w0b6c vSwe9kKfxp2bmjP9r/hNEPbxqdIUdX0lUIL0UqiLW4yUrdBIxuWSE4xRCjz7xd+ZI+pG RJlqw7GfQYaa82BL6mtODg5q85QozuYSruGIioEqw+lD3ujXB+5ZPSfQeH6lQr+hJhb5 NeoYibspJKWDr4/CuPQB/7l9vNf4aBL7YNIX5/zkQPnWRSanC4tGW1f2mAE1NIDSG7fE U4iA== X-Gm-Message-State: ANhLgQ0EgC9KWAov1Nzq2uI/xvyhtBOXqisSKj/vfYPg8PfY+q7Pv4bo zbBHrzvAcIPYSyLlUEMnj/PDFaFAcWCtno7YPgAitw== X-Received: by 2002:a05:6512:3041:: with SMTP id b1mr12674571lfb.167.1584954837051; Mon, 23 Mar 2020 02:13:57 -0700 (PDT) MIME-Version: 1.0 References: <20200323065318.16533-1-rayagonda.kokatanur@broadcom.com> <20200323065318.16533-3-rayagonda.kokatanur@broadcom.com> <20200323082823.twvpagq7tvrt76ws@pengutronix.de> In-Reply-To: <20200323082823.twvpagq7tvrt76ws@pengutronix.de> From: Rayagonda Kokatanur Date: Mon, 23 Mar 2020 14:43:45 +0530 Message-ID: Subject: Re: [PATCH v1 2/2] pwm: bcm-iproc: remove unnecessary check of 'duty' To: =?UTF-8?Q?Uwe_Kleine=2DK=C3=B6nig?= Cc: Thierry Reding , Ray Jui , Scott Branden , BCM Kernel Feedback , Yendapally Reddy Dhananjaya Reddy , linux-pwm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 1:58 PM Uwe Kleine-K=C3=B6nig wrote: > > 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. Its reported by internal coverity tool. > > Also the commit log suggests that IPROC_PWM_DUTY_CYCLE_MIN is zero. > Maybe mentioning that explicitly is a nice addition, too. Okay, will add this to commit message. Thanks. > > > Fixes: daa5abc41c80 ("pwm: Add support for Broadcom iProc PWM controlle= r") > > 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 =3D rate * state->duty_cycle; > > duty =3D 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=C3=B6nig = | > Industrial Linux Solutions | https://www.pengutronix.de/ = |