backports: improve SIMPLE_DEV_PM_OPS macro
authorJohannes Berg <johannes.berg@intel.com>
Sat, 13 Apr 2013 13:17:30 +0000 (15:17 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Mon, 15 Apr 2013 09:32:48 +0000 (11:32 +0200)
To avoid warnings on old kernels, improve the macro
and give it some content rather than nothing.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
backport/backport-include/linux/pm.h

index a78477cfda38ce71cf55117d4dc3c94e4b8a5897..70f3a218f7db814dabe10473da8f215ccadeed2b 100644 (file)
@@ -51,7 +51,10 @@ struct dev_pm_ops name = { \
        .restore = resume_fn, \
 }
 #else
-#define SIMPLE_DEV_PM_OPS(name, suspend_fn, resume_fn)
+#define ___BACKPORT_PASTE(a, b) a##b
+#define __BACKPORT_PASTE(a, b) ___BACKPORT_PASTE(a,b)
+#define SIMPLE_DEV_PM_OPS(name, suspend_fn, resume_fn) \
+       struct {} __maybe_unused __BACKPORT_PASTE(__backport_avoid_warning_, __LINE__)
 #endif /* >= 2.6.29 */
 #endif /* < 2.6.32 */