MIPS: Loongson: Cleanup cpu_hwmon.c
authorTiezhu Yang <yangtiezhu@loongson.cn>
Thu, 9 Jul 2020 03:55:19 +0000 (11:55 +0800)
committerThomas Bogendoerfer <tsbogend@alpha.franken.de>
Thu, 16 Jul 2020 08:49:19 +0000 (10:49 +0200)
commitf17d3f218d8639ea6195ce2c027f2bd83ed12e30
tree4a58907ab2027d1cc31146d039ac790ac299fa54
parent7a98c066e9094963220760d211f5008eacf878c1
MIPS: Loongson: Cleanup cpu_hwmon.c

Fix the following checkpatch warnings and errors:

ERROR: do not initialise statics to 0
+static int csr_temp_enable = 0;

WARNING: Symbolic permissions 'S_IRUGO' are not preferred. Consider using octal permissions '0444'.
+static SENSOR_DEVICE_ATTR(name, S_IRUGO, get_hwmon_name, NULL, 0);

WARNING: Symbolic permissions 'S_IRUGO' are not preferred. Consider using octal permissions '0444'.
+static SENSOR_DEVICE_ATTR(temp1_input, S_IRUGO, get_cpu_temp, NULL, 1);

WARNING: Symbolic permissions 'S_IRUGO' are not preferred. Consider using octal permissions '0444'.
+static SENSOR_DEVICE_ATTR(temp1_label, S_IRUGO, cpu_temp_label, NULL, 1);

WARNING: Symbolic permissions 'S_IRUGO' are not preferred. Consider using octal permissions '0444'.
+static SENSOR_DEVICE_ATTR(temp2_input, S_IRUGO, get_cpu_temp, NULL, 2);

WARNING: Symbolic permissions 'S_IRUGO' are not preferred. Consider using octal permissions '0444'.
+static SENSOR_DEVICE_ATTR(temp2_label, S_IRUGO, cpu_temp_label, NULL, 2);

WARNING: Symbolic permissions 'S_IRUGO' are not preferred. Consider using octal permissions '0444'.
+static SENSOR_DEVICE_ATTR(temp3_input, S_IRUGO, get_cpu_temp, NULL, 3);

WARNING: Symbolic permissions 'S_IRUGO' are not preferred. Consider using octal permissions '0444'.
+static SENSOR_DEVICE_ATTR(temp3_label, S_IRUGO, cpu_temp_label, NULL, 3);

WARNING: Symbolic permissions 'S_IRUGO' are not preferred. Consider using octal permissions '0444'.
+static SENSOR_DEVICE_ATTR(temp4_input, S_IRUGO, get_cpu_temp, NULL, 4);

WARNING: Symbolic permissions 'S_IRUGO' are not preferred. Consider using octal permissions '0444'.
+static SENSOR_DEVICE_ATTR(temp4_label, S_IRUGO, cpu_temp_label, NULL, 4);

WARNING: Missing a blank line after declarations
+ int id = (to_sensor_dev_attr(attr))->index - 1;
+ return sprintf(buf, "CPU %d Temperature\n", id);

WARNING: Missing a blank line after declarations
+ int value = loongson3_cpu_temp(id);
+ return sprintf(buf, "%d\n", value);

ERROR: spaces required around that '=' (ctx:VxV)
+ for (i=0; i<nr_packages; i++)
        ^

ERROR: spaces required around that '<' (ctx:VxV)
+ for (i=0; i<nr_packages; i++)
             ^

ERROR: spaces required around that '=' (ctx:VxV)
+ for (i=0; i<nr_packages; i++)
        ^

ERROR: spaces required around that '<' (ctx:VxV)
+ for (i=0; i<nr_packages; i++)
             ^

ERROR: spaces required around that '=' (ctx:VxV)
+ for (i=0; i<nr_packages; i++) {
        ^

ERROR: spaces required around that '<' (ctx:VxV)
+ for (i=0; i<nr_packages; i++) {
             ^

WARNING: line over 80 characters
+ csr_temp_enable = csr_readl(LOONGSON_CSR_FEATURES) & LOONGSON_CSRF_TEMP;

Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
Signed-off-by: Zhi Li <lizhi01@loongson.cn>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
drivers/platform/mips/cpu_hwmon.c