aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hwmon/k8temp.c
diff options
context:
space:
mode:
authorFrans Meulenbroeks <fransmeulenbroeks@gmail.com>2012-01-10 17:01:39 -0500
committerGuenter Roeck <guenter.roeck@ericsson.com>2012-03-18 21:26:42 -0400
commit93092a644fb519ec520c3a1f3e05ef9d25b1dac4 (patch)
tree86e4b2e248569803f315a2ea9e2fff975812117a /drivers/hwmon/k8temp.c
parent96585f1ae4698800a18582935e2f01bb65a44fe6 (diff)
hwmon: (k8temp) fix checkpatch issues
resolved: WARNING: line over 80 characters ERROR: do not use assignment in if condition Signed-off-by: Frans Meulenbroeks <fransmeulenbroeks@gmail.com> Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Diffstat (limited to 'drivers/hwmon/k8temp.c')
-rw-r--r--drivers/hwmon/k8temp.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/drivers/hwmon/k8temp.c b/drivers/hwmon/k8temp.c
index d985ae3558f8..575101988751 100644
--- a/drivers/hwmon/k8temp.c
+++ b/drivers/hwmon/k8temp.c
@@ -46,7 +46,7 @@ struct k8temp_data {
46 unsigned long last_updated; /* in jiffies */ 46 unsigned long last_updated; /* in jiffies */
47 47
48 /* registers values */ 48 /* registers values */
49 u8 sensorsp; /* sensor presence bits - SEL_CORE & SEL_PLACE */ 49 u8 sensorsp; /* sensor presence bits - SEL_CORE, SEL_PLACE */
50 u32 temp[2][2]; /* core, place */ 50 u32 temp[2][2]; /* core, place */
51 u8 swap_core_select; /* meaning of SEL_CORE is inverted */ 51 u8 swap_core_select; /* meaning of SEL_CORE is inverted */
52 u32 temp_offset; 52 u32 temp_offset;
@@ -63,7 +63,7 @@ static struct k8temp_data *k8temp_update_device(struct device *dev)
63 if (!data->valid 63 if (!data->valid
64 || time_after(jiffies, data->last_updated + HZ)) { 64 || time_after(jiffies, data->last_updated + HZ)) {
65 pci_read_config_byte(pdev, REG_TEMP, &tmp); 65 pci_read_config_byte(pdev, REG_TEMP, &tmp);
66 tmp &= ~(SEL_PLACE | SEL_CORE); /* Select sensor 0, core0 */ 66 tmp &= ~(SEL_PLACE | SEL_CORE); /* Select sensor 0, core0 */
67 pci_write_config_byte(pdev, REG_TEMP, tmp); 67 pci_write_config_byte(pdev, REG_TEMP, tmp);
68 pci_read_config_dword(pdev, REG_TEMP, &data->temp[0][0]); 68 pci_read_config_dword(pdev, REG_TEMP, &data->temp[0][0]);
69 69
@@ -82,7 +82,7 @@ static struct k8temp_data *k8temp_update_device(struct device *dev)
82 &data->temp[1][0]); 82 &data->temp[1][0]);
83 83
84 if (data->sensorsp & SEL_PLACE) { 84 if (data->sensorsp & SEL_PLACE) {
85 tmp |= SEL_PLACE; /* Select sensor 1, core1 */ 85 tmp |= SEL_PLACE; /* Select sensor 1, core1 */
86 pci_write_config_byte(pdev, REG_TEMP, tmp); 86 pci_write_config_byte(pdev, REG_TEMP, tmp);
87 pci_read_config_dword(pdev, REG_TEMP, 87 pci_read_config_dword(pdev, REG_TEMP,
88 &data->temp[1][1]); 88 &data->temp[1][1]);
@@ -183,7 +183,8 @@ static int __devinit k8temp_probe(struct pci_dev *pdev,
183 u8 model, stepping; 183 u8 model, stepping;
184 struct k8temp_data *data; 184 struct k8temp_data *data;
185 185
186 if (!(data = kzalloc(sizeof(struct k8temp_data), GFP_KERNEL))) { 186 data = kzalloc(sizeof(struct k8temp_data), GFP_KERNEL);
187 if (!data) {
187 err = -ENOMEM; 188 err = -ENOMEM;
188 goto exit; 189 goto exit;
189 } 190 }
@@ -217,7 +218,7 @@ static int __devinit k8temp_probe(struct pci_dev *pdev,
217 data->temp_offset = 21000; 218 data->temp_offset = 21000;
218 219
219 pci_read_config_byte(pdev, REG_TEMP, &scfg); 220 pci_read_config_byte(pdev, REG_TEMP, &scfg);
220 scfg &= ~(SEL_PLACE | SEL_CORE); /* Select sensor 0, core0 */ 221 scfg &= ~(SEL_PLACE | SEL_CORE); /* Select sensor 0, core0 */
221 pci_write_config_byte(pdev, REG_TEMP, scfg); 222 pci_write_config_byte(pdev, REG_TEMP, scfg);
222 pci_read_config_byte(pdev, REG_TEMP, &scfg); 223 pci_read_config_byte(pdev, REG_TEMP, &scfg);
223 224
@@ -238,7 +239,7 @@ static int __devinit k8temp_probe(struct pci_dev *pdev,
238 pci_write_config_byte(pdev, REG_TEMP, scfg); 239 pci_write_config_byte(pdev, REG_TEMP, scfg);
239 pci_read_config_dword(pdev, REG_TEMP, &temp); 240 pci_read_config_dword(pdev, REG_TEMP, &temp);
240 scfg |= SEL_CORE; /* prepare for next selection */ 241 scfg |= SEL_CORE; /* prepare for next selection */
241 if (!((temp >> 16) & 0xff)) /* if temp is 0 -49C is not likely */ 242 if (!((temp >> 16) & 0xff)) /* if temp is 0 -49C is unlikely */
242 data->sensorsp &= ~SEL_PLACE; 243 data->sensorsp &= ~SEL_PLACE;
243 } 244 }
244 245
@@ -246,7 +247,7 @@ static int __devinit k8temp_probe(struct pci_dev *pdev,
246 scfg &= ~SEL_PLACE; /* Select sensor 0, core1 */ 247 scfg &= ~SEL_PLACE; /* Select sensor 0, core1 */
247 pci_write_config_byte(pdev, REG_TEMP, scfg); 248 pci_write_config_byte(pdev, REG_TEMP, scfg);
248 pci_read_config_dword(pdev, REG_TEMP, &temp); 249 pci_read_config_dword(pdev, REG_TEMP, &temp);
249 if (!((temp >> 16) & 0xff)) /* if temp is 0 -49C is not likely */ 250 if (!((temp >> 16) & 0xff)) /* if temp is 0 -49C is unlikely */
250 data->sensorsp &= ~SEL_CORE; 251 data->sensorsp &= ~SEL_CORE;
251 } 252 }
252 253