All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org,
	"Nuno Sá" <nuno.sa@analog.com>,
	"Lars-Peter Clausen" <lars@metafoo.de>
Subject: Re: [PATCH v3 1/3] iio: temperature: ltc2983: Don't hard code defined constants in messages
Date: Sun, 13 Feb 2022 17:55:59 +0000	[thread overview]
Message-ID: <20220213175559.46e8dee2@jic23-huawei> (raw)
In-Reply-To: <20220210135522.26562-1-andriy.shevchenko@linux.intel.com>

On Thu, 10 Feb 2022 15:55:20 +0200
Andy Shevchenko <andriy.shevchenko@linux.intel.com> wrote:

> In a couple of messages the constants, which have their definitions,
> are hard coded into the message text. Unhardcode them.
> 
> While at it, add a trailing \n where it's currently missing.
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> Reviewed-by: Nuno Sá <nuno.sa@analog.com>

Mostly so I can remember what is going on with this patch,
Nuno is OoO and planning to test this series when he returns.

Given that I'll wait on Nuno's testing.

Thanks,

Jonathan

> ---
> v3: added \n, used %u (Joe)
>  drivers/iio/temperature/ltc2983.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/iio/temperature/ltc2983.c b/drivers/iio/temperature/ltc2983.c
> index 301c3f13fb26..94d6dd4db47a 100644
> --- a/drivers/iio/temperature/ltc2983.c
> +++ b/drivers/iio/temperature/ltc2983.c
> @@ -409,8 +409,8 @@ static struct ltc2983_custom_sensor *__ltc2983_custom_sensor_new(
>  	new_custom->size = n_entries * n_size;
>  	/* check Steinhart size */
>  	if (is_steinhart && new_custom->size != LTC2983_CUSTOM_STEINHART_SIZE) {
> -		dev_err(dev, "Steinhart sensors size(%zu) must be 24",
> -							new_custom->size);
> +		dev_err(dev, "Steinhart sensors size(%zu) must be %u\n", new_custom->size,
> +			LTC2983_CUSTOM_STEINHART_SIZE);
>  		return ERR_PTR(-EINVAL);
>  	}
>  	/* Check space on the table. */
> @@ -1299,8 +1299,8 @@ static int ltc2983_parse_dt(struct ltc2983_data *st)
>  		if (sensor.chan < LTC2983_MIN_CHANNELS_NR ||
>  		    sensor.chan > LTC2983_MAX_CHANNELS_NR) {
>  			ret = -EINVAL;
> -			dev_err(dev,
> -				"chan:%d must be from 1 to 20\n", sensor.chan);
> +			dev_err(dev, "chan:%d must be from %u to %u\n", sensor.chan,
> +				LTC2983_MIN_CHANNELS_NR, LTC2983_MAX_CHANNELS_NR);
>  			goto put_child;
>  		} else if (channel_avail_mask & BIT(sensor.chan)) {
>  			ret = -EINVAL;


  parent reply	other threads:[~2022-02-13 17:49 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-10 13:55 [PATCH v3 1/3] iio: temperature: ltc2983: Don't hard code defined constants in messages Andy Shevchenko
2022-02-10 13:55 ` [PATCH v3 2/3] iio: temperature: ltc2983: Use single error path to put OF node Andy Shevchenko
2022-02-10 13:55 ` [PATCH v3 3/3] iio: temperature: ltc2983: Make use of device properties Andy Shevchenko
2022-03-03 13:31   ` Sa, Nuno
2022-03-03 13:57     ` Andy Shevchenko
2022-03-03 14:53       ` Sa, Nuno
2022-03-03 14:23     ` Andy Shevchenko
2022-03-03 14:27       ` Andy Shevchenko
2022-03-03 14:52         ` Sa, Nuno
2022-02-13 17:55 ` Jonathan Cameron [this message]
2022-02-14  9:23   ` [PATCH v3 1/3] iio: temperature: ltc2983: Don't hard code defined constants in messages Andy Shevchenko
2022-03-02 15:50   ` Andy Shevchenko
2022-03-02 19:56     ` Nuno Sá

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220213175559.46e8dee2@jic23-huawei \
    --to=jic23@kernel.org \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nuno.sa@analog.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.