Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp389616pxk; Fri, 11 Sep 2020 09:36:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxO3x+Vilmw/MZh5pOI+Jt0DF5CxeX6N8E7ByriFuM0Jy9ZKf1zXuFbumqaekBGKBchcPXT X-Received: by 2002:a17:906:48d6:: with SMTP id d22mr2897343ejt.462.1599842164638; Fri, 11 Sep 2020 09:36:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599842164; cv=none; d=google.com; s=arc-20160816; b=lVvIoEuDSb5eklaS+htZQWjgzMPvyzgxY0WHtB+i7GsQQH+yb/aUqONgHJc4Fjv9/u ESbvbMyJGsA3HphznCL3R47gcj6nSLfKujzav+eCx4LjLtbEZToBsedFk4IsiItcNc61 RFqvLO5B8vevN3/Fa+vIMxz+pv7eLyLGufrYvvsxYYhUccKA1vLGeStB5h6fxnHZynMx bgJ8DEoC1CerHovT1NcXzxA/pmaioZIIYzKg8KtoUpMFdi3/PpAPq9mrtn9caW1w1WSv hUmYaws6kkIm5/1aJUe+t0P66LE9X7VcaiT6k332eThHZ+rHAgbovGjJN6bHeW1x03LO g46g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:ironport-sdr :ironport-sdr; bh=5auu+5oSsdRhXQ6fl4b6z40YmAiO6mGiykting+jA5w=; b=sKkzCJDdclUGlw4gviao4c1b+82NYB+6eb2FYI2tzEzrdMb2WAvBqZxZovVM20Fs2B g2QYdqLrvKCpxzpd4GVX1Dc8rp0vDkJc9jL4LcJEi0OKT/W83wYbmpjcrA6xmhPQzcQu f/ly2psYErxDDlsrBuB8i2oRw/fWRwXaiPjTMqMXOCNohRDqBbjEKPAvXF6Fp9QMymlD OxeAJoQKb+f3EzvEY0sYSvqPGUAhGltxp4EDVQf4Ag03MkAjLkxqDb19uGVCalSEyGTS Cn7WffC4kOqVUYrgslsXppfcH1uCtLxH99MEbLZYvtCSg/XI2TvQVsbxGUlefocT5wXG H9jA== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id lx3si1687763ejb.306.2020.09.11.09.35.41; Fri, 11 Sep 2020 09:36:04 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725890AbgIKQcy (ORCPT + 99 others); Fri, 11 Sep 2020 12:32:54 -0400 Received: from mga18.intel.com ([134.134.136.126]:20408 "EHLO mga18.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726418AbgIKPTB (ORCPT ); Fri, 11 Sep 2020 11:19:01 -0400 IronPort-SDR: aNyfM9wNeliUF6yCC63zXsKB4ICo5WwM0rq/A/1qklXb1ap2itW5qC67FsNrLDbfnA42weh77M bous9ExZjVxQ== X-IronPort-AV: E=McAfee;i="6000,8403,9740"; a="146487813" X-IronPort-AV: E=Sophos;i="5.76,415,1592895600"; d="scan'208";a="146487813" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Sep 2020 06:56:39 -0700 IronPort-SDR: vmjohGXeCztnlk0HvpTJJd5IK/ylPkCfq+HKaYOu83Xe+UYZw4oOsfGeUHsoE/+XJ7K8FKmbE4 ANMKFfA6LC5Q== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.76,415,1592895600"; d="scan'208";a="342306628" Received: from stinkbox.fi.intel.com (HELO stinkbox) ([10.237.72.174]) by FMSMGA003.fm.intel.com with SMTP; 11 Sep 2020 06:56:34 -0700 Received: by stinkbox (sSMTP sendmail emulation); Fri, 11 Sep 2020 16:56:34 +0300 Date: Fri, 11 Sep 2020 16:56:34 +0300 From: Ville =?iso-8859-1?Q?Syrj=E4l=E4?= To: Laurentiu Palcu Cc: Lucas Stach , Philipp Zabel , David Airlie , Daniel Vetter , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, dri-devel@lists.freedesktop.org Subject: Re: [PATCH] drm/imx/dcss: fix 64-bit divisions Message-ID: <20200911135634.GI6112@intel.com> References: <20200911134827.32142-1-laurentiu.palcu@oss.nxp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20200911134827.32142-1-laurentiu.palcu@oss.nxp.com> X-Patchwork-Hint: comment User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Sep 11, 2020 at 04:48:27PM +0300, Laurentiu Palcu wrote: > Use div_s64() for the 64-bit divisions. This would allow the driver to compile > on 32-bit architectures, if needed. > > Signed-off-by: Laurentiu Palcu > --- > 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 cd21905de580..7c1e0e461244 100644 > --- a/drivers/gpu/drm/imx/dcss/dcss-scaler.c > +++ b/drivers/gpu/drm/imx/dcss/dcss-scaler.c > @@ -134,7 +134,7 @@ static int div_q(int A, int B) > else > temp -= B / 2; > > - result = (int)(temp / B); > + result = (int)(div_s64(temp, B)); > return result; > } > > @@ -237,7 +237,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; That looks like hand rolled DIV_ROUND_CLOSEST_ULL() > + ll_temp = div_s64(ll_temp, sum); > coef[phase][i] = (int)ll_temp; > } > } > -- > 2.17.1 > > _______________________________________________ > dri-devel mailing list > dri-devel@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/dri-devel -- Ville Syrj?l? Intel