#define _ASM_POWERPC_MACHDEP_H
 #ifdef __KERNEL__
 
+#include <linux/compiler.h>
 #include <linux/seq_file.h>
 #include <linux/init.h>
 #include <linux/dma-mapping.h>
        EXPORT_SYMBOL(mach_##name);                             \
        struct machdep_calls mach_##name __machine_desc =
 
-#define machine_is(name) \
-       ({ \
-               extern struct machdep_calls mach_##name \
-                       __attribute__((weak));           \
-               machine_id == &mach_##name; \
+static inline bool __machine_is(const struct machdep_calls *md)
+{
+       WARN_ON(!machine_id); // complain if used before probe_machine()
+       return machine_id == md;
+}
+
+#define machine_is(name)                                        \
+       ({                                                      \
+               extern struct machdep_calls mach_##name __weak; \
+               __machine_is(&mach_##name);                     \
        })
 
 static inline void log_error(char *buf, unsigned int err_type, int fatal)