Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp34082ybh; Tue, 10 Mar 2020 18:42:25 -0700 (PDT) X-Google-Smtp-Source: ADFU+vsaZKRPd6qDXwdbIE29LUT+qn/hfQI/fSNSK15rNCKbUCwaNJv174Xz9rBFtKppsEwGyl27 X-Received: by 2002:a05:6808:b17:: with SMTP id s23mr392839oij.166.1583890944893; Tue, 10 Mar 2020 18:42:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1583890944; cv=none; d=google.com; s=arc-20160816; b=NYGHCofn/FyrTaLQ26z/YOmqOvp708zApeOh4PE9MtqOo1NmYD/c8/uCoWHyGVV7We xgY/Vzu47GzAfxv5crICD3h8sEQus35inRsJMNpm3K6k8LM6N4Z8k/76rJi6mbKa+bY4 UGMxsQunShZlY9Zf4nThBCL4Tx9BOef8KoqtKawbDOSqMnEk3qAmY7QbRzJFSCUXPkP6 e4EkGPdwewxH7WmLWacPctYKfp0sWTqBzmwQLhnC++4lNt8ko42k7lLPE8AbANoFUKXD ki2atB4i1e3NfIVXhQE4bbHebYpkCw9zSnoNOrpqwZ89BGYj2XKh09ddI3zM2877jt28 DT7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:cc:to:from; bh=My5GmhI/se++rfRdY3PBs4ZNTofBVu4MYjPCygodybw=; b=H8giBb6lDmJWCAKVjh3dcIUzAXL4Tbhv0gyveWVH78j5NeXw2ohW7wrATE7IDKR/XN dFZrar3RwZkMV1SMNMvisWFODRA2rME6Cemncgi+i8MlAzStUzx9NXk4Mvoez6VOjO6M pIFcrs6MOAWJDnE5TM3xNHoNxThB58u9BVG47fgWu6LBOH6DS3P6qztDANHwMGHMPGzq zOoxTXyPnsR4zfhRSGyjedp8il3K7ew36oBaEjbSOXVsnf7CyMfJeCfgoiiqRBqVrCF4 XoCvwFw/5V62N2WzleiYSl2JZD+C64b0Mt+6rQkdkGi0LzEIIpFaa6VDDjWJiPcdp7dc AXCA== 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 s24si294282otp.86.2020.03.10.18.42.13; Tue, 10 Mar 2020 18:42:24 -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 S1727986AbgCKBlk (ORCPT + 99 others); Tue, 10 Mar 2020 21:41:40 -0400 Received: from alexa-out-sd-01.qualcomm.com ([199.106.114.38]:26769 "EHLO alexa-out-sd-01.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727960AbgCKBl0 (ORCPT ); Tue, 10 Mar 2020 21:41:26 -0400 Received: from unknown (HELO ironmsg-SD-alpha.qualcomm.com) ([10.53.140.30]) by alexa-out-sd-01.qualcomm.com with ESMTP; 10 Mar 2020 18:41:24 -0700 Received: from gurus-linux.qualcomm.com ([10.46.162.81]) by ironmsg-SD-alpha.qualcomm.com with ESMTP; 10 Mar 2020 18:41:24 -0700 Received: by gurus-linux.qualcomm.com (Postfix, from userid 383780) id 6DFB44AEB; Tue, 10 Mar 2020 18:41:24 -0700 (PDT) From: Guru Das Srinagesh To: linux-pwm@vger.kernel.org Cc: Thierry Reding , =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= , Subbaraman Narayanamurthy , linux-kernel@vger.kernel.org, Guru Das Srinagesh , Lee Jones , Daniel Thompson , Jingoo Han , Bartlomiej Zolnierkiewicz , dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org Subject: [PATCH v8 11/12] backlight: pwm_bl: Use 64-bit division function Date: Tue, 10 Mar 2020 18:41:20 -0700 Message-Id: X-Mailer: git-send-email 1.9.1 In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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