dri-devel Archive mirror
 help / color / mirror / Atom feed
From: Ville Syrjala <ville.syrjala@linux.intel.com>
To: dri-devel@lists.freedesktop.org
Cc: Laurentiu Palcu <laurentiu.palcu@oss.nxp.com>,
	Lucas Stach <l.stach@pengutronix.de>
Subject: [PATCH 04/21] drm/imx/dcss: Fix 64bit divisions
Date: Mon,  8 Apr 2024 20:04:09 +0300	[thread overview]
Message-ID: <20240408170426.9285-5-ville.syrjala@linux.intel.com> (raw)
In-Reply-To: <20240408170426.9285-1-ville.syrjala@linux.intel.com>

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

Use the appropriate 64bit division helpers to make the code
build on 32bit architectures.

Cc: Laurentiu Palcu <laurentiu.palcu@oss.nxp.com>
Cc: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/imx/dcss/dcss-scaler.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/imx/dcss/dcss-scaler.c b/drivers/gpu/drm/imx/dcss/dcss-scaler.c
index 825728c356ff..32c3f46b21da 100644
--- a/drivers/gpu/drm/imx/dcss/dcss-scaler.c
+++ b/drivers/gpu/drm/imx/dcss/dcss-scaler.c
@@ -136,7 +136,7 @@ static int div_q(int A, int B)
 	else
 		temp -= B / 2;
 
-	result = (int)(temp / B);
+	result = div_s64(temp, B);
 	return result;
 }
 
@@ -239,7 +239,7 @@ static void dcss_scaler_gaussian_filter(int fc_q, bool use_5_taps,
 			ll_temp = coef[phase][i];
 			ll_temp <<= PSC_COEFF_PRECISION;
 			ll_temp += sum >> 1;
-			ll_temp /= sum;
+			ll_temp = div_s64(ll_temp, sum);
 			coef[phase][i] = (int)ll_temp;
 		}
 	}
-- 
2.43.2


  parent reply	other threads:[~2024-04-08 17:04 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-08 17:04 [PATCH 00/21] drm: Increase COMPILE_TEST=y coverage Ville Syrjala
2024-04-08 17:04 ` [PATCH 01/21] drm/armada: Fix printk arguments Ville Syrjala
2024-04-08 17:04 ` [PATCH 02/21] drm/armada: Fix armada_debugfs_crtc_reg_write() return type Ville Syrjala
2024-04-08 17:04 ` [PATCH 03/21] drm/armada: Allow build with COMPILE_TEST=y Ville Syrjala
2024-04-08 17:04 ` Ville Syrjala [this message]
2024-04-08 17:04 ` [PATCH 05/21] drm/imx/dcss: " Ville Syrjala
2024-04-08 17:04 ` [PATCH 06/21] drm/sti: Include linux/io.h for devm_ioremap() Ville Syrjala
2024-05-27 15:28   ` Alain Volmat
2024-04-08 17:04 ` [PATCH 07/21] drm/sti: Allow build with COMPILE_TEST=y Ville Syrjala
2024-05-27 15:29   ` Alain Volmat
2024-05-28 19:45     ` Ville Syrjälä
2024-04-08 17:04 ` [PATCH 08/21] drm/hisilicon/kirin: Include linux/io.h for readl()/writel() Ville Syrjala
2024-04-08 17:08   ` John Stultz
2024-04-08 17:04 ` [PATCH 09/21] drm/hisilicon/kirin: Fix 64bit divisions Ville Syrjala
2024-04-08 17:09   ` John Stultz
2024-04-08 17:04 ` [PATCH 10/21] drm/hisilicon/kirin: Fix MASK(32) on 32bit architectures Ville Syrjala
2024-04-08 17:09   ` John Stultz
2024-04-08 17:04 ` [PATCH 11/21] drm/hisilicon/kirin: Allow build with COMPILE_TEST=y Ville Syrjala
2024-04-08 17:11   ` John Stultz
2024-04-08 17:04 ` [PATCH 12/21] drm/tilcdc: Allow build without __iowmb() Ville Syrjala
2024-04-10  9:06   ` Tomi Valkeinen
2024-04-10 15:25     ` Ville Syrjälä
2024-04-10 15:47       ` Tomi Valkeinen
2024-04-10 17:04       ` Ville Syrjälä
2024-04-10 17:12         ` Tomi Valkeinen
2024-04-11 13:40       ` jyri.sarha
2024-04-08 17:04 ` [PATCH 13/21] drm/tilcdc: Allow build with COMPILE_TEST=y Ville Syrjala
2024-04-10  9:06   ` Tomi Valkeinen
2024-04-08 17:04 ` [PATCH 14/21] drm/omap: Open code phys_to_page() Ville Syrjala
2024-04-10  9:14   ` Tomi Valkeinen
2024-04-08 17:04 ` [PATCH 15/21] drm/omap: Allow build with COMPILE_TEST=y Ville Syrjala
2024-04-08 17:12   ` Ville Syrjälä
2024-04-10  9:15   ` Tomi Valkeinen
2024-04-08 17:04 ` [PATCH 16/21] drm/atmel-hlcdc: " Ville Syrjala
2024-04-09 16:55   ` Sam Ravnborg
2024-04-08 17:04 ` [PATCH 17/21] drm/fsl-dcu: " Ville Syrjala
2024-04-08 17:04 ` [PATCH 18/21] drm/mediatek: " Ville Syrjala
2024-04-08 17:04 ` [PATCH 19/21] drm/meson: " Ville Syrjala
2024-04-08 17:23   ` Martin Blumenstingl
2024-04-08 17:04 ` [PATCH 20/21] drm/rcar-du: " Ville Syrjala
2024-04-09  7:26   ` Geert Uytterhoeven
2024-04-10 22:36   ` Laurent Pinchart
2024-04-08 17:04 ` [PATCH 21/21] drm/stm: " Ville Syrjala
2024-04-10 12:15   ` Raphael Gallais-Pou
2024-04-10  6:07 ` [PATCH 12/21] drm/tilcdc: Allow build without __iowmb() sarha
2024-04-10  6:07 ` [PATCH 13/21] drm/tilcdc: Allow build with COMPILE_TEST=y sarha
2024-05-08 19:40 ` [PATCH 00/21] drm: Increase COMPILE_TEST=y coverage Ville Syrjälä

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240408170426.9285-5-ville.syrjala@linux.intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=l.stach@pengutronix.de \
    --cc=laurentiu.palcu@oss.nxp.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).