Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp2190532pxm; Fri, 4 Mar 2022 11:03:03 -0800 (PST) X-Google-Smtp-Source: ABdhPJw7u9HHi4DhgVmIqi2a0+3L4P8Z5cLWx7pqbm5XQiZTrY2HgEju6flNXtdFlRiFA9MWNUDh X-Received: by 2002:a17:902:864b:b0:14c:d45e:a77b with SMTP id y11-20020a170902864b00b0014cd45ea77bmr42388221plt.143.1646420583542; Fri, 04 Mar 2022 11:03:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646420583; cv=none; d=google.com; s=arc-20160816; b=d8vHq/NL1yOG87V+RyPyM6GB3fbrK1U1g0a0k93aFcwQtmFQlaOFmld1RoNTlGJsma 8CyKdUs+UMU0WG/Fg+9oEnd4MNwTeISxc08ubbnv1XCLxNicrW5hwUhXXo6gea67Esdm hRUKxruqKNUtV1mmuVrL52F6Ek2akpOaQOM3vllrTxrc88cG5Or/XrzD7BVGrLMFusFw epBz5YwldlTnYgWxjK3T5O3YpU9K7/eCdJNLOxEzm7jm3m5bkSj9pcL6A+R5PZl7eV4g FAVayczLzrSKR160xhNJVH/Wk1DdryHWR7zBYQZ77P0gjXJDW8Co8wPewJ0wGqDPdYbo nzfQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=WzEXAbtveB5ot6yWNbNd5fzldoWCiGLlIRwKcxx0Y+I=; b=CwbNBbQ+RJGFSJWfeWOQ3RZkEesD9m1cbvb+zxFI7IZXw/Noz8W50D6+M5HpyuCHab JLNnQYSzsWFo2yTonJxOIBHEzmcDRjFrifvk6Kj/5mSpBogNgsvq0QbY9Ufc1eeIlJEr QLJcI0DWsijx1ozRSnG5dhGmn4wP7kjSWvxzfg2dMxk520phDcTCJwpgq9miksUP+jag totsTpPTShYBmW8Uj986ORPo/yieTFXN3gNRZxg0Orr/DsloUzXHAPE6oRtQOenXmFww UjJf/EcGzvq6TFYAEpn2N+6SaOforgUEOt52MebzXR0K/MfJAcVyp2bFU4/EfwHs8ILN iwAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=gLFqlD+4; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id q14-20020a17090a2e0e00b001bd14e01f15si303662pjd.3.2022.03.04.11.03.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Mar 2022 11:03:03 -0800 (PST) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=gLFqlD+4; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id E94191DBAB6; Fri, 4 Mar 2022 11:01:25 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241484AbiCDSDg (ORCPT + 99 others); Fri, 4 Mar 2022 13:03:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33066 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241434AbiCDSDc (ORCPT ); Fri, 4 Mar 2022 13:03:32 -0500 Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 51EB8C2E; Fri, 4 Mar 2022 10:02:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1646416964; x=1677952964; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=Fk0NmpMavnWYkydBGsrkM2BDEq+2Txts8Ye4yYDMtrI=; b=gLFqlD+4WYIVv6JybElhjaruRrtyWkxjmlo3d715W3OGg9zdEp4QusAz NfQVISeMMViXeGEPkSIEZKdxVwNoOygvgEi58SPwXnDJGfa3+yyF0I/XS 1rx4hqBLzK9N7IQA+Pe8U7mypG8qUfUPp7CC3RcxlgpUTkkSJmeVdNo15 uC2kWyDiguYO9BQssNA+C19UZKKLFYP4eo3RdkpD1E/I9FtPWq5j1Yeq6 dr4BXcFXlNN4Zp/IPJgl+/HwZmkFGg1M4IM03htSmeMgSOTTRIB6LDq0g e2B795XFk1h5cm8xijFiocifVCTtVDmyc89cr4qNcxzicOjb5SB4zZ+z5 w==; X-IronPort-AV: E=McAfee;i="6200,9189,10276"; a="278720925" X-IronPort-AV: E=Sophos;i="5.90,155,1643702400"; d="scan'208";a="278720925" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Mar 2022 10:02:44 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.90,155,1643702400"; d="scan'208";a="686945213" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga001.fm.intel.com with ESMTP; 04 Mar 2022 10:02:42 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 4C937A7; Fri, 4 Mar 2022 20:03:00 +0200 (EET) From: Andy Shevchenko To: Andy Shevchenko , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Cc: =?UTF-8?q?Nuno=20S=C3=A1?= , Jonathan Cameron , Lars-Peter Clausen Subject: [PATCH v4 1/3] iio: temperature: ltc2983: Don't hard code defined constants in messages Date: Fri, 4 Mar 2022 20:02:55 +0200 Message-Id: <20220304180257.80298-1-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Reviewed-by: Nuno Sá --- v4: no changes 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; -- 2.34.1