aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2014-12-25 18:07:04 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-01-26 18:57:59 -0500
commitd1f1052c520452494db548b1a701cd9020b5903e (patch)
tree258d14def96b7c45bb7f2e2572622b4cffe0b688
parenta2a15d54ab2d5c816deea306ae8e9101c40fe300 (diff)
device: Change dev_<level> logging functions to return void
No caller or macro uses the return value so make all the functions return void. Compiled x86 allyesconfig and defconfig w/o CONFIG_PRINTK Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/base/core.c29
-rw-r--r--include/linux/device.h60
2 files changed, 40 insertions, 49 deletions
diff --git a/drivers/base/core.c b/drivers/base/core.c
index 97e2baf6e5d8..07304a3b9ee2 100644
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -2080,54 +2080,47 @@ int dev_printk_emit(int level, const struct device *dev, const char *fmt, ...)
2080} 2080}
2081EXPORT_SYMBOL(dev_printk_emit); 2081EXPORT_SYMBOL(dev_printk_emit);
2082 2082
2083static int __dev_printk(const char *level, const struct device *dev, 2083static void __dev_printk(const char *level, const struct device *dev,
2084 struct va_format *vaf) 2084 struct va_format *vaf)
2085{ 2085{
2086 if (!dev) 2086 if (dev)
2087 return printk("%s(NULL device *): %pV", level, vaf); 2087 dev_printk_emit(level[1] - '0', dev, "%s %s: %pV",
2088 2088 dev_driver_string(dev), dev_name(dev), vaf);
2089 return dev_printk_emit(level[1] - '0', dev, 2089 else
2090 "%s %s: %pV", 2090 printk("%s(NULL device *): %pV", level, vaf);
2091 dev_driver_string(dev), dev_name(dev), vaf);
2092} 2091}
2093 2092
2094int dev_printk(const char *level, const struct device *dev, 2093void dev_printk(const char *level, const struct device *dev,
2095 const char *fmt, ...) 2094 const char *fmt, ...)
2096{ 2095{
2097 struct va_format vaf; 2096 struct va_format vaf;
2098 va_list args; 2097 va_list args;
2099 int r;
2100 2098
2101 va_start(args, fmt); 2099 va_start(args, fmt);
2102 2100
2103 vaf.fmt = fmt; 2101 vaf.fmt = fmt;
2104 vaf.va = &args; 2102 vaf.va = &args;
2105 2103
2106 r = __dev_printk(level, dev, &vaf); 2104 __dev_printk(level, dev, &vaf);
2107 2105
2108 va_end(args); 2106 va_end(args);
2109
2110 return r;
2111} 2107}
2112EXPORT_SYMBOL(dev_printk); 2108EXPORT_SYMBOL(dev_printk);
2113 2109
2114#define define_dev_printk_level(func, kern_level) \ 2110#define define_dev_printk_level(func, kern_level) \
2115int func(const struct device *dev, const char *fmt, ...) \ 2111void func(const struct device *dev, const char *fmt, ...) \
2116{ \ 2112{ \
2117 struct va_format vaf; \ 2113 struct va_format vaf; \
2118 va_list args; \ 2114 va_list args; \
2119 int r; \
2120 \ 2115 \
2121 va_start(args, fmt); \ 2116 va_start(args, fmt); \
2122 \ 2117 \
2123 vaf.fmt = fmt; \ 2118 vaf.fmt = fmt; \
2124 vaf.va = &args; \ 2119 vaf.va = &args; \
2125 \ 2120 \
2126 r = __dev_printk(kern_level, dev, &vaf); \ 2121 __dev_printk(kern_level, dev, &vaf); \
2127 \ 2122 \
2128 va_end(args); \ 2123 va_end(args); \
2129 \
2130 return r; \
2131} \ 2124} \
2132EXPORT_SYMBOL(func); 2125EXPORT_SYMBOL(func);
2133 2126
diff --git a/include/linux/device.h b/include/linux/device.h
index 7b2532361398..0eb8ee2dc6d1 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -1038,22 +1038,22 @@ extern __printf(3, 4)
1038int dev_printk_emit(int level, const struct device *dev, const char *fmt, ...); 1038int dev_printk_emit(int level, const struct device *dev, const char *fmt, ...);
1039 1039
1040extern __printf(3, 4) 1040extern __printf(3, 4)
1041int dev_printk(const char *level, const struct device *dev, 1041void dev_printk(const char *level, const struct device *dev,
1042 const char *fmt, ...); 1042 const char *fmt, ...);
1043extern __printf(2, 3) 1043extern __printf(2, 3)
1044int dev_emerg(const struct device *dev, const char *fmt, ...); 1044void dev_emerg(const struct device *dev, const char *fmt, ...);
1045extern __printf(2, 3) 1045extern __printf(2, 3)
1046int dev_alert(const struct device *dev, const char *fmt, ...); 1046void dev_alert(const struct device *dev, const char *fmt, ...);
1047extern __printf(2, 3) 1047extern __printf(2, 3)
1048int dev_crit(const struct device *dev, const char *fmt, ...); 1048void dev_crit(const struct device *dev, const char *fmt, ...);
1049extern __printf(2, 3) 1049extern __printf(2, 3)
1050int dev_err(const struct device *dev, const char *fmt, ...); 1050void dev_err(const struct device *dev, const char *fmt, ...);
1051extern __printf(2, 3) 1051extern __printf(2, 3)
1052int dev_warn(const struct device *dev, const char *fmt, ...); 1052void dev_warn(const struct device *dev, const char *fmt, ...);
1053extern __printf(2, 3) 1053extern __printf(2, 3)
1054int dev_notice(const struct device *dev, const char *fmt, ...); 1054void dev_notice(const struct device *dev, const char *fmt, ...);
1055extern __printf(2, 3) 1055extern __printf(2, 3)
1056int _dev_info(const struct device *dev, const char *fmt, ...); 1056void _dev_info(const struct device *dev, const char *fmt, ...);
1057 1057
1058#else 1058#else
1059 1059
@@ -1065,35 +1065,35 @@ static inline __printf(3, 4)
1065int dev_printk_emit(int level, const struct device *dev, const char *fmt, ...) 1065int dev_printk_emit(int level, const struct device *dev, const char *fmt, ...)
1066{ return 0; } 1066{ return 0; }
1067 1067
1068static inline int __dev_printk(const char *level, const struct device *dev, 1068static inline void __dev_printk(const char *level, const struct device *dev,
1069 struct va_format *vaf) 1069 struct va_format *vaf)
1070{ return 0; } 1070{}
1071static inline __printf(3, 4) 1071static inline __printf(3, 4)
1072int dev_printk(const char *level, const struct device *dev, 1072void dev_printk(const char *level, const struct device *dev,
1073 const char *fmt, ...) 1073 const char *fmt, ...)
1074{ return 0; } 1074{}
1075 1075
1076static inline __printf(2, 3) 1076static inline __printf(2, 3)
1077int dev_emerg(const struct device *dev, const char *fmt, ...) 1077void dev_emerg(const struct device *dev, const char *fmt, ...)
1078{ return 0; } 1078{}
1079static inline __printf(2, 3) 1079static inline __printf(2, 3)
1080int dev_crit(const struct device *dev, const char *fmt, ...) 1080void dev_crit(const struct device *dev, const char *fmt, ...)
1081{ return 0; } 1081{}
1082static inline __printf(2, 3) 1082static inline __printf(2, 3)
1083int dev_alert(const struct device *dev, const char *fmt, ...) 1083void dev_alert(const struct device *dev, const char *fmt, ...)
1084{ return 0; } 1084{}
1085static inline __printf(2, 3) 1085static inline __printf(2, 3)
1086int dev_err(const struct device *dev, const char *fmt, ...) 1086void dev_err(const struct device *dev, const char *fmt, ...)
1087{ return 0; } 1087{}
1088static inline __printf(2, 3) 1088static inline __printf(2, 3)
1089int dev_warn(const struct device *dev, const char *fmt, ...) 1089void dev_warn(const struct device *dev, const char *fmt, ...)
1090{ return 0; } 1090{}
1091static inline __printf(2, 3) 1091static inline __printf(2, 3)
1092int dev_notice(const struct device *dev, const char *fmt, ...) 1092void dev_notice(const struct device *dev, const char *fmt, ...)
1093{ return 0; } 1093{}
1094static inline __printf(2, 3) 1094static inline __printf(2, 3)
1095int _dev_info(const struct device *dev, const char *fmt, ...) 1095void _dev_info(const struct device *dev, const char *fmt, ...)
1096{ return 0; } 1096{}
1097 1097
1098#endif 1098#endif
1099 1099
@@ -1119,7 +1119,6 @@ do { \
1119({ \ 1119({ \
1120 if (0) \ 1120 if (0) \
1121 dev_printk(KERN_DEBUG, dev, format, ##arg); \ 1121 dev_printk(KERN_DEBUG, dev, format, ##arg); \
1122 0; \
1123}) 1122})
1124#endif 1123#endif
1125 1124
@@ -1215,7 +1214,6 @@ do { \
1215({ \ 1214({ \
1216 if (0) \ 1215 if (0) \
1217 dev_printk(KERN_DEBUG, dev, format, ##arg); \ 1216 dev_printk(KERN_DEBUG, dev, format, ##arg); \
1218 0; \
1219}) 1217})
1220#endif 1218#endif
1221 1219