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 5138AC4321E for ; Sun, 4 Dec 2022 18:54:34 +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:MIME-Version:References:In-Reply-To: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=mpsl2b3Qp+c3tkb/pmANjkTuE16ZR4nik5POcSrpdHc=; b=tY8lwA86s3iyTi Bw0/gqpikM1bgez+uPYDarZbPj5rmzXkNNp7EUwcYNRuOvZZx2ePgrkzQx9wMbQHL/9CzOMo6Ssdj xQSASwoQkSa9AwDTbFVRW0lAspCtpx7T4mdg8f7uRc0zvf3otvboRJrg/B+ROsd1ma0oOxEDq0rR6 N1wobnYwD2lVoh27Yth2JziK9SWBvVcDv6BlJWQtD/qhCed1UnsZ+TsgpfNtboaW0q2jr8h19nyCF igUM1GqI94n9YORzv663mIsKzfWB3Qwau0jwNvZ0WVbWRyFh2ajyekdvaoMlMuLCpbJyRzQA7YsGE I/+6UmE94urKqTjPQtag==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1p1u7E-00AQ5U-LU; Sun, 04 Dec 2022 18:53:29 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1p1qzq-009L9n-Il for linux-arm-kernel@lists.infradead.org; Sun, 04 Dec 2022 15:33:39 +0000 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 dfw.source.kernel.org (Postfix) with ESMTPS id E969A60EAE; Sun, 4 Dec 2022 15:33:36 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 29C36C433C1; Sun, 4 Dec 2022 15:33:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1670168015; bh=yxKf05+cFmoyI5uei5HHUeN5U35ydw6bkv8/4NHs5O8=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=ELgifSQkKU4A+1JzRiGvD7bTznHKS72pg+BDZRe4cUG0R6dKmwqMCgMiXTpXHMTCn bDTmrpgfrr1w07AMOJGAJhASWZ38b889pBJgAiDFlMFTsmA7ISUdkh+SAvaZ/210FU CCDCGV0jaSugJdN514xNHZuP3kh9tKyy/S4sQx2CWGIEFsPH0xaSDPlEroPufnQfNz I5TudLa8nQigMXTR2muAA/2w5iqPDnDt8nhSs/VMUvvma1WA9aR20mZ7a/4Id1XZCX wcgngIuRezRpHbLU0g3JXzbZLtaW5L/f/itoehO1Z1a2/C6NvW8NUTluwaK3vroyB7 vFZD80jO4Xq9g== Date: Sun, 4 Dec 2022 15:46:21 +0000 From: Jonathan Cameron To: Subject: Re: [PATCH] iio: adc: at91-sama5d2_adc: use sysfs_emit() to instead of scnprintf() Message-ID: <20221204154621.3b76d888@jic23-huawei> In-Reply-To: <202212011142333790361@zte.com.cn> References: <202212011142333790361@zte.com.cn> X-Mailer: Claws Mail 4.1.1 (GTK 3.24.34; x86_64-pc-linux-gnu) MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221204_073338_702271_3125096D X-CRM114-Status: GOOD ( 16.74 ) 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 On Thu, 1 Dec 2022 11:42:33 +0800 (CST) wrote: > From: ye xingchen > > Replace the open-code with sysfs_emit() to simplify the code. > > Signed-off-by: ye xingchen Applied. Thanks, Jonathan > --- > 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, _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel