Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp15455pxb; Wed, 30 Mar 2022 21:31:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyiS4w9fenBKk0hTM/PVmASy/+TpbfM4Ad7VYbAxdRBa9T6VdafoqiFx51l1ijINh+h0maL X-Received: by 2002:a05:6a00:8cc:b0:4cb:b981:2676 with SMTP id s12-20020a056a0008cc00b004cbb9812676mr3367831pfu.5.1648701109806; Wed, 30 Mar 2022 21:31:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648701109; cv=none; d=google.com; s=arc-20160816; b=oJr1gEQvkDdPHD3QYGBcDnMXTxToWs5Iw0QF57hfnqqnwxTs/Bg2GiociFioM+sxqT 6/PKjBOvKNTXv2uX46bliAgrTa9fQX/P2Lx7s5INtUnKLjU5bri+ycQcuC1qEG5tHoY0 H5i5GwSVnFU3ou0acI3EkMo5w4lmfFIbQ19diRxqc4kkgSkwKByLQyzDyBHKbrzzGMdi UcjURR9Jc3KWnUGYAB8x1B84sTgiDlbVeZcKdeJfs42w7gaW6MJRUBN2U2FMSmCsxxB2 ggd//YCSBtJryXd4IsZGhtSmMbJPx/ksR9N8H6WAuQk8OnU+fnD0pliu1nQoQNyHZa3v BOgA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=zECxJwsO2GS34erlQDicuJlY1V3q5oG58t3BBnQZALA=; b=RWwtrGPfDQqEDssrlhGeMH0ccq+LrjEEFYP1EZ3NHYIN7PrqZusGWckjLoCjjuBphK tweuxRPQ+G/gmTiK6XNXCOf9uxQQMxbPtUQIRFWGl1BV6pB/BW1oUcD8UGaTcifR+XE/ A0Q1aQgYqObU1KCWTI4FkbYWsNd+sRzIjBfgKiIO7R1uQic1KZCNjd0eYlfV/yHJtDEw 5uYyqCnEguOd4KzlW4CBtY0T1IWLHTsOlgCopAXDjodx3bVjlxQ78j4qFE1r6Yt2ZzRj RnNsNo7SUfLXKirOOPGNVs9r12t7Tx+AgFw5bml+/vOYnksqC9RHc4d2RFFMdmRoE4sT ZKUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=nKzquNuG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id x19-20020a056a00189300b004fa3a8e0081si28873273pfh.312.2022.03.30.21.31.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Mar 2022 21:31:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=nKzquNuG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 7915E1D8311; Wed, 30 Mar 2022 20:24:55 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344218AbiC3MAL (ORCPT + 99 others); Wed, 30 Mar 2022 08:00:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33220 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344693AbiC3LxZ (ORCPT ); Wed, 30 Mar 2022 07:53:25 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 182CC26C546; Wed, 30 Mar 2022 04:49:26 -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 ams.source.kernel.org (Postfix) with ESMTPS id 4E069B81C29; Wed, 30 Mar 2022 11:49:19 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1B05DC34112; Wed, 30 Mar 2022 11:49:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1648640958; bh=hP7Ta8lHWxh6NeT9h5JeWb6KQ3S+wTrRwcg0WqNvRtc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nKzquNuGgbBdVaYNa++gnkiKLDG7tNUNcPV/Kqx9LVnL4UrK+9Wqw1fSNLobk5gtL AM/WGxNU3GrGi5U+q5P1aC2lZzkG9dz4PvIsFzKO8EK8XUlQFLcDl5zzCmLv9/bwal puyTr5FSWJCb5Gs68aBc9W5OCoN6+c9n7v32uWlf8k73jco++2wYdzNwog5HO6zCFo 4RnSJuKfon1wCaX0Zz6p14Ho4lDM68snMIU5Vx6SXYy+2bxDjaox6bYxk4n8J/jpjt /oVBCMK0NqzW/j6ejxjfRm9FfD3Lk7FTO5fHaq0Vl1DAFlMPqFJFsf7RIqWH0gDF/j +H4AhTOcdeWSg== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Jing Yao , Zeal Robot , Helge Deller , Sasha Levin , bernie@plugable.com, tomi.valkeinen@ti.com, linux-fbdev@vger.kernel.org Subject: [PATCH AUTOSEL 5.16 29/59] video: fbdev: udlfb: replace snprintf in show functions with sysfs_emit Date: Wed, 30 Mar 2022 07:48:01 -0400 Message-Id: <20220330114831.1670235-29-sashal@kernel.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220330114831.1670235-1-sashal@kernel.org> References: <20220330114831.1670235-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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