Linux Hardware Monitor development
 help / color / mirror / Atom feed
* [PATCH v1 0/3] hwmon: tmp513: A few cleanups
@ 2023-11-28 18:06 Andy Shevchenko
  2023-11-28 18:06 ` [PATCH v1 1/3] hwmon: tmp513: Don't use "proxy" headers Andy Shevchenko
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Andy Shevchenko @ 2023-11-28 18:06 UTC (permalink / raw)
  To: Guenter Roeck, linux-hwmon, linux-kernel
  Cc: Eric Tremblay, Jean Delvare, Andy Shevchenko

Nothing special, just a few random cleanups, but there is a dependency
due to closer lines changed.

Andy Shevchenko (3):
  hwmon: tmp513: Don't use "proxy" headers
  hwmon: tmp513: Simplify with dev_err_probe()
  hwmon: tmp513: Use SI constants from units.h

 drivers/hwmon/tmp513.c | 63 ++++++++++++++++++++----------------------
 1 file changed, 30 insertions(+), 33 deletions(-)

-- 
2.43.0.rc1.1.gbec44491f096


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH v1 1/3] hwmon: tmp513: Don't use "proxy" headers
  2023-11-28 18:06 [PATCH v1 0/3] hwmon: tmp513: A few cleanups Andy Shevchenko
@ 2023-11-28 18:06 ` Andy Shevchenko
  2023-12-01  4:07   ` Guenter Roeck
  2023-11-28 18:06 ` [PATCH v1 2/3] hwmon: tmp513: Simplify with dev_err_probe() Andy Shevchenko
  2023-11-28 18:06 ` [PATCH v1 3/3] hwmon: tmp513: Use SI constants from units.h Andy Shevchenko
  2 siblings, 1 reply; 10+ messages in thread
From: Andy Shevchenko @ 2023-11-28 18:06 UTC (permalink / raw)
  To: Guenter Roeck, linux-hwmon, linux-kernel
  Cc: Eric Tremblay, Jean Delvare, Andy Shevchenko

The driver uses math.h and not util_macros.h.

All the same for the kernel.h, replace it with what the driver is using.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/hwmon/tmp513.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/hwmon/tmp513.c b/drivers/hwmon/tmp513.c
index 8a7cf08733c6..849a8c3e1020 100644
--- a/drivers/hwmon/tmp513.c
+++ b/drivers/hwmon/tmp513.c
@@ -19,15 +19,19 @@
  * the Free Software Foundation; version 2 of the License.
  */
 
+#include <linux/bitops.h>
+#include <linux/bug.h>
+#include <linux/device.h>
 #include <linux/err.h>
 #include <linux/hwmon.h>
 #include <linux/i2c.h>
 #include <linux/init.h>
-#include <linux/kernel.h>
+#include <linux/math.h>
 #include <linux/module.h>
+#include <linux/property.h>
 #include <linux/regmap.h>
 #include <linux/slab.h>
-#include <linux/util_macros.h>
+#include <linux/types.h>
 
 // Common register definition
 #define TMP51X_SHUNT_CONFIG		0x00
-- 
2.43.0.rc1.1.gbec44491f096


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH v1 2/3] hwmon: tmp513: Simplify with dev_err_probe()
  2023-11-28 18:06 [PATCH v1 0/3] hwmon: tmp513: A few cleanups Andy Shevchenko
  2023-11-28 18:06 ` [PATCH v1 1/3] hwmon: tmp513: Don't use "proxy" headers Andy Shevchenko
@ 2023-11-28 18:06 ` Andy Shevchenko
  2023-12-01  4:10   ` Guenter Roeck
  2023-11-28 18:06 ` [PATCH v1 3/3] hwmon: tmp513: Use SI constants from units.h Andy Shevchenko
  2 siblings, 1 reply; 10+ messages in thread
From: Andy Shevchenko @ 2023-11-28 18:06 UTC (permalink / raw)
  To: Guenter Roeck, linux-hwmon, linux-kernel
  Cc: Eric Tremblay, Jean Delvare, Andy Shevchenko

Common pattern of handling deferred probe can be simplified with
dev_err_probe().  Less code and also it prints the error value.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/hwmon/tmp513.c | 34 ++++++++++++++--------------------
 1 file changed, 14 insertions(+), 20 deletions(-)

diff --git a/drivers/hwmon/tmp513.c b/drivers/hwmon/tmp513.c
index 849a8c3e1020..6e01800404fc 100644
--- a/drivers/hwmon/tmp513.c
+++ b/drivers/hwmon/tmp513.c
@@ -630,9 +630,9 @@ static int tmp51x_vbus_range_to_reg(struct device *dev,
 	} else if (data->vbus_range_uvolt == TMP51X_VBUS_RANGE_16V) {
 		data->shunt_config &= ~TMP51X_BUS_VOLTAGE_MASK;
 	} else {
-		dev_err(dev, "ti,bus-range-microvolt is invalid: %u\n",
-			data->vbus_range_uvolt);
-		return -EINVAL;
+		return dev_err_probe(dev, -EINVAL,
+				     "ti,bus-range-microvolt is invalid: %u\n",
+				     data->vbus_range_uvolt);
 	}
 	return 0;
 }
@@ -648,8 +648,8 @@ static int tmp51x_pga_gain_to_reg(struct device *dev, struct tmp51x_data *data)
 	} else if (data->pga_gain == 1) {
 		data->shunt_config |= CURRENT_SENSE_VOLTAGE_40_MASK;
 	} else {
-		dev_err(dev, "ti,pga-gain is invalid: %u\n", data->pga_gain);
-		return -EINVAL;
+		return dev_err_probe(dev, -EINVAL,
+				     "ti,pga-gain is invalid: %u\n", data->pga_gain);
 	}
 	return 0;
 }
@@ -679,9 +679,9 @@ static int tmp51x_read_properties(struct device *dev, struct tmp51x_data *data)
 
 	// Check if shunt value is compatible with pga-gain
 	if (data->shunt_uohms > data->pga_gain * 40 * 1000 * 1000) {
-		dev_err(dev, "shunt-resistor: %u too big for pga_gain: %u\n",
-			data->shunt_uohms, data->pga_gain);
-		return -EINVAL;
+		return dev_err_probe(dev, -EINVAL,
+				     "shunt-resistor: %u too big for pga_gain: %u\n",
+				     data->shunt_uohms, data->pga_gain);
 	}
 
 	return 0;
@@ -721,22 +721,16 @@ static int tmp51x_probe(struct i2c_client *client)
 	data->max_channels = (uintptr_t)i2c_get_match_data(client);
 
 	ret = tmp51x_configure(dev, data);
-	if (ret < 0) {
-		dev_err(dev, "error configuring the device: %d\n", ret);
-		return ret;
-	}
+	if (ret < 0)
+		return dev_err_probe(dev, ret, "error configuring the device\n");
 
 	data->regmap = devm_regmap_init_i2c(client, &tmp51x_regmap_config);
-	if (IS_ERR(data->regmap)) {
-		dev_err(dev, "failed to allocate register map\n");
-		return PTR_ERR(data->regmap);
-	}
+	if (IS_ERR(data->regmap))
+		return dev_err_probe(dev, PTR_ERR(data->regmap), "failed to allocate register map\n");
 
 	ret = tmp51x_init(data);
-	if (ret < 0) {
-		dev_err(dev, "error configuring the device: %d\n", ret);
-		return -ENODEV;
-	}
+	if (ret < 0)
+		return dev_err_probe(dev, ret, "error configuring the device\n");
 
 	hwmon_dev = devm_hwmon_device_register_with_info(dev, client->name,
 							 data,
-- 
2.43.0.rc1.1.gbec44491f096


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH v1 3/3] hwmon: tmp513: Use SI constants from units.h
  2023-11-28 18:06 [PATCH v1 0/3] hwmon: tmp513: A few cleanups Andy Shevchenko
  2023-11-28 18:06 ` [PATCH v1 1/3] hwmon: tmp513: Don't use "proxy" headers Andy Shevchenko
  2023-11-28 18:06 ` [PATCH v1 2/3] hwmon: tmp513: Simplify with dev_err_probe() Andy Shevchenko
@ 2023-11-28 18:06 ` Andy Shevchenko
  2023-12-01  4:10   ` Guenter Roeck
  2 siblings, 1 reply; 10+ messages in thread
From: Andy Shevchenko @ 2023-11-28 18:06 UTC (permalink / raw)
  To: Guenter Roeck, linux-hwmon, linux-kernel
  Cc: Eric Tremblay, Jean Delvare, Andy Shevchenko

MILLI and MICRO may be used in the driver to make code more robust
against possible miscalculations.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/hwmon/tmp513.c | 21 ++++++++++-----------
 1 file changed, 10 insertions(+), 11 deletions(-)

diff --git a/drivers/hwmon/tmp513.c b/drivers/hwmon/tmp513.c
index 6e01800404fc..e0abdb27131e 100644
--- a/drivers/hwmon/tmp513.c
+++ b/drivers/hwmon/tmp513.c
@@ -32,6 +32,7 @@
 #include <linux/regmap.h>
 #include <linux/slab.h>
 #include <linux/types.h>
+#include <linux/units.h>
 
 // Common register definition
 #define TMP51X_SHUNT_CONFIG		0x00
@@ -101,8 +102,8 @@
 #define TMP51X_REMOTE_TEMP_LIMIT_2_POS		8
 #define TMP513_REMOTE_TEMP_LIMIT_3_POS		7
 
-#define TMP51X_VBUS_RANGE_32V		32000000
-#define TMP51X_VBUS_RANGE_16V		16000000
+#define TMP51X_VBUS_RANGE_32V		(32 * MICRO)
+#define TMP51X_VBUS_RANGE_16V		(16 * MICRO)
 
 // Max and Min value
 #define MAX_BUS_VOLTAGE_32_LIMIT	32764
@@ -204,7 +205,7 @@ static int tmp51x_get_value(struct tmp51x_data *data, u8 reg, u8 pos,
 		 * on the pga gain setting. 1lsb = 10uV
 		 */
 		*val = sign_extend32(regval, 17 - tmp51x_get_pga_shift(data));
-		*val = DIV_ROUND_CLOSEST(*val * 10000, data->shunt_uohms);
+		*val = DIV_ROUND_CLOSEST(*val * 10 * MILLI, data->shunt_uohms);
 		break;
 	case TMP51X_BUS_VOLTAGE_RESULT:
 	case TMP51X_BUS_VOLTAGE_H_LIMIT:
@@ -220,7 +221,7 @@ static int tmp51x_get_value(struct tmp51x_data *data, u8 reg, u8 pos,
 	case TMP51X_BUS_CURRENT_RESULT:
 		// Current = (ShuntVoltage * CalibrationRegister) / 4096
 		*val = sign_extend32(regval, 16) * data->curr_lsb_ua;
-		*val = DIV_ROUND_CLOSEST(*val, 1000);
+		*val = DIV_ROUND_CLOSEST(*val, MILLI);
 		break;
 	case TMP51X_LOCAL_TEMP_RESULT:
 	case TMP51X_REMOTE_TEMP_RESULT_1:
@@ -260,7 +261,7 @@ static int tmp51x_set_value(struct tmp51x_data *data, u8 reg, long val)
 		 * The user enter current value and we convert it to
 		 * voltage. 1lsb = 10uV
 		 */
-		val = DIV_ROUND_CLOSEST(val * data->shunt_uohms, 10000);
+		val = DIV_ROUND_CLOSEST(val * data->shunt_uohms, 10 * MILLI);
 		max_val = U16_MAX >> tmp51x_get_pga_shift(data);
 		regval = clamp_val(val, -max_val, max_val);
 		break;
@@ -550,18 +551,16 @@ static int tmp51x_calibrate(struct tmp51x_data *data)
 	if (data->shunt_uohms == 0)
 		return regmap_write(data->regmap, TMP51X_SHUNT_CALIBRATION, 0);
 
-	max_curr_ma = DIV_ROUND_CLOSEST_ULL(vshunt_max * 1000 * 1000,
-					    data->shunt_uohms);
+	max_curr_ma = DIV_ROUND_CLOSEST_ULL(vshunt_max * MICRO, data->shunt_uohms);
 
 	/*
 	 * Calculate the minimal bit resolution for the current and the power.
 	 * Those values will be used during register interpretation.
 	 */
-	data->curr_lsb_ua = DIV_ROUND_CLOSEST_ULL(max_curr_ma * 1000, 32767);
+	data->curr_lsb_ua = DIV_ROUND_CLOSEST_ULL(max_curr_ma * MILLI, 32767);
 	data->pwr_lsb_uw = 20 * data->curr_lsb_ua;
 
-	div = DIV_ROUND_CLOSEST_ULL(data->curr_lsb_ua * data->shunt_uohms,
-				    1000 * 1000);
+	div = DIV_ROUND_CLOSEST_ULL(data->curr_lsb_ua * data->shunt_uohms, MICRO);
 
 	return regmap_write(data->regmap, TMP51X_SHUNT_CALIBRATION,
 			    DIV_ROUND_CLOSEST(40960, div));
@@ -678,7 +677,7 @@ static int tmp51x_read_properties(struct device *dev, struct tmp51x_data *data)
 				       data->max_channels - 1);
 
 	// Check if shunt value is compatible with pga-gain
-	if (data->shunt_uohms > data->pga_gain * 40 * 1000 * 1000) {
+	if (data->shunt_uohms > data->pga_gain * 40 * MICRO) {
 		return dev_err_probe(dev, -EINVAL,
 				     "shunt-resistor: %u too big for pga_gain: %u\n",
 				     data->shunt_uohms, data->pga_gain);
-- 
2.43.0.rc1.1.gbec44491f096


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH v1 1/3] hwmon: tmp513: Don't use "proxy" headers
  2023-11-28 18:06 ` [PATCH v1 1/3] hwmon: tmp513: Don't use "proxy" headers Andy Shevchenko
@ 2023-12-01  4:07   ` Guenter Roeck
  0 siblings, 0 replies; 10+ messages in thread
From: Guenter Roeck @ 2023-12-01  4:07 UTC (permalink / raw)
  To: Andy Shevchenko; +Cc: linux-hwmon, linux-kernel, Eric Tremblay, Jean Delvare

On Tue, Nov 28, 2023 at 08:06:02PM +0200, Andy Shevchenko wrote:
> The driver uses math.h and not util_macros.h.
> 
> All the same for the kernel.h, replace it with what the driver is using.
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

Applied.

Guenter

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v1 2/3] hwmon: tmp513: Simplify with dev_err_probe()
  2023-11-28 18:06 ` [PATCH v1 2/3] hwmon: tmp513: Simplify with dev_err_probe() Andy Shevchenko
@ 2023-12-01  4:10   ` Guenter Roeck
  2023-12-01 13:53     ` Andy Shevchenko
  0 siblings, 1 reply; 10+ messages in thread
From: Guenter Roeck @ 2023-12-01  4:10 UTC (permalink / raw)
  To: Andy Shevchenko; +Cc: linux-hwmon, linux-kernel, Eric Tremblay, Jean Delvare

On Tue, Nov 28, 2023 at 08:06:03PM +0200, Andy Shevchenko wrote:
> Common pattern of handling deferred probe can be simplified with
> dev_err_probe().  Less code and also it prints the error value.
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

