Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp774155pxb; Tue, 5 Apr 2022 22:46:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzr7HB0fFuta4qUPZ3RZu/6BvExvR8E/hLesHCtmoM/W5ugmprYHb/FxcTZIF2fHWo7aWAX X-Received: by 2002:a17:903:230c:b0:156:e47:387f with SMTP id d12-20020a170903230c00b001560e47387fmr7149021plh.30.1649223971061; Tue, 05 Apr 2022 22:46:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649223971; cv=none; d=google.com; s=arc-20160816; b=n2wkTdUW4i6oifuyZpaLR0O6Qkx/LLwecJjseUP5OLq3ZJ3kynxE0aYXRKqxfw/xM1 7ixqzysM7qAnFUwau5+qEan2MfVcSzy99frxwLlPYO3i12FWQVoBLdwelZN0IgOObXbW GTWSQTQAj1L3rirb+WSbeESWadGzi+9KF4NQIZQYDcgmJBRfK6MlaWwZ47CkJpDh1Srg A/oEuTR6ilmF0UpFfUy20oTbaC6IV/R6PdpETw6/R05kqJZxEm0pym5coldA7d6Iqszo gQe0AOUVRtyF61ncoLhqfIV01ltbpHrHuFLSb7eMmePGNF3Vv/1zOAuHpbkpEV/f/yLs GY7w== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=zECxJwsO2GS34erlQDicuJlY1V3q5oG58t3BBnQZALA=; b=VbV6p615yF+geSHG6cYWXY/l3YvoJbJy6D9X18UJI9HOgQH1Wm+FM7JnzOTmgbHdRd kBBP/apHF148naVwpVsxECXk2t8NPRQVWMY03icZm8zSd4TrQja29ft30YqMtL+FOS/x W2yVv70KdT62GPXyWq+54mdGkRfpeVSV6CMkjey4Jy+S/fMeBED2jZ2g4TRcb/Et0Cdg Ebz5fYNU0F7DgWMGDitLZDu/RhBLBZCmgTAYuogAJMVbhsb13BQbALEADzkheRvbJncR vfQFhAnqUNdyQZNublL4C3IfLgVVN22bZMJogRJwi2cVLIn1kaj7TNTV8CFCfvF7bzbF DzNA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=DOX81iOK; 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=linuxfoundation.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id 75-20020a63044e000000b003816043f006si14704273pge.507.2022.04.05.22.46.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Apr 2022 22:46:11 -0700 (PDT) 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=@linuxfoundation.org header.s=korg header.b=DOX81iOK; 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=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 1F260483785; Tue, 5 Apr 2022 22:10:23 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1354363AbiDEVYk (ORCPT + 99 others); Tue, 5 Apr 2022 17:24:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58506 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352028AbiDEKDt (ORCPT ); Tue, 5 Apr 2022 06:03:49 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BC375A9950; Tue, 5 Apr 2022 02:52:45 -0700 (PDT) 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 2CC4F6174D; Tue, 5 Apr 2022 09:52:45 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4090AC385A4; Tue, 5 Apr 2022 09:52:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649152364; bh=hP7Ta8lHWxh6NeT9h5JeWb6KQ3S+wTrRwcg0WqNvRtc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DOX81iOK46H6JIOeETbK7Y0LXvcCpBsq/MOJcI4yZJfFh1giBk0lD4TzLTQEPPsQw c3GCsrxH8IVZzK7tIRGHPx6cCq6BaW9+DJlYK8HHX/4ZT2rv7XBMINCCYVdjKq3QNE y/V/2AP0f21I+G6d2lVWvYFaCUePtvqbSBtMNa8E= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Zeal Robot , Jing Yao , Helge Deller , Sasha Levin Subject: [PATCH 5.15 751/913] video: fbdev: udlfb: replace snprintf in show functions with sysfs_emit Date: Tue, 5 Apr 2022 09:30:13 +0200 Message-Id: <20220405070402.344618103@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070339.801210740@linuxfoundation.org> References: <20220405070339.801210740@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,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 From: Jing Yao [ Upstream commit 81a998288956d09d7a7a2303d47e4d60ad55c401 ] Use sysfs_emit instead of scnprintf, snprintf or sprintf. Reported-by: Zeal Robot Signed-off-by: Jing Yao Signed-off-by: Helge Deller Signed-off-by: Sasha Levin --- drivers/video/fbdev/udlfb.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/video/fbdev/udlfb.c b/drivers/video/fbdev/udlfb.c index b9cdd02c1000..90f48b71fd8f 100644 --- a/drivers/video/fbdev/udlfb.c +++ b/drivers/video/fbdev/udlfb.c @@ -1426,7 +1426,7 @@ 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", + return sysfs_emit(buf, "%u\n", atomic_read(&dlfb->bytes_rendered)); } @@ -1434,7 +1434,7 @@ 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", + return sysfs_emit(buf, "%u\n", atomic_read(&dlfb->bytes_identical)); } @@ -1442,7 +1442,7 @@ 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", + return sysfs_emit(buf, "%u\n", atomic_read(&dlfb->bytes_sent)); } @@ -1450,7 +1450,7 @@ 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", + return sysfs_emit(buf, "%u\n", atomic_read(&dlfb->cpu_kcycles_used)); } -- 2.34.1