Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp803151pxb; Tue, 2 Feb 2021 19:25:50 -0800 (PST) X-Google-Smtp-Source: ABdhPJw6Vtk0nasMn0/+7dANZSXTieFmVQekOt0wP7/miGieV0beV2IVaxibWN1sQUGEcIVgaUH7 X-Received: by 2002:a17:906:8611:: with SMTP id o17mr1116158ejx.145.1612322750432; Tue, 02 Feb 2021 19:25:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612322750; cv=none; d=google.com; s=arc-20160816; b=1C1v2KhurTVmrBrVNe9rxtaPJO91a128xrzog/qJi5v28PgcddOHW8w0PidsssfXtn J6yvkOn16rnuJIsq6p1Y146mlhNuvHWaHBl8eS/aj7jDCwQKhk/WOrqj8zDQl6Ht0GxK 6UFOfc0MU1RvZrWS+5LtjbfMJ6QTgv3Hy4AjnnFgR13dXnayPpyt2ZFfZjmnoxPav7kL dOxLuvvMh66f/SVBWu20Xex2bmXccD5+hbhg+EL9QRlqi+xsH4x9sqGvODrd84MFQe2r XmjU2RoYsDpPQsd4A/mn3gR1D02+pPi5XltyiBDBaBrBHkljF5eF7+YXvRr01eeubOcp uolA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from; bh=n6DgeZ4CS+JQKX+H7/BOYjVtPdGVBgjVMeBB3o7DASE=; b=yr31e6FIgWSj6t0fsB9HbL/qGWHAMXZvmhq2UJzsnaFsVRPJHStFxlmp03Ug3klkvJ AhtONBwjzvWOqNSke2SxtLqpxtHJe0mrl8gzsqCbOZOXlTMQtrW2IT8Oi0DpfFy1RNJT 4x+G0saxqYhE3vNAwewKnMBqi3XR1BAXwHRVr9y9eNW65i9qPvH68ip6nNdrX6KymsbO aRkj91rlNWWsBg5jvt9C4Fu9rQU3I1ruLorRLhz33DmEln1gIHNtGl/ZWbgP4181isrD iiXPrLd9UzrVfdXacT1TA5Dlf3sA5+m+ot1VdaNhpR37UYrdrRWW6wfRyC4F1jCes6SC 868Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z17si553108ejc.207.2021.02.02.19.25.26; Tue, 02 Feb 2021 19:25:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232951AbhBCDXI (ORCPT + 99 others); Tue, 2 Feb 2021 22:23:08 -0500 Received: from out30-132.freemail.mail.aliyun.com ([115.124.30.132]:39741 "EHLO out30-132.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232897AbhBCDWQ (ORCPT ); Tue, 2 Feb 2021 22:22:16 -0500 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R171e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04394;MF=jiapeng.chong@linux.alibaba.com;NM=1;PH=DS;RN=5;SR=0;TI=SMTPD_---0UNj9Q.4_1612322530; Received: from j63c13417.sqa.eu95.tbsite.net(mailfrom:jiapeng.chong@linux.alibaba.com fp:SMTPD_---0UNj9Q.4_1612322530) by smtp.aliyun-inc.com(127.0.0.1); Wed, 03 Feb 2021 11:22:15 +0800 From: Jiapeng Chong To: bernie@plugable.com Cc: linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Jiapeng Chong Subject: [PATCH] video: udlfb: convert sysfs sprintf/snprintf family to sysfs_emit Date: Wed, 3 Feb 2021 11:22:09 +0800 Message-Id: <1612322529-40629-1-git-send-email-jiapeng.chong@linux.alibaba.com> X-Mailer: git-send-email 1.8.3.1 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Fix the following coccicheck warning: ./drivers/video/fbdev/udlfb.c:1452:8-16: WARNING: use scnprintf or sprintf. ./drivers/video/fbdev/udlfb.c:1444:8-16: WARNING: use scnprintf or sprintf. ./drivers/video/fbdev/udlfb.c:1436:8-16: WARNING: use scnprintf or sprintf. ./drivers/video/fbdev/udlfb.c:1428:8-16: WARNING: use scnprintf or sprintf. Reported-by: Abaci Robot Signed-off-by: Jiapeng Chong --- drivers/video/fbdev/udlfb.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/video/fbdev/udlfb.c b/drivers/video/fbdev/udlfb.c index f9b3c1c..d8c086d 100644 --- a/drivers/video/fbdev/udlfb.c +++ b/drivers/video/fbdev/udlfb.c @@ -1425,32 +1425,28 @@ static ssize_t metrics_bytes_rendered_show(struct device *fbdev, struct device_attribute *a, char *buf) { struct fb_info *fb_info = dev_get_drvdata(fbdev); struct dlfb_data *dlfb = fb_info->par; - return snprintf(buf, PAGE_SIZE, "%u\n", - atomic_read(&dlfb->bytes_rendered)); + return sysfs_emit(buf, "%u\n", atomic_read(&dlfb->bytes_rendered)); } static ssize_t metrics_bytes_identical_show(struct device *fbdev, struct device_attribute *a, char *buf) { struct fb_info *fb_info = dev_get_drvdata(fbdev); struct dlfb_data *dlfb = fb_info->par; - return snprintf(buf, PAGE_SIZE, "%u\n", - atomic_read(&dlfb->bytes_identical)); + return sysfs_emit(buf, "%u\n", atomic_read(&dlfb->bytes_identical)); } static ssize_t metrics_bytes_sent_show(struct device *fbdev, struct device_attribute *a, char *buf) { struct fb_info *fb_info = dev_get_drvdata(fbdev); struct dlfb_data *dlfb = fb_info->par; - return snprintf(buf, PAGE_SIZE, "%u\n", - atomic_read(&dlfb->bytes_sent)); + return sysfs_emit(buf, "%u\n", atomic_read(&dlfb->bytes_sent)); } static ssize_t metrics_cpu_kcycles_used_show(struct device *fbdev, struct device_attribute *a, char *buf) { struct fb_info *fb_info = dev_get_drvdata(fbdev); struct dlfb_data *dlfb = fb_info->par; - return snprintf(buf, PAGE_SIZE, "%u\n", - atomic_read(&dlfb->cpu_kcycles_used)); + return sysfs_emit(buf, "%u\n", atomic_read(&dlfb->cpu_kcycles_used)); } static ssize_t edid_show( -- 1.8.3.1