Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp710500pxb; Tue, 5 Apr 2022 19:47:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJweKA7Sq2GicUc6AaTa7mJ5t+AGo27RJQAr2kDBs3w6gablM9pIYCxarV0JY2pszqsEI/S4 X-Received: by 2002:a50:d78e:0:b0:416:2cd7:7ac5 with SMTP id w14-20020a50d78e000000b004162cd77ac5mr6577964edi.320.1649213271396; Tue, 05 Apr 2022 19:47:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649213271; cv=none; d=google.com; s=arc-20160816; b=lVIt9BAzmfqbOmnfXpWQ+eJKvYEsbRjhMhk9Ta3obN/EHlkv6Cxi3ojTqkVC/PvuUY Juzti99Jh2HceW3q8lTipdILYkIhJ2FKjBJfE5eOtVDRVOKdagfNT8iLlzrNbaX+DiKo Se0ynAG1AEjt6lb1id9yOZwyRUx87OuD79SX3mvafzJpuCCPzK2GGd2pwWGhKGGTIBIP G3tIpGKrOaIpUrANkKKCDtGE8M6BiMyV9ARwOOQCxPsheEkWLcZ8aL0NN7/nw+RqhaL8 DoGx4Cui1Km4wskQ6uDzi1P7X40w4bzAXYzIXPoOw7Zj8s6rKVnZlyTU+USGU9S6zB8W Y8ew== 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=mRFz1gSHIUkB2YjPr1F+OdvY7GWejB/RW+huenb84KS8C55uOwggUJfEIWEQh8eNWT w/y2mGY7k3wc2kWPYg9iSKuac4Q/0wsOxZcSmpTUr1mw00sx/eLama4XxLTvYNymXfN8 rwtJknhb9YuWxZDB3YxctJbUrnATDUO8KYM31yoekAprezUAym0wjdWsbUVbEj8Dmo4O LUVZd6uP5aaSC/BXl4NJhlZpBfopsVQ/618qKIoeYnvW8kPUcaBKs0n/Cz7O5Q0W/NPr Wcn1cV8bZaisS4SOSEZQl5MO1sBav0LQel4nu66pV1oqFnCxL7CrhadbwhfZ6yLseN54 s79A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=maMqZ1VJ; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b12-20020a056402084c00b00418c2b5bd7esi11177706edz.96.2022.04.05.19.47.21; Tue, 05 Apr 2022 19:47:51 -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; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=maMqZ1VJ; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352421AbiDEKEd (ORCPT + 99 others); Tue, 5 Apr 2022 06:04:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52918 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237059AbiDEI3F (ORCPT ); Tue, 5 Apr 2022 04:29:05 -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 B1E9315FC9; Tue, 5 Apr 2022 01:21:12 -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 1F55561001; Tue, 5 Apr 2022 08:21:12 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 33467C385A0; Tue, 5 Apr 2022 08:21:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649146871; bh=hP7Ta8lHWxh6NeT9h5JeWb6KQ3S+wTrRwcg0WqNvRtc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=maMqZ1VJ+BT0/sHcM4x/Dvmnr8F3Bra5KY35fhaKqKfe/+sGip7FqK29MAKpMKCe9 PJM2Y1Ghvxqn66Gtzmd6W0zmt5WiRcgY+1zfweLsZM6KXsiLwJBBIO/Gg6ZcBV3v2d J22m3hPAuAn2Q1jYtTMiYPuBt2PW81h0H6hFfnKc= 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.17 0917/1126] video: fbdev: udlfb: replace snprintf in show functions with sysfs_emit Date: Tue, 5 Apr 2022 09:27:44 +0200 Message-Id: <20220405070434.437944181@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070407.513532867@linuxfoundation.org> References: <20220405070407.513532867@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=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, 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 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