diff options
Diffstat (limited to 'include/linux/device.h')
-rw-r--r-- | include/linux/device.h | 110 |
1 files changed, 51 insertions, 59 deletions
diff --git a/include/linux/device.h b/include/linux/device.h index 8ff7dc801fd5..ffbcf95cd97d 100644 --- a/include/linux/device.h +++ b/include/linux/device.h | |||
@@ -623,8 +623,8 @@ static inline const char *dev_name(const struct device *dev) | |||
623 | return kobject_name(&dev->kobj); | 623 | return kobject_name(&dev->kobj); |
624 | } | 624 | } |
625 | 625 | ||
626 | extern int dev_set_name(struct device *dev, const char *name, ...) | 626 | extern __printf(2, 3) |
627 | __attribute__((format(printf, 2, 3))); | 627 | int dev_set_name(struct device *dev, const char *name, ...); |
628 | 628 | ||
629 | #ifdef CONFIG_NUMA | 629 | #ifdef CONFIG_NUMA |
630 | static inline int dev_to_node(struct device *dev) | 630 | static inline int dev_to_node(struct device *dev) |
@@ -758,10 +758,10 @@ extern struct device *device_create_vargs(struct class *cls, | |||
758 | void *drvdata, | 758 | void *drvdata, |
759 | const char *fmt, | 759 | const char *fmt, |
760 | va_list vargs); | 760 | va_list vargs); |
761 | extern struct device *device_create(struct class *cls, struct device *parent, | 761 | extern __printf(5, 6) |
762 | dev_t devt, void *drvdata, | 762 | struct device *device_create(struct class *cls, struct device *parent, |
763 | const char *fmt, ...) | 763 | dev_t devt, void *drvdata, |
764 | __attribute__((format(printf, 5, 6))); | 764 | const char *fmt, ...); |
765 | extern void device_destroy(struct class *cls, dev_t devt); | 765 | extern void device_destroy(struct class *cls, dev_t devt); |
766 | 766 | ||
767 | /* | 767 | /* |
@@ -805,64 +805,56 @@ extern const char *dev_driver_string(const struct device *dev); | |||
805 | 805 | ||
806 | extern int __dev_printk(const char *level, const struct device *dev, | 806 | extern int __dev_printk(const char *level, const struct device *dev, |
807 | struct va_format *vaf); | 807 | struct va_format *vaf); |
808 | extern int dev_printk(const char *level, const struct device *dev, | 808 | extern __printf(3, 4) |
809 | const char *fmt, ...) | 809 | int dev_printk(const char *level, const struct device *dev, |
810 | __attribute__ ((format (printf, 3, 4))); | 810 | const char *fmt, ...) |
811 | extern int dev_emerg(const struct device *dev, const char *fmt, ...) | 811 | ; |
812 | __attribute__ ((format (printf, 2, 3))); | 812 | extern __printf(2, 3) |
813 | extern int dev_alert(const struct device *dev, const char *fmt, ...) | 813 | int dev_emerg(const struct device *dev, const char *fmt, ...); |
814 | __attribute__ ((format (printf, 2, 3))); | 814 | extern __printf(2, 3) |
815 | extern int dev_crit(const struct device *dev, const char *fmt, ...) | 815 | int dev_alert(const struct device *dev, const char *fmt, ...); |
816 | __attribute__ ((format (printf, 2, 3))); | 816 | extern __printf(2, 3) |
817 | extern int dev_err(const struct device *dev, const char *fmt, ...) | 817 | int dev_crit(const struct device *dev, const char *fmt, ...); |
818 | __attribute__ ((format (printf, 2, 3))); | 818 | extern __printf(2, 3) |
819 | extern int dev_warn(const struct device *dev, const char *fmt, ...) | 819 | int dev_err(const struct device *dev, const char *fmt, ...); |
820 | __attribute__ ((format (printf, 2, 3))); | 820 | extern __printf(2, 3) |
821 | extern int dev_notice(const struct device *dev, const char *fmt, ...) | 821 | int dev_warn(const struct device *dev, const char *fmt, ...); |
822 | __attribute__ ((format (printf, 2, 3))); | 822 | extern __printf(2, 3) |
823 | extern int _dev_info(const struct device *dev, const char *fmt, ...) | 823 | int dev_notice(const struct device *dev, const char *fmt, ...); |
824 | __attribute__ ((format (printf, 2, 3))); | 824 | extern __printf(2, 3) |
825 | int _dev_info(const struct device *dev, const char *fmt, ...); | ||
825 | 826 | ||
826 | #else | 827 | #else |
827 | 828 | ||
828 | static inline int __dev_printk(const char *level, const struct device *dev, | 829 | static inline int __dev_printk(const char *level, const struct device *dev, |
829 | struct va_format *vaf) | 830 | struct va_format *vaf) |
830 | { return 0; } | 831 | { return 0; } |
831 | static inline int dev_printk(const char *level, const struct device *dev, | 832 | static inline __printf(3, 4) |
832 | const char *fmt, ...) | 833 | int dev_printk(const char *level, const struct device *dev, |
833 | __attribute__ ((format (printf, 3, 4))); | 834 | const char *fmt, ...) |
834 | static inline int dev_printk(const char *level, const struct device *dev, | 835 | { return 0; } |
835 | const char *fmt, ...) | 836 | |
836 | { return 0; } | 837 | static inline __printf(2, 3) |
837 | 838 | int dev_emerg(const struct device *dev, const char *fmt, ...) | |
838 | static inline int dev_emerg(const struct device *dev, const char *fmt, ...) | 839 | { return 0; } |
839 | __attribute__ ((format (printf, 2, 3))); | 840 | static inline __printf(2, 3) |
840 | static inline int dev_emerg(const struct device *dev, const char *fmt, ...) | 841 | int dev_crit(const struct device *dev, const char *fmt, ...) |
841 | { return 0; } | 842 | { return 0; } |
842 | static inline int dev_crit(const struct device *dev, const char *fmt, ...) | 843 | static inline __printf(2, 3) |
843 | __attribute__ ((format (printf, 2, 3))); | 844 | int dev_alert(const struct device *dev, const char *fmt, ...) |
844 | static inline int dev_crit(const struct device *dev, const char *fmt, ...) | 845 | { return 0; } |
845 | { return 0; } | 846 | static inline __printf(2, 3) |
846 | static inline int dev_alert(const struct device *dev, const char *fmt, ...) | 847 | int dev_err(const struct device *dev, const char *fmt, ...) |
847 | __attribute__ ((format (printf, 2, 3))); | 848 | { return 0; } |
848 | static inline int dev_alert(const struct device *dev, const char *fmt, ...) | 849 | static inline __printf(2, 3) |
849 | { return 0; } | 850 | int dev_warn(const struct device *dev, const char *fmt, ...) |
850 | static inline int dev_err(const struct device *dev, const char *fmt, ...) | 851 | { return 0; } |
851 | __attribute__ ((format (printf, 2, 3))); | 852 | static inline __printf(2, 3) |
852 | static inline int dev_err(const struct device *dev, const char *fmt, ...) | 853 | int dev_notice(const struct device *dev, const char *fmt, ...) |
853 | { return 0; } | 854 | { return 0; } |
854 | static inline int dev_warn(const struct device *dev, const char *fmt, ...) | 855 | static inline __printf(2, 3) |
855 | __attribute__ ((format (printf, 2, 3))); | 856 | int _dev_info(const struct device *dev, const char *fmt, ...) |
856 | static inline int dev_warn(const struct device *dev, const char *fmt, ...) | 857 | { return 0; } |
857 | { return 0; } | ||
858 | static inline int dev_notice(const struct device *dev, const char *fmt, ...) | ||
859 | __attribute__ ((format (printf, 2, 3))); | ||
860 | static inline int dev_notice(const struct device *dev, const char *fmt, ...) | ||
861 | { return 0; } | ||
862 | static inline int _dev_info(const struct device *dev, const char *fmt, ...) | ||
863 | __attribute__ ((format (printf, 2, 3))); | ||
864 | static inline int _dev_info(const struct device *dev, const char *fmt, ...) | ||
865 | { return 0; } | ||
866 | 858 | ||
867 | #endif | 859 | #endif |
868 | 860 | ||