OMAP2+: id: avoid register read
authorGrazvydas Ignotas <notasas@gmail.com>
Sat, 28 May 2016 21:23:56 +0000 (00:23 +0300)
committerGrazvydas Ignotas <notasas@gmail.com>
Sun, 3 Jul 2016 00:23:25 +0000 (03:23 +0300)
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.

arch/arm/mach-omap2/id.c
arch/arm/plat-omap/include/plat/cpu.h

index fbede45..6f919da 100644 (file)
@@ -47,6 +47,8 @@ unsigned int omap_rev(void)
 }
 EXPORT_SYMBOL(omap_rev);
 
 }
 EXPORT_SYMBOL(omap_rev);
 
+#undef omap_type
+
 int omap_type(void)
 {
        u32 val = 0;
 int omap_type(void)
 {
        u32 val = 0;
index b22399d..152e114 100644 (file)
 #define OMAP2_DEVICE_TYPE_GP           3
 #define OMAP2_DEVICE_TYPE_BAD          4
 
 #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:
 
 /*
  * 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]
  */
  * 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
 
 /*
  * Get the CPU revision for OMAP devices