Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp8093006rwd; Tue, 20 Jun 2023 10:03:31 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4zIbYl1KLKrCU/lQIqburcX9x9CQygUVHpTHFYKJGqEyaAOjK8gsHEMj8OyH6z3vOUodJ3 X-Received: by 2002:a17:90b:100e:b0:25b:d5ab:7198 with SMTP id gm14-20020a17090b100e00b0025bd5ab7198mr7015086pjb.27.1687280611263; Tue, 20 Jun 2023 10:03:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687280611; cv=none; d=google.com; s=arc-20160816; b=LUvaXe6L6avU/dccXtcv49IqvFAUOQJ9oHeY5j0CIDDy7Q81riBns9m+a8ABW8GS+v /mdURQVaVWTbHux1Qiwbi1NsqS08nD/RQx/OYiqXnYoRjZBU0q/eanQqQSeCCzYpewSv j1MSyW8ZyDvnaKfQw+TRQeBLwMMhi4kAWSCcObhvqbs1MXVJSUnppHyoC87OJ3CyiS+G Su3y+/nIm/Rq5xyrCbAkazoZtX/JcU5U/+9yHM1pv7kPHjxHhH/d1+8fN4JMkoD6qw4q JLCaiP9klgzdeKwmLCsFyvHvLhYqeh9qVyALdDk6jr7awPNIacAxxOlNVxaCY9HjANTs pKSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:content-transfer-encoding:mime-version :message-id:date:subject:cc:from; bh=xWhDK7d2C7PPTrb0dhtoRt9rNwCvg514aGz22fvMpXQ=; b=Ru6+60qG+e7ucZ9S4/E/6Yb8RnRb7nDhqpZB5vg8A84OCJKbrVLnjLAwhfQMDoemLd afV1D0uft7o20HTdHinUlT+bEWTtlFoizbZQMp8QXfvDL8+tXxq3MuPuzFipPFk8LJMg 6ol5mGjyDj6wUe3Rqw0cwjnJ80if1ikErexThlYrGyYegE9Vx/VZdtT5QJWM7Sm3yDNG CCZBvjzGyk2rEySlio2ohMFghOO+fgzXg1vTVIXzftppKx6ldEfOJgDe2Od7qfUSPrsK /EYM3beGfRmY4mvNoJflnpABKbR8nFcIB7nNiPgyvTXmAjMOHTHWyaBZOnv8VsDY816v X2nA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=analog.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f15-20020a17090a664f00b00244883db2c7si9784662pjm.99.2023.06.20.10.03.16; Tue, 20 Jun 2023 10:03:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=analog.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232583AbjFTQdp (ORCPT + 99 others); Tue, 20 Jun 2023 12:33:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56872 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231888AbjFTQd1 (ORCPT ); Tue, 20 Jun 2023 12:33:27 -0400 Received: from mx0a-00128a01.pphosted.com (mx0a-00128a01.pphosted.com [148.163.135.77]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 139F12689; Tue, 20 Jun 2023 09:32:55 -0700 (PDT) Received: from pps.filterd (m0167088.ppops.net [127.0.0.1]) by mx0a-00128a01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 35KFtnH1014549; Tue, 20 Jun 2023 12:32:21 -0400 Received: from nwd2mta3.analog.com ([137.71.173.56]) by mx0a-00128a01.pphosted.com (PPS) with ESMTPS id 3r96p6b3kh-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 20 Jun 2023 12:32:20 -0400 Received: from ASHBMBX8.ad.analog.com (ASHBMBX8.ad.analog.com [10.64.17.5]) by nwd2mta3.analog.com (8.14.7/8.14.7) with ESMTP id 35KGWJnV030201 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 20 Jun 2023 12:32:19 -0400 Received: from ASHBMBX8.ad.analog.com (10.64.17.5) by ASHBMBX8.ad.analog.com (10.64.17.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.14; Tue, 20 Jun 2023 12:32:18 -0400 Received: from zeus.spd.analog.com (10.66.68.11) by ashbmbx8.ad.analog.com (10.64.17.5) with Microsoft SMTP Server id 15.2.986.14 via Frontend Transport; Tue, 20 Jun 2023 12:32:18 -0400 Received: from dariana.ad.analog.com ([10.48.65.200]) by zeus.spd.analog.com (8.15.1/8.15.1) with ESMTP id 35KGW55J008488; Tue, 20 Jun 2023 12:32:08 -0400 From: Alisa Roman CC: Alisa Roman , Lars-Peter Clausen , Michael Hennerich , Alexandru Tachici , Jonathan Cameron , , Subject: [PATCH] iio: adc: ad7192: Use sysfs_emit_at Date: Tue, 20 Jun 2023 19:31:35 +0300 Message-ID: <20230620163135.93780-1-alisa.roman@analog.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-ADIRuleOP-NewSCL: Rule Triggered X-Proofpoint-GUID: 5_RkJXs0pLzrHbR2iVv0CznXxOsLVgIY X-Proofpoint-ORIG-GUID: 5_RkJXs0pLzrHbR2iVv0CznXxOsLVgIY X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26 definitions=2023-06-20_11,2023-06-16_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 impostorscore=0 bulkscore=0 priorityscore=1501 mlxscore=0 suspectscore=0 lowpriorityscore=0 malwarescore=0 adultscore=0 clxscore=1015 spamscore=0 mlxlogscore=853 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2305260000 definitions=main-2306200149 X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Replace scnprintf with sysfs_emit_at which is the preferred alternative. Also make sure each fractional digit is in its place by padding with zeros up to 3 digits: "...%03d...". Signed-off-by: Alisa Roman --- drivers/iio/adc/ad7192.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/iio/adc/ad7192.c b/drivers/iio/adc/ad7192.c index e23d9a7dcc9e..c980bc871412 100644 --- a/drivers/iio/adc/ad7192.c +++ b/drivers/iio/adc/ad7192.c @@ -561,9 +561,8 @@ static ssize_t ad7192_show_filter_avail(struct device *dev, ad7192_get_available_filter_freq(st, freq_avail); for (i = 0; i < ARRAY_SIZE(freq_avail); i++) - len += scnprintf(buf + len, PAGE_SIZE - len, - "%d.%d ", freq_avail[i] / 1000, - freq_avail[i] % 1000); + len += sysfs_emit_at(buf, len, "%d.%03d ", freq_avail[i] / 1000, + freq_avail[i] % 1000); buf[len - 1] = '\n'; -- 2.34.1