From patchwork Thu Feb 25 17:42:58 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Suzuki K Poulose X-Patchwork-Id: 588238 Return-Path: X-Original-To: incoming-imx@patchwork.ozlabs.org Delivered-To: patchwork-incoming-imx@bilbo.ozlabs.org Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2001:1868:205::9]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 05A801402A1 for ; Fri, 26 Feb 2016 04:45:24 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1aYzww-0000e4-AH; Thu, 25 Feb 2016 17:43:38 +0000 Received: from foss.arm.com ([217.140.101.70]) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1aYzwr-0000Y5-MJ for linux-arm-kernel@lists.infradead.org; Thu, 25 Feb 2016 17:43:35 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id D649B49; Thu, 25 Feb 2016 09:42:18 -0800 (PST) Received: from e106634-lin.cambridge.arm.com (e106634-lin.cambridge.arm.com [10.1.209.25]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 9FB9B3F25E; Thu, 25 Feb 2016 09:43:10 -0800 (PST) From: Suzuki K Poulose To: linux@arm.linux.org.uk Subject: [PATCH] arm: fixmap: Annotate page flags with pgprot Date: Thu, 25 Feb 2016 17:42:58 +0000 Message-Id: <1456422178-1371-1-git-send-email-suzuki.poulose@arm.com> X-Mailer: git-send-email 1.7.9.5 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160225_094333_752148_663A9E20 X-CRM114-Status: UNSURE ( 9.95 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-1.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Arnd Bergmann , Ard Biesheuvel , Suzuki K Poulose , linux-kernel@vger.kernel.org, Stefan Agner , Russell King , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org List-Id: linux-imx-kernel.lists.patchwork.ozlabs.org With STRICT_MM_TYPECHECKS, the kernel build fails like : CC mm/early_ioremap.o mm/early_ioremap.c: In function ‘early_ioremap’: mm/early_ioremap.c:211:2: error: incompatible type for argument 3 of ‘__early_ioremap’ mm/early_ioremap.c:98:1: note: expected ‘pgprot_t’ but argument is of type ‘long long unsigned int’ mm/early_ioremap.c: In function ‘early_memremap’: mm/early_ioremap.c:219:13: error: incompatible type for argument 3 of ‘__early_ioremap’ mm/early_ioremap.c:98:1: note: expected ‘pgprot_t’ but argument is of type ‘long long unsigned int’ mm/early_ioremap.c: In function ‘early_memremap_ro’: mm/early_ioremap.c:225:2: error: incompatible type for argument 3 of ‘__early_ioremap’ mm/early_ioremap.c:98:1: note: expected ‘pgprot_t’ but argument is of type ‘long long unsigned int’ mm/early_ioremap.c:226:1: warning: control reaches end of non-void function [-Wreturn-type] mm/early_ioremap.c: In function ‘early_memremap’: mm/early_ioremap.c:220:1: warning: control reaches end of non-void function [-Wreturn-type] mm/early_ioremap.c: In function ‘early_ioremap’: mm/early_ioremap.c:212:1: warning: control reaches end of non-void function [-Wreturn-type] make[1]: *** [mm/early_ioremap.o] Error 1 make: *** [mm] Error 2 make: *** Waiting for unfinished jobs.... CC arch/arm/mm/mmu.o CC arch/arm/kernel/patch.o arch/arm/kernel/patch.c: In function ‘patch_map’: arch/arm/kernel/patch.c:39:2: error: incompatible type for argument 3 of ‘__set_fixmap’ ./arch/arm/include/asm/fixmap.h:55:6: note: expected ‘pgprot_t’ but argument is of type ‘long long unsigned int’ make[1]: *** [arch/arm/kernel/patch.o] Error 1 Fixes Commit a5f4c561b ("ARM: 8415/1: early fixmap support for earlycon"). Annotate the page flags properly using __pgprot. Cc: Stefan Agner Cc: Arnd Bergmann Cc: Ard Biesheuvel Cc: Rob Herring Cc: Russell King Cc: stable@vger.kernel.org # v4.3+ Signed-off-by: Suzuki K Poulose Acked-by: Stefan Agner --- arch/arm/include/asm/fixmap.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/arm/include/asm/fixmap.h b/arch/arm/include/asm/fixmap.h index 5c17d2d..8d48d5a 100644 --- a/arch/arm/include/asm/fixmap.h +++ b/arch/arm/include/asm/fixmap.h @@ -39,13 +39,13 @@ static const enum fixed_addresses __end_of_fixed_addresses = __end_of_fixmap_region > __end_of_early_ioremap_region ? __end_of_fixmap_region : __end_of_early_ioremap_region; -#define FIXMAP_PAGE_COMMON (L_PTE_YOUNG | L_PTE_PRESENT | L_PTE_XN | L_PTE_DIRTY) +#define FIXMAP_PAGE_COMMON __pgprot(L_PTE_YOUNG | L_PTE_PRESENT | L_PTE_XN | L_PTE_DIRTY) -#define FIXMAP_PAGE_NORMAL (FIXMAP_PAGE_COMMON | L_PTE_MT_WRITEBACK) -#define FIXMAP_PAGE_RO (FIXMAP_PAGE_NORMAL | L_PTE_RDONLY) +#define FIXMAP_PAGE_NORMAL __pgprot(pgprot_val(FIXMAP_PAGE_COMMON) | L_PTE_MT_WRITEBACK) +#define FIXMAP_PAGE_RO __pgprot(pgprot_val(FIXMAP_PAGE_NORMAL) | L_PTE_RDONLY) /* Used by set_fixmap_(io|nocache), both meant for mapping a device */ -#define FIXMAP_PAGE_IO (FIXMAP_PAGE_COMMON | L_PTE_MT_DEV_SHARED | L_PTE_SHARED) +#define FIXMAP_PAGE_IO __pgprot(pgprot_val(FIXMAP_PAGE_COMMON) | L_PTE_MT_DEV_SHARED | L_PTE_SHARED) #define FIXMAP_PAGE_NOCACHE FIXMAP_PAGE_IO #define __early_set_fixmap __set_fixmap