Skip to content

Commit 8cbf217

Browse files
orzelmichalgroeck
authored andcommitted
hwmon: (lm75) Fix all coding-style warnings on lm75 driver
Check/fix all warnings generated by checkpatch.pl script on LM75 driver. Signed-off-by: Michal Orzel <[email protected]> Signed-off-by: Guenter Roeck <[email protected]>
1 parent 44e3ad8 commit 8cbf217

File tree

2 files changed

+23
-16
lines changed

2 files changed

+23
-16
lines changed

drivers/hwmon/lm75.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -797,8 +797,10 @@ static int lm75_detect(struct i2c_client *new_client,
797797

798798
/* First check for LM75A */
799799
if (i2c_smbus_read_byte_data(new_client, 7) == LM75A_ID) {
800-
/* LM75A returns 0xff on unused registers so
801-
just to be sure we check for that too. */
800+
/*
801+
* LM75A returns 0xff on unused registers so
802+
* just to be sure we check for that too.
803+
*/
802804
if (i2c_smbus_read_byte_data(new_client, 4) != 0xff
803805
|| i2c_smbus_read_byte_data(new_client, 5) != 0xff
804806
|| i2c_smbus_read_byte_data(new_client, 6) != 0xff)
@@ -849,6 +851,7 @@ static int lm75_suspend(struct device *dev)
849851
{
850852
int status;
851853
struct i2c_client *client = to_i2c_client(dev);
854+
852855
status = i2c_smbus_read_byte_data(client, LM75_REG_CONF);
853856
if (status < 0) {
854857
dev_dbg(&client->dev, "Can't read config? %d\n", status);
@@ -863,6 +866,7 @@ static int lm75_resume(struct device *dev)
863866
{
864867
int status;
865868
struct i2c_client *client = to_i2c_client(dev);
869+
866870
status = i2c_smbus_read_byte_data(client, LM75_REG_CONF);
867871
if (status < 0) {
868872
dev_dbg(&client->dev, "Can't read config? %d\n", status);

drivers/hwmon/lm75.h

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,15 @@
11
/* SPDX-License-Identifier: GPL-2.0-or-later */
22
/*
3-
lm75.h - Part of lm_sensors, Linux kernel modules for hardware
4-
monitoring
5-
Copyright (c) 2003 Mark M. Hoffman <[email protected]>
6-
7-
*/
3+
* lm75.h - Part of lm_sensors, Linux kernel modules for hardware monitoring
4+
* Copyright (c) 2003 Mark M. Hoffman <[email protected]>
5+
*/
86

97
/*
10-
This file contains common code for encoding/decoding LM75 type
11-
temperature readings, which are emulated by many of the chips
12-
we support. As the user is unlikely to load more than one driver
13-
which contains this code, we don't worry about the wasted space.
14-
*/
8+
* This file contains common code for encoding/decoding LM75 type
9+
* temperature readings, which are emulated by many of the chips
10+
* we support. As the user is unlikely to load more than one driver
11+
* which contains this code, we don't worry about the wasted space.
12+
*/
1513

1614
#include <linux/kernel.h>
1715

@@ -20,18 +18,23 @@
2018
#define LM75_TEMP_MAX 125000
2119
#define LM75_SHUTDOWN 0x01
2220

23-
/* TEMP: 0.001C/bit (-55C to +125C)
24-
REG: (0.5C/bit, two's complement) << 7 */
21+
/*
22+
* TEMP: 0.001C/bit (-55C to +125C)
23+
* REG: (0.5C/bit, two's complement) << 7
24+
*/
2525
static inline u16 LM75_TEMP_TO_REG(long temp)
2626
{
2727
int ntemp = clamp_val(temp, LM75_TEMP_MIN, LM75_TEMP_MAX);
28+
2829
ntemp += (ntemp < 0 ? -250 : 250);
2930
return (u16)((ntemp / 500) << 7);
3031
}
3132

3233
static inline int LM75_TEMP_FROM_REG(u16 reg)
3334
{
34-
/* use integer division instead of equivalent right shift to
35-
guarantee arithmetic shift and preserve the sign */
35+
/*
36+
* use integer division instead of equivalent right shift to
37+
* guarantee arithmetic shift and preserve the sign
38+
*/
3639
return ((s16)reg / 128) * 500;
3740
}

0 commit comments

Comments
 (0)