Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

RTC: replace some newly-introduced macros with inlines

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

David Brownell and committed by
Linus Torvalds
61a7c36a 7ca1d488

+35 -11
+35 -11
drivers/rtc/rtc-core.h
··· 7 7 8 8 #else 9 9 10 - #define rtc_dev_init() do{}while(0) 11 - #define rtc_dev_exit() do{}while(0) 12 - #define rtc_dev_add_device(r) do{}while(0) 13 - #define rtc_dev_del_device(r) do{}while(0) 10 + static inline void rtc_dev_init(void) 11 + { 12 + } 13 + 14 + static inline void rtc_dev_exit(void) 15 + { 16 + } 17 + 18 + static inline void rtc_dev_add_device(struct rtc_device *rtc) 19 + { 20 + } 21 + 22 + static inline void rtc_dev_del_device(struct rtc_device *rtc) 23 + { 24 + } 14 25 15 26 #endif 16 27 17 28 #ifdef CONFIG_RTC_INTF_PROC 18 29 19 - void rtc_proc_add_device(struct rtc_device *rtc); 20 - void rtc_proc_del_device(struct rtc_device *rtc); 30 + extern void rtc_proc_add_device(struct rtc_device *rtc); 31 + extern void rtc_proc_del_device(struct rtc_device *rtc); 21 32 22 33 #else 23 34 24 - #define rtc_proc_add_device(r) do{}while(0) 25 - #define rtc_proc_del_device(r) do{}while(0) 35 + static inline void rtc_proc_add_device(struct rtc_device *rtc) 36 + { 37 + } 38 + 39 + static inline void rtc_proc_del_device(struct rtc_device *rtc) 40 + { 41 + } 26 42 27 43 #endif 28 44 ··· 50 34 51 35 #else 52 36 53 - #define rtc_sysfs_init(c) do{}while(0) 54 - #define rtc_sysfs_add_device(r) do{}while(0) 55 - #define rtc_sysfs_del_device(r) do{}while(0) 37 + static inline void rtc_sysfs_init(struct class *rtc) 38 + { 39 + } 40 + 41 + static inline void rtc_sysfs_add_device(struct rtc_device *rtc) 42 + { 43 + } 44 + 45 + static inline void rtc_sysfs_del_device(struct rtc_device *rtc) 46 + { 47 + } 56 48 57 49 #endif