From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E5804C433EF for ; Sun, 20 Mar 2022 15:48:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236852AbiCTPtf (ORCPT ); Sun, 20 Mar 2022 11:49:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51896 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233295AbiCTPte (ORCPT ); Sun, 20 Mar 2022 11:49:34 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AF71240902; Sun, 20 Mar 2022 08:48:10 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 63D6EB80B95; Sun, 20 Mar 2022 15:48:09 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3CFBAC340E9; Sun, 20 Mar 2022 15:48:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1647791288; bh=gF1b2RX+zCM5oK/wIC5CVU46M+hHdRSc8f+Jo5E+QXs=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=jOTc3Ka7YW3qC4S9fMrs+dNMGWeuTnjTNOuVqCMwIcZkwGwQ8jHm09WY/P2cTMstr MjDl9MffxLSmYPvV9dso9orb79Z0FrxPm/SSM7Pc//j+UNFW5lRPU/Xc8+WVyUt/XJ no2dn2HTT/0AIl1DdFP3B8FK56lS543ulIUSRltKYDhregPxT/lHFzk65FLmOEg9fa GAQZJc4q8u8F8BkVhuez6OQbJgAm4n9ExJJ9zjpxVxQm0mZZu7MaJOy0n4XR+aJMNH 0vwL1dcz7cf4wFurwK1psZgpc6tsOSPyEA2UJ/bRiyposKsnqo0cayEn3qPZYqj7eR u30aGmkuh2+Cg== Date: Sun, 20 Mar 2022 15:55:31 +0000 From: Jonathan Cameron To: Andy Shevchenko Cc: Nuno =?UTF-8?B?U8Oh?= , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, Lars-Peter Clausen Subject: Re: [PATCH v5 1/3] iio: temperature: ltc2983: Don't hard code defined constants in messages Message-ID: <20220320155531.19e13a5c@jic23-huawei> In-Reply-To: <20220307203606.87258-1-andriy.shevchenko@linux.intel.com> References: <20220307203606.87258-1-andriy.shevchenko@linux.intel.com> X-Mailer: Claws Mail 4.0.0 (GTK+ 3.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org On Mon, 7 Mar 2022 22:36:04 +0200 Andy Shevchenko wrote: > In a couple of messages the constants, which have their definitions, > are hard coded into the message text. Unhardcode them. >=20 > While at it, add a trailing \n where it's currently missing. >=20 > Signed-off-by: Andy Shevchenko > Reviewed-by: Nuno S=C3=A1 Series applied to the togreg branch of iio.git, but that will be rebased so for now this will only be visible in the testing branch intended to let 0-day poke at it. Thanks, Jonathan > --- > v5: no changes > v4: no changes > v3: added \n, used %u (Joe) > drivers/iio/temperature/ltc2983.c | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) >=20 > 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 =3D n_entries * n_size; > /* check Steinhart size */ > if (is_steinhart && new_custom->size !=3D 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->s= ize, > + 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 =3D -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 =3D -EINVAL;