Applied, but ...

> ---
>  drivers/hwmon/tmp513.c | 34 ++++++++++++++--------------------
>  1 file changed, 14 insertions(+), 20 deletions(-)
> 
> diff --git a/drivers/hwmon/tmp513.c b/drivers/hwmon/tmp513.c
> index 849a8c3e1020..6e01800404fc 100644
> --- a/drivers/hwmon/tmp513.c
> +++ b/drivers/hwmon/tmp513.c
> @@ -630,9 +630,9 @@ static int tmp51x_vbus_range_to_reg(struct device *dev,
>  	} else if (data->vbus_range_uvolt == TMP51X_VBUS_RANGE_16V) {
>  		data->shunt_config &= ~TMP51X_BUS_VOLTAGE_MASK;
>  	} else {
> -		dev_err(dev, "ti,bus-range-microvolt is invalid: %u\n",
> -			data->vbus_range_uvolt);
> -		return -EINVAL;
> +		return dev_err_probe(dev, -EINVAL,
> +				     "ti,bus-range-microvolt is invalid: %u\n",
> +				     data->vbus_range_uvolt);
>  	}
>  	return 0;
>  }
> @@ -648,8 +648,8 @@ static int tmp51x_pga_gain_to_reg(struct device *dev, struct tmp51x_data *data)
>  	} else if (data->pga_gain == 1) {
>  		data->shunt_config |= CURRENT_SENSE_VOLTAGE_40_MASK;
>  	} else {
> -		dev_err(dev, "ti,pga-gain is invalid: %u\n", data->pga_gain);
> -		return -EINVAL;
> +		return dev_err_probe(dev, -EINVAL,
> +				     "ti,pga-gain is invalid: %u\n", data->pga_gain);
>  	}
>  	return 0;
>  }
> @@ -679,9 +679,9 @@ static int tmp51x_read_properties(struct device *dev, struct tmp51x_data *data)
>  
>  	// Check if shunt value is compatible with pga-gain
>  	if (data->shunt_uohms > data->pga_gain * 40 * 1000 * 1000) {
> -		dev_err(dev, "shunt-resistor: %u too big for pga_gain: %u\n",
> -			data->shunt_uohms, data->pga_gain);
> -		return -EINVAL;
> +		return dev_err_probe(dev, -EINVAL,
> +				     "shunt-resistor: %u too big for pga_gain: %u\n",
> +				     data->shunt_uohms, data->pga_gain);
>  	}
>  
>  	return 0;
> @@ -721,22 +721,16 @@ static int tmp51x_probe(struct i2c_client *client)
>  	data->max_channels = (uintptr_t)i2c_get_match_data(client);
>  
>  	ret = tmp51x_configure(dev, data);
> -	if (ret < 0) {
> -		dev_err(dev, "error configuring the device: %d\n", ret);
> -		return ret;
> -	}
> +	if (ret < 0)
> +		return dev_err_probe(dev, ret, "error configuring the device\n");
>  
>  	data->regmap = devm_regmap_init_i2c(client, &tmp51x_regmap_config);
> -	if (IS_ERR(data->regmap)) {
> -		dev_err(dev, "failed to allocate register map\n");
> -		return PTR_ERR(data->regmap);
> -	}
> +	if (IS_ERR(data->regmap))
> +		return dev_err_probe(dev, PTR_ERR(data->regmap), "failed to allocate register map\n");

