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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A39AAC43217 for ; Thu, 1 Dec 2022 03:44:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Subject:To:From:Mime-Version:Message-ID :Date:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=0aG8TfSF7FCIhskrhyz/ZG87hnVivCnQB4XYjpM2xf0=; b=fy/RBd/9FRhzca uWfel3UGG0FhmscoaVgTM2Oh9rJoiLQ7TM3uHoQbfV9LUCNfHNmBx9isfu8FZvH/pdIW152WxUc0R UURJodDYhiLU10+C+iIa8Mue0do7Lv32+OvCd+JshvcbFYK+8m7y+27aqGZrxWQQjAZpPNC6zBaVZ FlXBUb51SEwrDrNAp2RpQF89DfE87a9RAWRQ0Oq8CoOoOv60EreGccTLxxQygYlr0eMO+eeM0cyFz rDoPxOtgeR7grWu8T0CFJaXvDQPV7QrQKj9nUoc+1XZQUau2MEgzAH/xz4ct4DFKrOuKPNU9Jfr6b Tn+o7axwTn8jHL1pl58g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1p0aTT-004KSs-Mc; Thu, 01 Dec 2022 03:43:00 +0000 Received: from mxct.zte.com.cn ([183.62.165.209]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1p0aTM-004KPg-Be for linux-arm-kernel@lists.infradead.org; Thu, 01 Dec 2022 03:42:54 +0000 Received: from mse-fl2.zte.com.cn (unknown [10.5.228.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mxct.zte.com.cn (FangMail) with ESMTPS id 4NN22t4tYtz4y0vt; Thu, 1 Dec 2022 11:42:46 +0800 (CST) Received: from xaxapp01.zte.com.cn ([10.88.40.50]) by mse-fl2.zte.com.cn with SMTP id 2B13gWM9064943; Thu, 1 Dec 2022 11:42:32 +0800 (+08) (envelope-from ye.xingchen@zte.com.cn) Received: from mapi (xaxapp01[null]) by mapi (Zmail) with MAPI id mid31; Thu, 1 Dec 2022 11:42:33 +0800 (CST) Date: Thu, 1 Dec 2022 11:42:33 +0800 (CST) X-Zmail-TransId: 2af9638822a9ffffffffca187e63 X-Mailer: Zmail v1.0 Message-ID: <202212011142333790361@zte.com.cn> Mime-Version: 1.0 From: To: Subject: =?UTF-8?B?W1BBVENIXSBpaW86IGFkYzogYXQ5MS1zYW1hNWQyX2FkYzogdXNlIHN5c2ZzX2VtaXQoKSB0byBpbnN0ZWFkIG9mCgogc2NucHJpbnRmKCk=?= X-MAIL: mse-fl2.zte.com.cn 2B13gWM9064943 X-Fangmail-Gw-Spam-Type: 0 X-FangMail-Miltered: at cgslv5.04-192.168.251.13.novalocal with ID 638822B6.003 by FangMail milter! X-FangMail-Envelope: 1669866166/4NN22t4tYtz4y0vt/638822B6.003/10.5.228.133/[10.5.228.133]/mse-fl2.zte.com.cn/ X-Fangmail-Anti-Spam-Filtered: true X-Fangmail-MID-QID: 638822B6.003/4NN22t4tYtz4y0vt X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221130_194252_603620_92432B4C X-CRM114-Status: UNSURE ( 9.39 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alexandre.belloni@bootlin.com, lars@metafoo.de, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, eugen.hristev@microchip.com, claudiu.beznea@microchip.com, linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: ye xingchen Replace the open-code with sysfs_emit() to simplify the code. Signed-off-by: ye xingchen --- drivers/iio/adc/at91-sama5d2_adc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/iio/adc/at91-sama5d2_adc.c b/drivers/iio/adc/at91-sama5d2_adc.c index ed4f8501bda8..50d02e5fc6fc 100644 --- a/drivers/iio/adc/at91-sama5d2_adc.c +++ b/drivers/iio/adc/at91-sama5d2_adc.c @@ -2181,7 +2181,7 @@ static ssize_t at91_adc_get_fifo_state(struct device *dev, struct iio_dev *indio_dev = dev_to_iio_dev(dev); struct at91_adc_state *st = iio_priv(indio_dev); - return scnprintf(buf, PAGE_SIZE, "%d\n", !!st->dma_st.dma_chan); + return sysfs_emit(buf, "%d\n", !!st->dma_st.dma_chan); } static ssize_t at91_adc_get_watermark(struct device *dev, @@ -2190,7 +2190,7 @@ static ssize_t at91_adc_get_watermark(struct device *dev, struct iio_dev *indio_dev = dev_to_iio_dev(dev); struct at91_adc_state *st = iio_priv(indio_dev); - return scnprintf(buf, PAGE_SIZE, "%d\n", st->dma_st.watermark); + return sysfs_emit(buf, "%d\n", st->dma_st.watermark); } static IIO_DEVICE_ATTR(hwfifo_enabled, 0444, -- 2.25.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel