aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hwmon
diff options
context:
space:
mode:
authorGuenter Roeck <linux@roeck-us.net>2013-01-10 08:54:40 -0500
committerGuenter Roeck <linux@roeck-us.net>2013-04-08 00:16:38 -0400
commit24f9c539b9b7ef8fcc97741027a31f40ef399741 (patch)
treefb3139765071ebb015436f970ee9d19880c8f7c9 /drivers/hwmon
parent692fe501da4b851cbb60edc672679ad1b41e1602 (diff)
hwmon: Fix 'Macros with complex values' checkpatch errors
Fix: ERROR: Macros with complex values should be enclosed in parenthesis when it is seen due to complex code and not due to multi-line variable declarations. Cc: Hans de Goede <hdegoede@redhat.com> Cc: Alistair John Strachan <alistair@devzero.co.uk> Acked-by: Alistair John Strachan <alistair@devzero.co.uk> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'drivers/hwmon')
-rw-r--r--drivers/hwmon/abituguru.c11
-rw-r--r--drivers/hwmon/abituguru3.c10
-rw-r--r--drivers/hwmon/gpio-fan.c2
-rw-r--r--drivers/hwmon/s3c-hwmon.c19
4 files changed, 22 insertions, 20 deletions
diff --git a/drivers/hwmon/abituguru.c b/drivers/hwmon/abituguru.c
index b84f180f210c..df0b69987914 100644
--- a/drivers/hwmon/abituguru.c
+++ b/drivers/hwmon/abituguru.c
@@ -96,9 +96,12 @@
96#define ABIT_UGURU_MAX_TIMEOUTS 2 96#define ABIT_UGURU_MAX_TIMEOUTS 2
97/* utility macros */ 97/* utility macros */
98#define ABIT_UGURU_NAME "abituguru" 98#define ABIT_UGURU_NAME "abituguru"
99#define ABIT_UGURU_DEBUG(level, format, arg...) \ 99#define ABIT_UGURU_DEBUG(level, format, arg...) \
100 if (level <= verbose) \ 100 do { \
101 pr_debug(format , ## arg) 101 if (level <= verbose) \
102 pr_debug(format , ## arg); \
103 } while (0)
104
102/* Macros to help calculate the sysfs_names array length */ 105/* Macros to help calculate the sysfs_names array length */
103/* 106/*
104 * sum of strlen of: in??_input\0, in??_{min,max}\0, in??_{min,max}_alarm\0, 107 * sum of strlen of: in??_input\0, in??_{min,max}\0, in??_{min,max}_alarm\0,
@@ -1533,7 +1536,7 @@ static int abituguru_resume(struct device *dev)
1533} 1536}
1534 1537
1535static SIMPLE_DEV_PM_OPS(abituguru_pm, abituguru_suspend, abituguru_resume); 1538static SIMPLE_DEV_PM_OPS(abituguru_pm, abituguru_suspend, abituguru_resume);
1536#define ABIT_UGURU_PM &abituguru_pm 1539#define ABIT_UGURU_PM (&abituguru_pm)
1537#else 1540#else
1538#define ABIT_UGURU_PM NULL 1541#define ABIT_UGURU_PM NULL
1539#endif /* CONFIG_PM */ 1542#endif /* CONFIG_PM */
diff --git a/drivers/hwmon/abituguru3.c b/drivers/hwmon/abituguru3.c
index dcce352e77f6..1d2da31c27c6 100644
--- a/drivers/hwmon/abituguru3.c
+++ b/drivers/hwmon/abituguru3.c
@@ -76,9 +76,11 @@
76#define ABIT_UGURU3_SYNCHRONIZE_TIMEOUT 5 76#define ABIT_UGURU3_SYNCHRONIZE_TIMEOUT 5
77/* utility macros */ 77/* utility macros */
78#define ABIT_UGURU3_NAME "abituguru3" 78#define ABIT_UGURU3_NAME "abituguru3"
79#define ABIT_UGURU3_DEBUG(format, arg...) \ 79#define ABIT_UGURU3_DEBUG(format, arg...) \
80 if (verbose) \ 80 do { \
81 pr_debug(format , ## arg) 81 if (verbose) \
82 pr_debug(format , ## arg); \
83 } while (0)
82 84
83/* Macros to help calculate the sysfs_names array length */ 85/* Macros to help calculate the sysfs_names array length */
84#define ABIT_UGURU3_MAX_NO_SENSORS 26 86#define ABIT_UGURU3_MAX_NO_SENSORS 26
@@ -1159,7 +1161,7 @@ static int abituguru3_resume(struct device *dev)
1159} 1161}
1160 1162
1161static SIMPLE_DEV_PM_OPS(abituguru3_pm, abituguru3_suspend, abituguru3_resume); 1163static SIMPLE_DEV_PM_OPS(abituguru3_pm, abituguru3_suspend, abituguru3_resume);
1162#define ABIT_UGURU3_PM &abituguru3_pm 1164#define ABIT_UGURU3_PM (&abituguru3_pm)
1163#else 1165#else
1164#define ABIT_UGURU3_PM NULL 1166#define ABIT_UGURU3_PM NULL
1165#endif /* CONFIG_PM */ 1167#endif /* CONFIG_PM */
diff --git a/drivers/hwmon/gpio-fan.c b/drivers/hwmon/gpio-fan.c
index 39781945a5d2..4e02480b456a 100644
--- a/drivers/hwmon/gpio-fan.c
+++ b/drivers/hwmon/gpio-fan.c
@@ -619,7 +619,7 @@ static int gpio_fan_resume(struct device *dev)
619} 619}
620 620
621static SIMPLE_DEV_PM_OPS(gpio_fan_pm, gpio_fan_suspend, gpio_fan_resume); 621static SIMPLE_DEV_PM_OPS(gpio_fan_pm, gpio_fan_suspend, gpio_fan_resume);
622#define GPIO_FAN_PM &gpio_fan_pm 622#define GPIO_FAN_PM (&gpio_fan_pm)
623#else 623#else
624#define GPIO_FAN_PM NULL 624#define GPIO_FAN_PM NULL
625#endif 625#endif
diff --git a/drivers/hwmon/s3c-hwmon.c b/drivers/hwmon/s3c-hwmon.c
index ff2ae0252a48..a9f7e804f1e4 100644
--- a/drivers/hwmon/s3c-hwmon.c
+++ b/drivers/hwmon/s3c-hwmon.c
@@ -107,17 +107,14 @@ static ssize_t s3c_hwmon_show_raw(struct device *dev,
107 return (ret < 0) ? ret : snprintf(buf, PAGE_SIZE, "%d\n", ret); 107 return (ret < 0) ? ret : snprintf(buf, PAGE_SIZE, "%d\n", ret);
108} 108}
109 109
110#define DEF_ADC_ATTR(x) \ 110static SENSOR_DEVICE_ATTR(adc0_raw, S_IRUGO, s3c_hwmon_show_raw, NULL, 0);
111 static SENSOR_DEVICE_ATTR(adc##x##_raw, S_IRUGO, s3c_hwmon_show_raw, NULL, x) 111static SENSOR_DEVICE_ATTR(adc1_raw, S_IRUGO, s3c_hwmon_show_raw, NULL, 1);
112 112static SENSOR_DEVICE_ATTR(adc2_raw, S_IRUGO, s3c_hwmon_show_raw, NULL, 2);
113DEF_ADC_ATTR(0); 113static SENSOR_DEVICE_ATTR(adc3_raw, S_IRUGO, s3c_hwmon_show_raw, NULL, 3);
114DEF_ADC_ATTR(1); 114static SENSOR_DEVICE_ATTR(adc4_raw, S_IRUGO, s3c_hwmon_show_raw, NULL, 4);
115DEF_ADC_ATTR(2); 115static SENSOR_DEVICE_ATTR(adc5_raw, S_IRUGO, s3c_hwmon_show_raw, NULL, 5);
116DEF_ADC_ATTR(3); 116static SENSOR_DEVICE_ATTR(adc6_raw, S_IRUGO, s3c_hwmon_show_raw, NULL, 6);
117DEF_ADC_ATTR(4); 117static SENSOR_DEVICE_ATTR(adc7_raw, S_IRUGO, s3c_hwmon_show_raw, NULL, 7);
118DEF_ADC_ATTR(5);
119DEF_ADC_ATTR(6);
120DEF_ADC_ATTR(7);
121 118
122static struct attribute *s3c_hwmon_attrs[9] = { 119static struct attribute *s3c_hwmon_attrs[9] = {
123 &sensor_dev_attr_adc0_raw.dev_attr.attr, 120 &sensor_dev_attr_adc0_raw.dev_attr.attr,