That line length was getting too long. Please consider running checkpatch
on your patches.

Guenter

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v1 3/3] hwmon: tmp513: Use SI constants from units.h
  2023-11-28 18:06 ` [PATCH v1 3/3] hwmon: tmp513: Use SI constants from units.h Andy Shevchenko
@ 2023-12-01  4:10   ` Guenter Roeck
  0 siblings, 0 replies; 10+ messages in thread
From: Guenter Roeck @ 2023-12-01  4:10 UTC (permalink / raw)
  To: Andy Shevchenko; +Cc: linux-hwmon, linux-kernel, Eric Tremblay, Jean Delvare

On Tue, Nov 28, 2023 at 08:06:04PM +0200, Andy Shevchenko wrote:
> MILLI and MICRO may be used in the driver to make code more robust
> against possible miscalculations.
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

Applied.

Thanks,
Guenter

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v1 2/3] hwmon: tmp513: Simplify with dev_err_probe()
  2023-12-01  4:10   ` Guenter Roeck
@ 2023-12-01 13:53     ` Andy Shevchenko
  2023-12-01 14:51       ` Guenter Roeck
  0 siblings, 1 reply; 10+ messages in thread
From: Andy Shevchenko @ 2023-12-01 13:53 UTC (permalink / raw)
  To: Guenter Roeck; +Cc: linux-hwmon, linux-kernel, Eric Tremblay, Jean Delvare

On Thu, Nov 30, 2023 at 08:10:12PM -0800, Guenter Roeck wrote:
> On Tue, Nov 28, 2023 at 08:06:03PM +0200, Andy Shevchenko wrote:
> > Common pattern of handling deferred probe can be simplified with
> > dev_err_probe().  Less code and also it prints the error value.

...

> > +	if (IS_ERR(data->regmap))
> > +		return dev_err_probe(dev, PTR_ERR(data->regmap), "failed to allocate register map\n");
> 
> That line length was getting too long. Please consider running checkpatch
> on your patches.

I got your point, but checkpatch has no limit for the string literals, see

f4c014c0dede ("checkpatch: allow printk strings to exceed 80 characters to maintain their searchability")
ca56dc098caf ("checkpatch: check for quoted strings broken across lines")

So, what the exact parameters should I supply to it?

-- 
With Best Regards,
Andy Shevchenko



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v1 2/3] hwmon: tmp513: Simplify with dev_err_probe()
  2023-12-01 13:53     ` Andy Shevchenko
@ 2023-12-01 14:51       ` Guenter Roeck
  2023-12-01 15:08         ` Andy Shevchenko
  0 siblings, 1 reply; 10+ messages in thread
From: Guenter Roeck @ 2023-12-01 14:51 UTC (permalink / raw)
  To: Andy Shevchenko; +Cc: linux-hwmon, linux-kernel, Eric Tremblay, Jean Delvare

On 12/1/23 05:53, Andy Shevchenko wrote:
> On Thu, Nov 30, 2023 at 08:10:12PM -0800, Guenter Roeck wrote:
>> On Tue, Nov 28, 2023 at 08:06:03PM +0200, Andy Shevchenko wrote:
>>> Common pattern of handling deferred probe can be simplified with
>>> dev_err_probe().  Less code and also it prints the error value.
> 
> ...
> 
>>> +	if (IS_ERR(data->regmap))
>>> +		return dev_err_probe(dev, PTR_ERR(data->regmap), "failed to allocate register map\n");
>>
>> That line length was getting too long. Please consider running checkpatch
>> on your patches.
> 
> I got your point, but checkpatch has no limit for the string literals, see
> 
> f4c014c0dede ("checkpatch: allow printk strings to exceed 80 characters to maintain their searchability")
> ca56dc098caf ("checkpatch: check for quoted strings broken across lines")
> 
> So, what the exact parameters should I supply to it?
> 

None. Please just run checkpatch.

$ scripts/checkpatch.pl index.html
WARNING: line length of 102 exceeds 100 columns
#126: FILE: drivers/hwmon/tmp513.c:729:
+		return dev_err_probe(dev, PTR_ERR(data->regmap), "failed to allocate register map\n");

Guenter


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v1 2/3] hwmon: tmp513: Simplify with dev_err_probe()
  2023-12-01 14:51       ` Guenter Roeck
@ 2023-12-01 15:08         ` Andy Shevchenko
  0 siblings, 0 replies; 10+ messages in thread
From: Andy Shevchenko @ 2023-12-01 15:08 UTC (permalink / raw)
  To: Guenter Roeck; +Cc: linux-hwmon, linux-kernel, Eric Tremblay, Jean Delvare

On Fri, Dec 01, 2023 at 06:51:32AM -0800, Guenter Roeck wrote:
> On 12/1/23 05:53, Andy Shevchenko wrote:
> > On Thu, Nov 30, 2023 at 08:10:12PM -0800, Guenter Roeck wrote:
> > > On Tue, Nov 28, 2023 at 08:06:03PM +0200, Andy Shevchenko wrote:

...

> > > > +	if (IS_ERR(data->regmap))
> > > > +		return dev_err_probe(dev, PTR_ERR(data->regmap), "failed to allocate register map\n");
> > > 
> > > That line length was getting too long. Please consider running checkpatch
> > > on your patches.
> > 
> > I got your point, but checkpatch has no limit for the string literals, see
> > 
> > f4c014c0dede ("checkpatch: allow printk strings to exceed 80 characters to maintain their searchability")
> > ca56dc098caf ("checkpatch: check for quoted strings broken across lines")
> > 
> > So, what the exact parameters should I supply to it?
> 
> None. Please just run checkpatch.
> 
> $ scripts/checkpatch.pl index.html
> WARNING: line length of 102 exceeds 100 columns
> #126: FILE: drivers/hwmon/tmp513.c:729:
> +		return dev_err_probe(dev, PTR_ERR(data->regmap), "failed to allocate register map\n");

Ah, thanks!

-- 
With Best Regards,
Andy Shevchenko



^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2023-12-01 15:08 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-28 18:06 [PATCH v1 0/3] hwmon: tmp513: A few cleanups Andy Shevchenko
2023-11-28 18:06 ` [PATCH v1 1/3] hwmon: tmp513: Don't use "proxy" headers Andy Shevchenko
2023-12-01  4:07   ` Guenter Roeck
2023-11-28 18:06 ` [PATCH v1 2/3] hwmon: tmp513: Simplify with dev_err_probe() Andy Shevchenko
2023-12-01  4:10   ` Guenter Roeck
2023-12-01 13:53     ` Andy Shevchenko
2023-12-01 14:51       ` Guenter Roeck
2023-12-01 15:08         ` Andy Shevchenko
2023-11-28 18:06 ` [PATCH v1 3/3] hwmon: tmp513: Use SI constants from units.h Andy Shevchenko
2023-12-01  4:10   ` Guenter Roeck

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox