Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp155543ybb; Thu, 19 Mar 2020 18:42:25 -0700 (PDT) X-Google-Smtp-Source: ADFU+vu4l/4gK+AtpODoRz3vys+St9MG8uEAE7jPd/2F4T6f5rriEPpFXgqtU+zH91AnJscnDA/m X-Received: by 2002:aca:6184:: with SMTP id v126mr119708oib.168.1584668544989; Thu, 19 Mar 2020 18:42:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584668544; cv=none; d=google.com; s=arc-20160816; b=LY56i/vbeK7wfw9wrZqv8FQg/tYIRTPu9QQPsR5u17YoXV8M6yIj2Y2YpjzbY9WMNK oWKl96upX6ih4l+jE7Eqj1QGNz8gEdS6Rv4XO77YhNQC4i3hKAAALd09oG6MP8sGepbb VWSjO+9sFZk0dVyZJkBtXT1+biKIpauoHrf3nUrD7hZOcYzyZeRWPoofaqDzr2eAdPNq lQM4x/CaUWCEhVX6R/8se6feb0Cnime4kKqkzNz5ATZ/lZCBi7OA3o5mCQnZsGJ0V1yA 9OR5VZe9Bnfhfb5r5vJs0lDF6h9ufdiez3ee4HDmJGkhkjuY85wB5Jxx9+Stgd0pKz+z YQkw== 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=+xGnUvwsrdMaTGiUgjd5T+nNKWck7mCPtNiytUPmLqY=; b=sU9KtSTVnk+7TcUb3LAaifCvxLF++0YsF6fAGA6aTfEeF5P0knVQTBsX2EJdY46geN B5Mw5IfCRB4pllFqsPLE7A4ztWWK8j4LUWIEjx4rIeHEIKH18avPnOabrqaeiXjFSF/N 3pIMa8kviv3zyhq93XHbXxZHqbeHPl0OiH/mpoy9Oo3RurMRJ8HchiFIzKP48I8l7JTV /ETeOkUOLn35U2r9SyszfuoMLOIKmU1w5yXHP3pGd/3fd4pOhToNl5zhHEcxmqcUG6pf 82zF62wFQ9KcAxXcvtmbqly6Co2hV1qP/dkaLEtRzB3esGrJMzzEAdYOTK2QlKqvpDg7 fpGA== 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 d27si2094151otf.22.2020.03.19.18.42.12; Thu, 19 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 S1727608AbgCTBlk (ORCPT + 99 others); Thu, 19 Mar 2020 21:41:40 -0400 Received: from alexa-out-sd-01.qualcomm.com ([199.106.114.38]:61073 "EHLO alexa-out-sd-01.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727509AbgCTBlc (ORCPT ); Thu, 19 Mar 2020 21:41:32 -0400 Received: from unknown (HELO ironmsg04-sd.qualcomm.com) ([10.53.140.144]) by alexa-out-sd-01.qualcomm.com with ESMTP; 19 Mar 2020 18:41:26 -0700 Received: from gurus-linux.qualcomm.com ([10.46.162.81]) by ironmsg04-sd.qualcomm.com with ESMTP; 19 Mar 2020 18:41:26 -0700 Received: by gurus-linux.qualcomm.com (Postfix, from userid 383780) id 048F04559; Thu, 19 Mar 2020 18:41:25 -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 v11 10/12] backlight: pwm_bl: Use 64-bit division function Date: Thu, 19 Mar 2020 18:41:21 -0700 Message-Id: <17fc1dcf8b9b392d1e37dc7e3e67409e3c502840.1584667964.git.gurus@codeaurora.org> 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 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