Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp387866ybh; Wed, 11 Mar 2020 03:06:44 -0700 (PDT) X-Google-Smtp-Source: ADFU+vsq4piYK7ewl3KFgenQFzjxvAM7O0rfu6XTuINqP0/LFz8kTBMVdwGLZ+BePtyPLO+yyrqI X-Received: by 2002:aca:5057:: with SMTP id e84mr1368408oib.120.1583921204344; Wed, 11 Mar 2020 03:06:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1583921204; cv=none; d=google.com; s=arc-20160816; b=YHCEDQN7GOvhEdYHRS6mK322XJlW5O2Eq7y4KZb09vnzTzIaPKYYcuFE1X0v6/kNnz s3nUpQYy+QSrea+y+PvIuG0G+PH4rhWrMfICM5gL43Vz8ce1NcAri4wyXebTqa8lJ/Me uRE0rsn3ceV7nnVAO6DzksA0vc+veEv3GWfVOrC7kCnNhu2oIW1KK8m3/Mble5XIJPwG Z21B2ppG92lxZ+WNSRnQL/PfuMP73pSJbp6EQabbstwS9F8Rx5Tc77k36GKFYVr85Nom AlN2uKUpgu6GpnbnGjPVMzlxq4WBfGHrrz/bz+xn8UGyKieugYk2+bT8logwosi6FuTq u+aQ== 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=93G/zDTaOyD8EFBjnQ5HIhSQ1W1zWJdEX89fmqSHRBM=; b=NaMSgoh4Uh+Q8hEKuwycgmNnGaHTpdcGf49sVSMKKXCmac0ZZIJLqmvcf2QiFkOUPc x90+8OON8Eysu5LdO+ivWZwUytiWvWujPWRJ4uPfrXeN5mBnZctZ62h3r/l/tlicOnjA UhUI+Lo5JWIE44FkYnDLfd2lGfC+BdSDM2et9pE3fkQU2NVyCnU1ni/cx1UoIyzS/GXN rCtEAyIi2BEOivAWi8mhfIAaWwKVCrJ/djAyH89sP4Q+DkyhSNNh1HI6oTMIvq5hHx/3 ZKxkhu4trrzFyd3w1iU8ojv9Xi5Lefx8L/9QJ8EZ1nPD9VV3WM3twU3/OiIBxtVci1SC sxdg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=sphWW9cM; 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=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d16si813719otp.135.2020.03.11.03.06.30; Wed, 11 Mar 2020 03:06:44 -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=@linaro.org header.s=google header.b=sphWW9cM; 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=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728668AbgCKKF5 (ORCPT + 99 others); Wed, 11 Mar 2020 06:05:57 -0400 Received: from mail-wm1-f65.google.com ([209.85.128.65]:38128 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728444AbgCKKF5 (ORCPT ); Wed, 11 Mar 2020 06:05:57 -0400 Received: by mail-wm1-f65.google.com with SMTP id n2so1380029wmc.3 for ; Wed, 11 Mar 2020 03:05:54 -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=93G/zDTaOyD8EFBjnQ5HIhSQ1W1zWJdEX89fmqSHRBM=; b=sphWW9cMhYeeZnLJ1WOkhyAMUglQ2PHyu4A4P4MLn5LhUtR9grWcvpv742AfsJD6Ae MTvz64bk2UZqLRIhYNkgXi2vDO0gtjl1Y1K0iLPsu9RZOBO+0NApphHzRa/dwzCffgyz JCPqgrdJC6G4t08cCPiiopuMy77kI75CX90AUD5PQDA+3LrRgoiWJLUkVupU0XhQnhM0 uwQesF7rKRXr4TUN92Sp0L6xrs0pD8XnAGmGuAvA7PWJWJQ7eb/vVnHglk5SmVwwDU8w P5YMd7cfmZvPApO7oHcFhiAb6mDKRbVk5KH+MR1INXVq1NdWTwh8eg3ym3UH9qsNgraI a9Tg== 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=93G/zDTaOyD8EFBjnQ5HIhSQ1W1zWJdEX89fmqSHRBM=; b=qlv4NnR0CjIpCcP5KeT7/9P8tp0AWV8j9I1rLMNTJsWfPiqzaJSCFNN6mqcF4EbaVA y3BgrSFzX/UNi7DqEtgJYJikHBbvbsKQfNjOFvAHzti4myI2mowBPpNVR3FfQfKaSbLf 8DERzPX9Q2ZQv/BSSZH4VgXhxQ23/8IMf8iGJ84mCV24h5a3Qk9hV4CXmWXauv2emCJI iZ+qBZwyoWFhq0FmTo6GbrZOEUPXVArhmRygrEGVAcVaa/pPDm6EoSOV4L2V4Q3aHrF3 +r/vM6Ss6JgkB3o6QKYzQynZ4ygtL075gcK5j4J5S9XXcL1bpAOclT7eVdiE/r2AjWd0 V18Q== X-Gm-Message-State: ANhLgQ2WKRZ+c5FKFdnilqHludipe92IP2aeEgtsTtAISwWYJD59IE0M uV9YG/QaMdQdeLFROGhlVVLpCw== X-Received: by 2002:a1c:1f14:: with SMTP id f20mr3005879wmf.61.1583921154070; Wed, 11 Mar 2020 03:05:54 -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 i21sm8239881wmb.23.2020.03.11.03.05.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Mar 2020 03:05:53 -0700 (PDT) Date: Wed, 11 Mar 2020 10:05:51 +0000 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 , linux-kernel@vger.kernel.org, Lee Jones , Jingoo Han , Bartlomiej Zolnierkiewicz , dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org Subject: Re: [PATCH v8 11/12] backlight: pwm_bl: Use 64-bit division function Message-ID: <20200311100551.umvfqelrqzcfo7sa@holly.lan> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 10, 2020 at 06:41:20PM -0700, Guru Das Srinagesh wrote: > Since the PWM framework is switching struct pwm_state.period's datatype > to u64, prepare for this transition by using div_u64 to handle a 64-bit > dividend instead of a straight division operation. > > Cc: Lee Jones > Cc: Daniel Thompson > Cc: Jingoo Han > Cc: Bartlomiej Zolnierkiewicz > Cc: linux-pwm@vger.kernel.org > Cc: dri-devel@lists.freedesktop.org > Cc: linux-fbdev@vger.kernel.org > > Signed-off-by: Guru Das Srinagesh Reviewed-by: Daniel Thompson > --- > drivers/video/backlight/pwm_bl.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/video/backlight/pwm_bl.c b/drivers/video/backlight/pwm_bl.c > index efb4efc..3e5dbcf 100644 > --- a/drivers/video/backlight/pwm_bl.c > +++ b/drivers/video/backlight/pwm_bl.c > @@ -625,7 +625,8 @@ static int pwm_backlight_probe(struct platform_device *pdev) > pb->scale = data->max_brightness; > } > > - pb->lth_brightness = data->lth_brightness * (state.period / pb->scale); > + pb->lth_brightness = data->lth_brightness * (div_u64(state.period, > + pb->scale)); > > props.type = BACKLIGHT_RAW; > props.max_brightness = data->max_brightness; > -- > The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, > a Linux Foundation Collaborative Project >