Commit 7fe83ad8 authored by Frans Meulenbroeks's avatar Frans Meulenbroeks Committed by Guenter Roeck

hwmon: remove () used with return

fix checkpatch ERROR:
return is not a function, parentheses are not required
Signed-off-by: default avatarFrans Meulenbroeks <fransmeulenbroeks@gmail.com>
Signed-off-by: default avatarGuenter Roeck <guenter.roeck@ericsson.com>
parent a6bee4a5
...@@ -106,7 +106,7 @@ static struct atxp1_data * atxp1_update_device(struct device *dev) ...@@ -106,7 +106,7 @@ static struct atxp1_data * atxp1_update_device(struct device *dev)
mutex_unlock(&data->update_lock); mutex_unlock(&data->update_lock);
return(data); return data;
} }
/* sys file functions for cpu0_vid */ /* sys file functions for cpu0_vid */
......
...@@ -202,7 +202,7 @@ struct f71805f_sio_data { ...@@ -202,7 +202,7 @@ struct f71805f_sio_data {
static inline long in_from_reg(u8 reg) static inline long in_from_reg(u8 reg)
{ {
return (reg * 8); return reg * 8;
} }
/* The 2 least significant bits are not used */ /* The 2 least significant bits are not used */
...@@ -212,13 +212,13 @@ static inline u8 in_to_reg(long val) ...@@ -212,13 +212,13 @@ static inline u8 in_to_reg(long val)
return 0; return 0;
if (val >= 2016) if (val >= 2016)
return 0xfc; return 0xfc;
return (((val + 16) / 32) << 2); return ((val + 16) / 32) << 2;
} }
/* in0 is downscaled by a factor 2 internally */ /* in0 is downscaled by a factor 2 internally */
static inline long in0_from_reg(u8 reg) static inline long in0_from_reg(u8 reg)
{ {
return (reg * 16); return reg * 16;
} }
static inline u8 in0_to_reg(long val) static inline u8 in0_to_reg(long val)
...@@ -227,7 +227,7 @@ static inline u8 in0_to_reg(long val) ...@@ -227,7 +227,7 @@ static inline u8 in0_to_reg(long val)
return 0; return 0;
if (val >= 4032) if (val >= 4032)
return 0xfc; return 0xfc;
return (((val + 32) / 64) << 2); return ((val + 32) / 64) << 2;
} }
/* The 4 most significant bits are not used */ /* The 4 most significant bits are not used */
...@@ -236,7 +236,7 @@ static inline long fan_from_reg(u16 reg) ...@@ -236,7 +236,7 @@ static inline long fan_from_reg(u16 reg)
reg &= 0xfff; reg &= 0xfff;
if (!reg || reg == 0xfff) if (!reg || reg == 0xfff)
return 0; return 0;
return (1500000 / reg); return 1500000 / reg;
} }
static inline u16 fan_to_reg(long rpm) static inline u16 fan_to_reg(long rpm)
...@@ -246,7 +246,7 @@ static inline u16 fan_to_reg(long rpm) ...@@ -246,7 +246,7 @@ static inline u16 fan_to_reg(long rpm)
so that no alarm will ever trigger. */ so that no alarm will ever trigger. */
if (rpm < 367) if (rpm < 367)
return 0xfff; return 0xfff;
return (1500000 / rpm); return 1500000 / rpm;
} }
static inline unsigned long pwm_freq_from_reg(u8 reg) static inline unsigned long pwm_freq_from_reg(u8 reg)
...@@ -278,7 +278,7 @@ static inline int pwm_mode_from_reg(u8 reg) ...@@ -278,7 +278,7 @@ static inline int pwm_mode_from_reg(u8 reg)
static inline long temp_from_reg(u8 reg) static inline long temp_from_reg(u8 reg)
{ {
return (reg * 1000); return reg * 1000;
} }
static inline u8 temp_to_reg(long val) static inline u8 temp_to_reg(long val)
......
...@@ -96,14 +96,14 @@ int vid_from_reg(int val, u8 vrm) ...@@ -96,14 +96,14 @@ int vid_from_reg(int val, u8 vrm)
vid = 1862500 - (val & 0x1f) * 25000; vid = 1862500 - (val & 0x1f) * 25000;
if(val & 0x20) if(val & 0x20)
vid -= 12500; vid -= 12500;
return((vid + 500) / 1000); return (vid + 500) / 1000;
case 110: /* Intel Conroe */ case 110: /* Intel Conroe */
/* compute in uV, round to mV */ /* compute in uV, round to mV */
val &= 0xff; val &= 0xff;
if (val < 0x02 || val > 0xb2) if (val < 0x02 || val > 0xb2)
return 0; return 0;
return((1600000 - (val - 2) * 6250 + 500) / 1000); return (1600000 - (val - 2) * 6250 + 500) / 1000;
case 24: /* Athlon64 & Opteron */ case 24: /* Athlon64 & Opteron */
val &= 0x1f; val &= 0x1f;
...@@ -118,38 +118,38 @@ int vid_from_reg(int val, u8 vrm) ...@@ -118,38 +118,38 @@ int vid_from_reg(int val, u8 vrm)
case 91: /* VRM 9.1 */ case 91: /* VRM 9.1 */
case 90: /* VRM 9.0 */ case 90: /* VRM 9.0 */
val &= 0x1f; val &= 0x1f;
return(val == 0x1f ? 0 : return val == 0x1f ? 0 :
1850 - val * 25); 1850 - val * 25;
case 85: /* VRM 8.5 */ case 85: /* VRM 8.5 */
val &= 0x1f; val &= 0x1f;
return((val & 0x10 ? 25 : 0) + return (val & 0x10 ? 25 : 0) +
((val & 0x0f) > 0x04 ? 2050 : 1250) - ((val & 0x0f) > 0x04 ? 2050 : 1250) -
((val & 0x0f) * 50)); ((val & 0x0f) * 50);
case 84: /* VRM 8.4 */ case 84: /* VRM 8.4 */
val &= 0x0f; val &= 0x0f;
/* fall through */ /* fall through */
case 82: /* VRM 8.2 */ case 82: /* VRM 8.2 */
val &= 0x1f; val &= 0x1f;
return(val == 0x1f ? 0 : return val == 0x1f ? 0 :
val & 0x10 ? 5100 - (val) * 100 : val & 0x10 ? 5100 - (val) * 100 :
2050 - (val) * 50); 2050 - (val) * 50;
case 17: /* Intel IMVP-II */ case 17: /* Intel IMVP-II */
val &= 0x1f; val &= 0x1f;
return(val & 0x10 ? 975 - (val & 0xF) * 25 : return val & 0x10 ? 975 - (val & 0xF) * 25 :
1750 - val * 50); 1750 - val * 50;
case 13: case 13:
case 131: case 131:
val &= 0x3f; val &= 0x3f;
/* Exception for Eden ULV 500 MHz */ /* Exception for Eden ULV 500 MHz */
if (vrm == 131 && val == 0x3f) if (vrm == 131 && val == 0x3f)
val++; val++;
return(1708 - val * 16); return 1708 - val * 16;
case 14: /* Intel Core */ case 14: /* Intel Core */
/* compute in uV, round to mV */ /* compute in uV, round to mV */
val &= 0x7f; val &= 0x7f;
return(val > 0x77 ? 0 : (1500000 - (val * 12500) + 500) / 1000); return val > 0x77 ? 0 : (1500000 - (val * 12500) + 500) / 1000;
default: /* report 0 for unknown */ default: /* report 0 for unknown */
if (vrm) if (vrm)
pr_warn("Requested unsupported VRM version (%u)\n", pr_warn("Requested unsupported VRM version (%u)\n",
......
...@@ -269,9 +269,9 @@ static int pcf8591_read_channel(struct device *dev, int channel) ...@@ -269,9 +269,9 @@ static int pcf8591_read_channel(struct device *dev, int channel)
if ((channel == 2 && input_mode == 2) || if ((channel == 2 && input_mode == 2) ||
(channel != 3 && (input_mode == 1 || input_mode == 3))) (channel != 3 && (input_mode == 1 || input_mode == 3)))
return (10 * REG_TO_SIGNED(value)); return 10 * REG_TO_SIGNED(value);
else else
return (10 * value); return 10 * value;
} }
static const struct i2c_device_id pcf8591_id[] = { static const struct i2c_device_id pcf8591_id[] = {
......
...@@ -313,7 +313,7 @@ static inline unsigned long pwm_freq_from_reg(u8 reg) ...@@ -313,7 +313,7 @@ static inline unsigned long pwm_freq_from_reg(u8 reg)
/* This should not happen but anyway... */ /* This should not happen but anyway... */
if (reg == 0) if (reg == 0)
reg++; reg++;
return (clock / (reg << 8)); return clock / (reg << 8);
} }
static inline u8 pwm_freq_to_reg(unsigned long val) static inline u8 pwm_freq_to_reg(unsigned long val)
{ {
...@@ -321,11 +321,11 @@ static inline u8 pwm_freq_to_reg(unsigned long val) ...@@ -321,11 +321,11 @@ static inline u8 pwm_freq_to_reg(unsigned long val)
if (val >= 93750) /* The highest we can do */ if (val >= 93750) /* The highest we can do */
return 0x01; return 0x01;
if (val >= 720) /* Use 24 MHz clock */ if (val >= 720) /* Use 24 MHz clock */
return (24000000UL / (val << 8)); return 24000000UL / (val << 8);
if (val < 6) /* The lowest we can do */ if (val < 6) /* The lowest we can do */
return 0xFF; return 0xFF;
else /* Use 180 kHz clock */ else /* Use 180 kHz clock */
return (0x80 | (180000UL / (val << 8))); return 0x80 | (180000UL / (val << 8));
} }
#define BEEP_MASK_FROM_REG(val) ((val) & 0xff7fff) #define BEEP_MASK_FROM_REG(val) ((val) & 0xff7fff)
...@@ -342,7 +342,7 @@ static inline u8 DIV_TO_REG(long val) ...@@ -342,7 +342,7 @@ static inline u8 DIV_TO_REG(long val)
break; break;
val >>= 1; val >>= 1;
} }
return ((u8) i); return (u8)i;
} }
/* For each registered chip, we need to keep some data in memory. /* For each registered chip, we need to keep some data in memory.
......
...@@ -265,7 +265,7 @@ DIV_TO_REG(long val) ...@@ -265,7 +265,7 @@ DIV_TO_REG(long val)
break; break;
val >>= 1; val >>= 1;
} }
return ((u8) i); return (u8)i;
} }
struct w83792d_data { struct w83792d_data {
...@@ -333,7 +333,7 @@ static struct i2c_driver w83792d_driver = { ...@@ -333,7 +333,7 @@ static struct i2c_driver w83792d_driver = {
static inline long in_count_from_reg(int nr, struct w83792d_data *data) static inline long in_count_from_reg(int nr, struct w83792d_data *data)
{ {
/* in7 and in8 do not have low bits, but the formula still works */ /* in7 and in8 do not have low bits, but the formula still works */
return ((data->in[nr] << 2) | ((data->low_bits >> (2 * nr)) & 0x03)); return (data->in[nr] << 2) | ((data->low_bits >> (2 * nr)) & 0x03);
} }
/* The SMBus locks itself. The Winbond W83792D chip has a bank register, /* The SMBus locks itself. The Winbond W83792D chip has a bank register,
......
...@@ -181,7 +181,7 @@ static inline unsigned long FAN_FROM_REG(u16 val) ...@@ -181,7 +181,7 @@ static inline unsigned long FAN_FROM_REG(u16 val)
{ {
if ((val >= 0xfff) || (val == 0)) if ((val >= 0xfff) || (val == 0))
return 0; return 0;
return (1350000UL / val); return 1350000UL / val;
} }
static inline u16 FAN_TO_REG(long rpm) static inline u16 FAN_TO_REG(long rpm)
...@@ -193,7 +193,7 @@ static inline u16 FAN_TO_REG(long rpm) ...@@ -193,7 +193,7 @@ static inline u16 FAN_TO_REG(long rpm)
static inline unsigned long TIME_FROM_REG(u8 reg) static inline unsigned long TIME_FROM_REG(u8 reg)
{ {
return (reg * 100); return reg * 100;
} }
static inline u8 TIME_TO_REG(unsigned long val) static inline u8 TIME_TO_REG(unsigned long val)
...@@ -203,7 +203,7 @@ static inline u8 TIME_TO_REG(unsigned long val) ...@@ -203,7 +203,7 @@ static inline u8 TIME_TO_REG(unsigned long val)
static inline long TEMP_FROM_REG(s8 reg) static inline long TEMP_FROM_REG(s8 reg)
{ {
return (reg * 1000); return reg * 1000;
} }
static inline s8 TEMP_TO_REG(long val, s8 min, s8 max) static inline s8 TEMP_TO_REG(long val, s8 min, s8 max)
......
...@@ -116,7 +116,7 @@ DIV_TO_REG(long val) ...@@ -116,7 +116,7 @@ DIV_TO_REG(long val)
break; break;
val >>= 1; val >>= 1;
} }
return ((u8) i); return (u8)i;
} }
struct w83l786ng_data { struct w83l786ng_data {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment