Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp403170ybg; Mon, 1 Jun 2020 04:36:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxB68AyIhGr8XLja/SABIztDggMk30qHYMLNyoOvCzF4sXx7G6odDQTaxBc2kllVB7xBZH6 X-Received: by 2002:a17:906:f891:: with SMTP id lg17mr18526130ejb.405.1591011376258; Mon, 01 Jun 2020 04:36:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591011376; cv=none; d=google.com; s=arc-20160816; b=iLyrPMRgdfHS1gtzw6llQSIYXr/i3Gk8zXFtlcQRxe7uYNuTySearJzjqQ2vtkj0Op QBcYi58tIhBKX3oXTYNVqVvopFE9JEhYs71FG55/efn2/GPAHqdvrr08S18Dke++Vhvi sM7g0dYta6spEu6K9Q31AEBEe85G0asQ2PT4oKDdlbNnYnc7jrjc144wGMfBv0++4Mqm r0XWhMRRXpZMAK0VSy9n5mcObsBt6GkPugCCbZnbge0TaPuogyQ8kF+QS3eZPgbJCNGq MZt0Vw+39zuoxLevMLJ+IRCf03HWoEtTDyGyfwkM/deyJNkJ+X3e8uu8IrzKvd6RXtN9 SlAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=Nd0MJv58FOzwtHGzKOAQUQrfp095J8UPcRViDxSn4NY=; b=ODk086LC1rasxv9QxjaSR1iKMnagWA02nF/WyFH0Sg9AqEo1EH9rvTbgxhjeE4PiDe LWUIwdeYSyNjYIGNmYQ/3zmhJzTTyqpmkFgs6i4FpJfm0ABOkGfgYF1ztfLQtW/HFi7y U80IoAvpllaDmUYlZPqa/hmjT0Nsoqwriz4cJoC5knQHRf9uYQglMJTGbvjP90FNMukl Py34UX7jqRZZzg9Zk4pe/WCs8eaKCesjnE9rmM2Bs/79dCjXq/vbkmCmN0adZx0Q9UAu mJxsyiEDwXoqwTKXqh95bL+W8YrcFXMCZk5B7Tsjk+C1acAOpH2VGOm0T9jzGdyAZsUv lbBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=W1cq8qUf; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y21si3916151edm.260.2020.06.01.04.35.53; Mon, 01 Jun 2020 04:36:16 -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; dkim=pass header.i=@linaro.org header.s=google header.b=W1cq8qUf; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726078AbgFALdd (ORCPT + 99 others); Mon, 1 Jun 2020 07:33:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60120 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725925AbgFALdc (ORCPT ); Mon, 1 Jun 2020 07:33:32 -0400 Received: from mail-wr1-x444.google.com (mail-wr1-x444.google.com [IPv6:2a00:1450:4864:20::444]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1E750C061A0E for ; Mon, 1 Jun 2020 04:33:32 -0700 (PDT) Received: by mail-wr1-x444.google.com with SMTP id h5so5211532wrc.7 for ; Mon, 01 Jun 2020 04:33:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=Nd0MJv58FOzwtHGzKOAQUQrfp095J8UPcRViDxSn4NY=; b=W1cq8qUfXNb0j4Lq6BuNFnrIp53KOB8jyeE6rYZeTI51f51hwvHIG8BMXCMp30BfcV Kz/SCbb6ETAHq3dGo029IWxUjmMkUz9Max3D/z1jlGGo9qVQX5MaQ0y+BgRt/DHvwxo0 RdVUU7GjYR/htIut780K5s1uKUZ3OK2iZVbmowEjMjE7GOiArJCYEkC6vgo9QPYK8nZO Lqab5QsLwiu8GkCE/AA07HEeFEaNoSkx5MwfuSlQJmGmLDy4JWZJBCDOv5WRJQzgVlwo r3zCmmu3iuz7KlkftwAHmjHe7lGtZDZgMfBzSIVGGV85FYemiKmMRx050a7sYfAPJPUW IkkA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=Nd0MJv58FOzwtHGzKOAQUQrfp095J8UPcRViDxSn4NY=; b=g412OeRGBZNqnymejuJYOTVNTPHJIe/ZVBCaH2UUOYOhe6P4FCe5qkBkF9/X5ndihj sFtnTRchkBgyH8XnYy/HMpd67sWHyaU5TcUnSoWder5Ds/vxOlfDSSjhx+5AaJvD/eMW hV+AQ8bs6d3kYSO9SFMgTw1qGG3OqzOkeAHou0ITpgP+yKsL8zemuxtKigpFY6y9XPkm Cu0UyyRO1xuse0rIhsoWikBXia/75BkYHEFwxZ7B/E7TjP97ok8PSaWP35yEkYfTGy21 xWa6MNGe5JUzATF3mzZ4WAPmk+JKy8sydw4ejxDuTY8u+kxbyDQEvbK1dvbvT/mTHvM7 pSYQ== X-Gm-Message-State: AOAM530Dg+/jd1W14vnACzQVNxpCHkpjb8sn2XOKvpobhTqusK9582lJ 0jm84ljV+vA7FVSed3LYAZW8TQ== X-Received: by 2002:a5d:4e88:: with SMTP id e8mr22527436wru.188.1591011210824; Mon, 01 Jun 2020 04:33:30 -0700 (PDT) Received: from holly.lan (cpc141214-aztw34-2-0-cust773.18-1.cable.virginm.net. [86.9.19.6]) by smtp.gmail.com with ESMTPSA id n23sm10731794wmc.0.2020.06.01.04.33.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Jun 2020 04:33:30 -0700 (PDT) Date: Mon, 1 Jun 2020 12:33:28 +0100 From: Daniel Thompson To: Guru Das Srinagesh Cc: linux-pwm@vger.kernel.org, Thierry Reding , Uwe =?utf-8?Q?Kleine-K=C3=B6nig?= , Subbaraman Narayanamurthy , David Collins , linux-kernel@vger.kernel.org, Joe Perches , Stephen Boyd , Lee Jones , Arnd Bergmann , Geert Uytterhoeven , Guenter Roeck , Dan Carpenter , linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH v15 04/11] pwm: clps711x: Use 64-bit division macro Message-ID: <20200601113328.oyhxosbtlfeaqytq@holly.lan> References: <20200528203341.GA8065@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200528203341.GA8065@codeaurora.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, May 28, 2020 at 01:33:41PM -0700, Guru Das Srinagesh wrote: > On Tue, May 26, 2020 at 10:35:04AM -0700, Guru Das Srinagesh wrote: > > Since the PWM framework is switching struct pwm_args.period's datatype > > to u64, prepare for this transition by using DIV64_U64_ROUND_CLOSEST to > > handle a 64-bit divisor. > > > > Cc: Daniel Thompson > > Signed-off-by: Guru Das Srinagesh > > --- > > drivers/pwm/pwm-clps711x.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/drivers/pwm/pwm-clps711x.c b/drivers/pwm/pwm-clps711x.c > > index 924d39a..ba9500a 100644 > > --- a/drivers/pwm/pwm-clps711x.c > > +++ b/drivers/pwm/pwm-clps711x.c > > @@ -43,7 +43,7 @@ static void clps711x_pwm_update_val(struct clps711x_chip *priv, u32 n, u32 v) > > static unsigned int clps711x_get_duty(struct pwm_device *pwm, unsigned int v) > > { > > /* Duty cycle 0..15 max */ > > - return DIV_ROUND_CLOSEST(v * 0xf, pwm->args.period); > > + return DIV64_U64_ROUND_CLOSEST(v * 0xf, pwm->args.period); > > } > > > > static int clps711x_pwm_request(struct pwm_chip *chip, struct pwm_device *pwm) > > -- > > Hi Daniel, > > Could you please review this patch when you get a chance to? I don't normally review PWM patches... but this no longer has the bug there was there when I first read this patch. Daniel.