From: Grazvydas Ignotas Date: Sat, 28 May 2016 21:23:56 +0000 (+0300) Subject: OMAP2+: id: avoid register read X-Git-Tag: sz_175~6 X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?p=pandora-kernel.git;a=commitdiff_plain;h=43411e68eeb16b7df4dc3cbe816f7afa8b5fe16c OMAP2+: id: avoid register read omap_type is always known and nobody else is using this kernel. The goal is to allow the compiler to remove some code in idle path. --- diff --git a/arch/arm/mach-omap2/id.c b/arch/arm/mach-omap2/id.c index fbede45d9148..6f919da719c9 100644 --- a/arch/arm/mach-omap2/id.c +++ b/arch/arm/mach-omap2/id.c @@ -47,6 +47,8 @@ unsigned int omap_rev(void) } EXPORT_SYMBOL(omap_rev); +#undef omap_type + int omap_type(void) { u32 val = 0; diff --git a/arch/arm/plat-omap/include/plat/cpu.h b/arch/arm/plat-omap/include/plat/cpu.h index b22399df1402..152e1145d272 100644 --- a/arch/arm/plat-omap/include/plat/cpu.h +++ b/arch/arm/plat-omap/include/plat/cpu.h @@ -42,7 +42,11 @@ #define OMAP2_DEVICE_TYPE_GP 3 #define OMAP2_DEVICE_TYPE_BAD 4 -int omap_type(void); +#ifdef CONFIG_MACH_OMAP3_PANDORA +#define omap_type() OMAP2_DEVICE_TYPE_GP +#else +int __pure omap_type(void); +#endif /* * omap_rev bits: @@ -50,7 +54,7 @@ int omap_type(void); * CPU revision (See _REV_ defined in cpu.h) [15:08] * CPU class bits (15xx, 16xx, 24xx, 34xx...) [07:00] */ -unsigned int omap_rev(void); +unsigned int __pure omap_rev(void); /* * Get the CPU revision for OMAP devices