From patchwork Fri Sep 11 13:48:27 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurentiu Palcu X-Patchwork-Id: 11770679 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C0AFA746 for ; Fri, 11 Sep 2020 13:51:42 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8D5FF21D92 for ; Fri, 11 Sep 2020 13:51:42 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="XHj4tWzs"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=NXP1.onmicrosoft.com header.i=@NXP1.onmicrosoft.com header.b="ZWVmLkT7" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8D5FF21D92 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=oss.nxp.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To:From: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=QaB9h5Er24+zv/qC2vGsM9SAR4NBgXRhtfllSmDs9+w=; b=XHj4tWzsdjWpbjMPGkFuJV1HXN 87UOQ9KP5XnN3NROCvQ/QZs6ecPGxtcMQlCYSoE2Mfy9f2KQEF9NRgBNTqTH8R/X7pToJTas5SpwI 12DJkgc6eIDKLZIHjlG5PBYc646wfTL2Zx32YdzUGvui8QoRLqFo2QfsUnoRppjXJGJEy9xbi+XlI +VOnScIbpxfF78JDPnG14wmqFDx9eTk0eV3bjdt+ljfE516vVnSlc2Zp62FCFFTK+JfQGLPNi8k39 rDaE7gOeYK1Sc9bwDj2HK8m39Rx/KqUDAffQ3YMocWWv3UXczVbAJd5ZHX/WQxIPYTlkfVrKn9loO LtOlv8hg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kGjQz-00047U-MU; Fri, 11 Sep 2020 13:49:49 +0000 Received: from mail-db8eur05on2046.outbound.protection.outlook.com ([40.107.20.46] helo=EUR05-DB8-obe.outbound.protection.outlook.com) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kGjQa-0003x8-Ad for linux-arm-kernel@lists.infradead.org; Fri, 11 Sep 2020 13:49:28 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HUuwFrAFt0BXxZpZ5sAB1JfS/BbWb7Qd4xwpGyXIeBi1nmUmb/2RP+2M1oVyCXhuA/A3dr3yc1MxqXdXs12to92mXMMRJWFG0O7ie0zok3qX4d5r4lACrYNphVSzftouoCxTJNE8dH0VPgEASlHZyamDu0a7EOfbc8clm2vNWxyHYV+xlsQ+k7dm+9dUp3XLmSrwaNC1pTwRrtZuN/d0uNh3XNbsDMYK2O3EOPsjJhzWc4mxmoctYhJqQtxDQYJV91L4ZVp9csuhBpiFSgrY2tmpEWLItoCSjcpVp/tXr+Tle0jZAm7jiJf+AFHa2Vdwqrw0j1CO+mC6KI3HAbR3wQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=NXQbotspShQWj9Yr1Q+K1incV2jns7FI486mHk60Ncs=; b=lGnyukz7IbcmbUSxOcsZLyxkeqSQ3Pqb6riGunMDcJaOklaIWv8jf1qAhW1ZHknGIoWHlEYGzp1lo5dumDYWuR/I189YWowzIdHktBmC+lrZMkIb0gQ2LgTxf5TZFgWJrHeTSgiGbq76A/2dmzHpTFcG4ypZQjPD/rR98r1vkLdiE9tk/izyMZO7XTkuFeo4UlDX3XnGa+5bFwRDR2pIVmbkXUhV6myxUuFURSpav28zSm9Gw9N1pwxG8TCsu7Yjk3kdefFzjxXAlHIuM/zJgR+ndduT/i6Dk5ypEQ8WbIOq9n0bALc3GKIHeNOwRc5SE1JX/Az9JNfpN1KXnPwJoQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector2-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=NXQbotspShQWj9Yr1Q+K1incV2jns7FI486mHk60Ncs=; b=ZWVmLkT7gsA1TzFELP1r4XFb8yeLqWFhvqyD+uzog3IYJESdbNvmCYr2DN7y9O2gaW+AuYHZErv8rnWHhjkR/KHlUd88w7nczRy6ZcwYwFg3kkv1f1Ko3ruqe9i/OLdY8jZwtDTcsJwU9QBBbV7AWS3PZ7NmTYHf+XAL66m6QCg= Authentication-Results: pengutronix.de; dkim=none (message not signed) header.d=none; pengutronix.de; dmarc=none action=none header.from=oss.nxp.com; Received: from VI1PR0402MB3902.eurprd04.prod.outlook.com (2603:10a6:803:22::27) by VI1PR04MB4271.eurprd04.prod.outlook.com (2603:10a6:803:3f::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3370.17; Fri, 11 Sep 2020 13:49:13 +0000 Received: from VI1PR0402MB3902.eurprd04.prod.outlook.com ([fe80::5d66:84a7:26de:67c3]) by VI1PR0402MB3902.eurprd04.prod.outlook.com ([fe80::5d66:84a7:26de:67c3%6]) with mapi id 15.20.3370.016; Fri, 11 Sep 2020 13:49:13 +0000 From: Laurentiu Palcu To: Lucas Stach , Philipp Zabel , David Airlie , Daniel Vetter , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team Subject: [PATCH] drm/imx/dcss: fix 64-bit divisions Date: Fri, 11 Sep 2020 16:48:27 +0300 Message-Id: <20200911134827.32142-1-laurentiu.palcu@oss.nxp.com> X-Mailer: git-send-email 2.17.1 X-ClientProxiedBy: AM0PR05CA0076.eurprd05.prod.outlook.com (2603:10a6:208:136::16) To VI1PR0402MB3902.eurprd04.prod.outlook.com (2603:10a6:803:22::27) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from fsr-ub1864-141.ea.freescale.net (83.217.231.2) by AM0PR05CA0076.eurprd05.prod.outlook.com (2603:10a6:208:136::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3326.19 via Frontend Transport; Fri, 11 Sep 2020 13:49:12 +0000 X-Mailer: git-send-email 2.17.1 X-Originating-IP: [83.217.231.2] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 2c3318c1-bb20-48fe-da3e-08d85659777d X-MS-TrafficTypeDiagnostic: VI1PR04MB4271: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4125; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: +LjYTHCCte8KDtYR7OZV3i8CI+xK2fbe67knwtaAaqTlAe3VYiSdk9ApYxrGwp7eXZulHVz3Poq6CQ5lHarGVz3U/vE2FrOMJufbs85kmbSLnRNNzfVteSIy5Se+hFzq7VYKuqBBNNm1cVOHKjZm+Lahc8P/1DWDjmXLE1hCmYtYdMB7SarsIcoIUZwsTbYflMSDUjPXRMp0zSyF2mQsJlnaxB00kS7ldQJkZXgjCo4GRE4RMHIblbICDCq5DoBa4n6RPtG27LbNIKu4MuEV4TShbpknrzd2u4ANdzXTppgXlCKLR+fq0R/wu9zOPO2hC981SzOWiF+/7rfbpdiJh61Ec3VLL4MJAc6SkHtW2iY9wEkxCxBWaABvAHZGzTv4 X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR0402MB3902.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(39860400002)(376002)(136003)(396003)(346002)(6512007)(186003)(16526019)(26005)(6666004)(2616005)(44832011)(956004)(316002)(6486002)(86362001)(4326008)(8676002)(6506007)(2906002)(478600001)(7416002)(4744005)(8936002)(110136005)(66556008)(1076003)(66946007)(66476007)(5660300002)(83380400001)(52116002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: AkNuUeJHTr+pPN1eJUfsII9So7qGNZKL2V/9kCv7/BiMPgaRxNY9f1vpC5A0Ff+nQsPxndtlYG2NrJ1tobpvpGwDf0gJht/aONcL9+fL55QSGenjts8vUt7FD5JuDmO+6NtYgQYKyxcKQNxjM8ZcDdUcN1d4MfbGyxDLzsf/r2G85GszJ98ykhCNGS0D4Q9DO/NxNCpRW8TqnRQpi4V9ETydJJvkAOjiD5U+bzM7uQYsE5IGlwNAW5TpxQkIKY1XMHI31cZSTdH00sIwGY0y4ewplkYBZXr+e6uH2DPJQbpSIC5apQFaUz8uItgF2hHDhhL2R6MgdYeNeepx6UDTI1Opq2ReC++BCEWBoscCfucFRGBObAx4uLcoSNYkLSrllA68tZposqGFZxUqAMQgN/u03z5dAkFDAPls7IERW3Qa/c2ZA+KXfQCUbVgVhbh3jZBNGrt4DEwl3/fRSIJesPT189VIgUgTyjMfNeF0ViZZYv+DF8Q7Bla9o7RcS2XZ4uLJsM/sCQeoR3bp/vgsw3jx7lTP1GXLqSNZtxcg/CttqHVyhqlPeLz32RRaJ9puIez/Esv/o10AeminQ9RdHyv5ibL3R4PAMZDVdeBe3MTD4AKGu/++1eTRD03n8ye2JFN3EEMUzqHpRVua1RAlIg== X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2c3318c1-bb20-48fe-da3e-08d85659777d X-MS-Exchange-CrossTenant-AuthSource: VI1PR0402MB3902.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Sep 2020 13:49:13.2698 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: zLf+AfJ0l3zRzoWm+sy3MjZmY8m5SLh6VG7ubsCXlwrQmE/2H8uB5eRwzKidGyHva6I0CD9lggdj1X6JLGZp6g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB4271 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200911_094924_526246_1A2FAE70 X-CRM114-Status: GOOD ( 15.29 ) X-Spam-Score: -0.0 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [40.107.20.46 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [40.107.20.46 listed in wl.mailspike.net] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.0 MSGID_FROM_MTA_HEADER Message-Id was added by a relay X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, dri-devel@lists.freedesktop.org, laurentiu.palcu@oss.nxp.com Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org 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; + ll_temp = div_s64(ll_temp, sum); coef[phase][i] = (int)ll_temp; } }