From patchwork Wed Jan 3 22:35:31 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 123357 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp10720380qgn; Wed, 3 Jan 2018 14:36:07 -0800 (PST) X-Google-Smtp-Source: ACJfBouA1ECsL850Wj8TgCvQkDkYZNQK0VrlkyF6E4QnOuU9z19Tkzxq3zxaFdAlr4cFJ4GLp483 X-Received: by 10.98.201.29 with SMTP id k29mr2788893pfg.27.1515018967700; Wed, 03 Jan 2018 14:36:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1515018967; cv=none; d=google.com; s=arc-20160816; b=oV36tBEYGSm3jMZGvqSWVI4XyjDUUs/N3nLPf9dG6usPnLHPuziR/QEik3+7lbRmBj agFtysOq2QkFLoKQsfCqk2OYwKYEy4U7XdXrY2FJIaytdgp2pRwg7EJqi98cOvhrlEtl 60d33P92oel1t7DP2IacGzcfLbK7MMiqdUGucEju9RmlGUS30o9E3r0bu1yOYGJW4z48 uBzD7FvljHcy5lqC8gbKp/FTpT1oBqDJ8vv8i1h8kpWit/kSYJ6/rdoi+FTO6gY8NvHn KdwoAMhJtbY1QLDlTF7wfe85i+Crtg7N4fdAl+pJoSIMtK7UC7QMekfKOPV0kEwZ2A4R cC0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=BBAOpVOxHPJLF8xdCEaP51dzdxuzkgp9t6nPj8AV+Y0=; b=AIF9jxmpS/oxcroo5WO3MgBxyawmTEzn5pMHtJF1tAXBV7JJAJPxJRSKkxWd/uxp2l 1ioTwxU8eOzNlY4VaJ8k26os7z607jmc9FGPJ0kXtINngQVJ2uwrL29WYDoIdRjpP96w XoWWenhtoXZePMqAp4g2RcqEcHMvPQndOeDzYcchQthso068jKKKyrJ7ISirH5BgkD77 Z9a9YV7iCkyGdA1nurakwmG2PymWajc6HPB2uk9WE+yEQgf2QgJ3TEmWZuqOgGj6bL0b wgKCZ44Zat31AwAAUbj2r5BejxP5I2eSLAho6DY6KY9R829SyhfRYWhVWnYUayPCLlMB 3PFA== 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 44si1313544plc.40.2018.01.03.14.36.07; Wed, 03 Jan 2018 14:36:07 -0800 (PST) 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 S1751382AbeACWgE (ORCPT + 28 others); Wed, 3 Jan 2018 17:36:04 -0500 Received: from mout.kundenserver.de ([212.227.126.135]:55846 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751014AbeACWgC (ORCPT ); Wed, 3 Jan 2018 17:36:02 -0500 Received: from wuerfel.lan ([95.208.111.237]) by mrelayeu.kundenserver.de (mreue003 [212.227.15.129]) with ESMTPA (Nemesis) id 0LfFYi-1fHCtI40im-00omk0; Wed, 03 Jan 2018 23:35:49 +0100 From: Arnd Bergmann To: Yong Zhi , Sakari Ailus , Mauro Carvalho Chehab Cc: Arnd Bergmann , Rajmohan Mani , Hyungwoo Yang , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] media: intel-ipu3: cio2: fix building with large PAGE_SIZE Date: Wed, 3 Jan 2018 23:35:31 +0100 Message-Id: <20180103223546.3546694-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K0:1WpbsZ2r0V0oMm2O6y+pbRNN2CcJhZ44KRfjk/WHKLQTWVa0fo7 KR9ony3FEf+eN5lqmXYUMjwhpom/Mc+fr7AYZ1R6n/Ts219BH51t8Zvh3IjpNs5cr7bfSem ExkHxc33l/4OQPC0rKVDChk3pp/0kmltVQuThlEtbai/Q3VMo4ELQBxBrum9sLCWXudD4hY txNlYbZ8U55xr899BNhuQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:RzO/ApJGSvc=:+2kUZMW5oYfC3DWywJ2d2L lcJ32tyRqhY6pAugRpEXknNmPJ1mErKDkTAQpi5C26VMfeNPzjynCbPWUSUMQ+S2J8272V5yy G3+I22n5r8kw3V9QcrRrQOWaTFht7YZA/MKm61BnrIKqg18IClaopz1KpLq32q8gKCMt7r3U0 tUbcw1IeweazEDKGvlLZU51PQh5umT8nfpLul1hU/LkjLkYRR7taH664+Aml0HfK5sebtZ9Jy 5ohqtV6IOJVj0Ze4O+saPHrBNWdB8wEytmJyLPmntANO4bvEmdU6wgTUy0T39ITr2yfy6TG5D i2rAFT4tiyzIKN8y1yR55FIq1O9u2gbqcStXlxSz3mRwSwLS7hjj8zZ5rs+Q0dGtLUKIOp4sI QrGueVALUbXcwfWI8nbO4OZxUnVw2ET/n3HEzpBS+GVig+hvZa7DcNA+xQYxDi2j7Z+V9Kd5J aYAHT9QCWgzePz8uzQcoGu2/UBZF6pvHOaZe1Z9cuekplkUiYyE8eH4TYS9ar6p8aP+pLfmCL k7odddg3oduDolATUjv5U2lyLnE8QMLQ3AIn/VV2d1n65aqO4xEcB1CNj0+r7IPvmtiN4UaUe JdYLoAUpfLya4mRrVrggTejR2RDM1t8g/tezMCbRqvB9WCUCRYpAbJoy9A3GQzshqumFSkXzZ M2oZ09Pxwh97iSJ2ONz+SdvAzEE59edJ0FTwEftK11OH1nxxk2guDg2HjJ8+D7n+lOGS4DJPF zFVGXyKklDc89EVONNptJHzEMaqxNcn/oXihhuEBiJWWGlSj90I1hZsaM8k= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The driver apparently assumes that the device uses the same page size as the CPU, but also assumes that this is 4096 bytes. On architectures with a larger page size like 65536 bytes, we get a warning about an integer overflow: drivers/media/pci/intel/ipu3/ipu3-cio2.c: In function 'cio2_fbpt_entry_init_dummy': arch/arm64/include/asm/page-def.h:28:20: error: large integer implicitly truncated to unsigned type [-Werror=overflow] #define PAGE_SIZE (_AC(1, UL) << PAGE_SHIFT) ^ drivers/media/pci/intel/ipu3/ipu3-cio2.h:404:26: note: in expansion of macro 'PAGE_SIZE' #define CIO2_PAGE_SIZE PAGE_SIZE ^~~~~~~~~ drivers/media/pci/intel/ipu3/ipu3-cio2.c:172:3: note: in expansion of macro 'CIO2_PAGE_SIZE' CIO2_PAGE_SIZE / sizeof(u32) * CIO2_MAX_LOPS; Obviously this won't work, but the driver is also unlikely to ever be used on such an architecture, so the easiest workaround is to define the CIO2_PAGE_SIZE macro to the size that the hardware actually uses. Fixes: c2a6a07afe4a ("media: intel-ipu3: cio2: add new MIPI-CSI2 driver") Signed-off-by: Arnd Bergmann --- drivers/media/pci/intel/ipu3/ipu3-cio2.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.9.0 diff --git a/drivers/media/pci/intel/ipu3/ipu3-cio2.h b/drivers/media/pci/intel/ipu3/ipu3-cio2.h index 1a559990920f..78a5799f08e7 100644 --- a/drivers/media/pci/intel/ipu3/ipu3-cio2.h +++ b/drivers/media/pci/intel/ipu3/ipu3-cio2.h @@ -401,7 +401,7 @@ struct cio2_device { sizeof(struct cio2_fbpt_entry)) #define CIO2_FBPT_SUBENTRY_UNIT 4 -#define CIO2_PAGE_SIZE PAGE_SIZE +#define CIO2_PAGE_SIZE 4096 /* cio2 fbpt first_entry ctrl status */ #define CIO2_FBPT_CTRL_VALID BIT(0)