From patchwork Fri Nov 19 07:31:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guo Zhengkui X-Patchwork-Id: 12628415 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0696EC433EF for ; Fri, 19 Nov 2021 07:33:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D9EDB61A09 for ; Fri, 19 Nov 2021 07:33:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229972AbhKSHgR (ORCPT ); Fri, 19 Nov 2021 02:36:17 -0500 Received: from mail-sgaapc01on2135.outbound.protection.outlook.com ([40.107.215.135]:18113 "EHLO APC01-SG2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S229523AbhKSHgQ (ORCPT ); Fri, 19 Nov 2021 02:36:16 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=g2jcRIQICQHuQmvFSZRIDmsRfC/Ja3gdo5o9+Axlree0NmsZznQLASC6uody6df2Z+tWSWZAQAnaw45mP52VNPim76vIaqjGlesJs2xTTkd/zRdC0EoVVNHm0CsWjUcyZXqCVAWF1Kzx6aN885a3hy/l0jSTkODC7Ctq3TCgh6QA1G3A4y5n6JMX8kXc1jlZ1KG8xhPHjbK6Zu5XEshFEhkq3N2NuFIPMjRKi+5/vFES5D0QQ51yeOLQjSMAXa/arq546ff8U6GW8Z01BPVrT/P/MukLmuCgfQbX/J8VSybTylt4nEFtTM4uip4som3uh7z7BGtnTC/as7CKN9Q3bg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=H7WGpVYbJ2fu58L5txpZ47ZzRmzY1LIqlcm0FX3LOO0=; b=PkeHvhwi/Iz5OmkRNse+QEDmst39CNKTgtQqqTH3PsDwwyfRp4pRuj3cReXx7n3PjiL0R/kwAeIzrwSMbAlD2BQBKmaCWN8CyqNGAjlaAzKOBO4gIZ/KSGF0ZKSROZEMg4JOJu3BTdqHVDZqGKac5dgE0pWgOM/EWqOM0nEuNcgcZbi6EV8iyO18nIitkAOPmYf+vmJhIx7vfQWj3gST/MJpYp1yJCTl30R+FABvWBxhUyg4a0al1UrvYhF4bEtxdzABdiUqOzYTAlSU+5KneXIfQEvzhi7QXE+mtSQ7NBv8oDrVPwza5LrA8w8WHGBRUTeO86Hupyo+5JQsh1XeUA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=vivo.com; dmarc=pass action=none header.from=vivo.com; dkim=pass header.d=vivo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vivo0.onmicrosoft.com; s=selector2-vivo0-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=H7WGpVYbJ2fu58L5txpZ47ZzRmzY1LIqlcm0FX3LOO0=; b=LGPfMP0/N3AaJG96QH3QXv1UN49ukxBb4ifkHqb+tGjMZGPJoWiugrRAFRoDETM0ieQM/oQyCQUhfeBs/QBDQA2SiQPqoOjSQ+RnfiUApjxK0c0yJedjA2y/IQdi5p1loQ/rnAqKA3+5GUcMaOBjS6EWMAiBdWQLVqUaveiuNRI= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=vivo.com; Received: from HK2PR06MB3492.apcprd06.prod.outlook.com (2603:1096:202:2f::10) by HK2PR0601MB2033.apcprd06.prod.outlook.com (2603:1096:202:8::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4713.19; Fri, 19 Nov 2021 07:33:11 +0000 Received: from HK2PR06MB3492.apcprd06.prod.outlook.com ([fe80::814a:4668:a3bd:768]) by HK2PR06MB3492.apcprd06.prod.outlook.com ([fe80::814a:4668:a3bd:768%7]) with mapi id 15.20.4713.022; Fri, 19 Nov 2021 07:33:10 +0000 From: Guo Zhengkui To: "Gustavo A. R. Silva" , Sam Ravnborg , Guo Zhengkui , linux-fbdev@vger.kernel.org, linux-omap@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Cc: kernel@vivo.com Subject: [PATCH] video: omapfb: Use sysfs_emit() instead of snprintf() Date: Fri, 19 Nov 2021 15:31:26 +0800 Message-Id: <20211119073139.18832-1-guozhengkui@vivo.com> X-Mailer: git-send-email 2.20.1 X-ClientProxiedBy: SG2PR03CA0125.apcprd03.prod.outlook.com (2603:1096:4:91::29) To HK2PR06MB3492.apcprd06.prod.outlook.com (2603:1096:202:2f::10) MIME-Version: 1.0 Received: from guozhengkui.debian (203.90.234.87) by SG2PR03CA0125.apcprd03.prod.outlook.com (2603:1096:4:91::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4734.11 via Frontend Transport; Fri, 19 Nov 2021 07:33:09 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 166350bc-ffd5-4cf2-48cc-08d9ab2ed67f X-MS-TrafficTypeDiagnostic: HK2PR0601MB2033: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:82; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 1Hm8fqlNZ8K+lqlB6sBtXiC1zALwEcVa+ENrTuKOl13bkjWO9qu7yfgscj5cIuYiA5h2LO/G5fnUk87KkaKtKW/Qw5J8m0KLceBO/hT4uoGBoFU+hn/pRh7Kwiw5sPM+O/FD01dUK7976t+sFQ20WHQ6cXjv37D9KIpR85v1ICssIo6z4QcDA7mIYphMrgw717WYNgm7CW6gVKMEI9t661KCwrvYYT26fFS+riTT7KZcx44GUOHHkvLOY4c/R1gV4d1uWJfFUfgSJaRw5ifJPMTod/X3ke/SYFV/0NGtQ2yajNrH+5DKO2nZ9dLMfzyA9yZC9gng0WMAd4qV2KBYt36gBG0El6BlaUOkQbh4vi4vqTss+mWUnMY+dm/BNB1oUQongMWB7/qqOLcQXv9bnXFIIYwMEVH3xmq5ldduLYeKimGhNghgb6g8DUX6dhW2wZ/fXHHr3HW7n10bY8lPTlFjWMaSi8RHZvp4ZgLv0nYORg+owjXaz2ko0xhJNFmPy0DD94OU9k2f/KT1FqDIDxyacQ6LF74G5WK3xv/zfrh6JhdlzXhsZvnGcJO/ADZSuXjiED9/iE0rSqc/VuuA1DgLQR8dXoIE37IRR6ZYp+3Sn0iEIjXM5cEaZML8mBObMv6jc45rkWMrSoyQ0AJGGvPH1lH3Sxr8TWOgjWtzOjRurl6Ez7nKoGAqjnawM/DsIc+ABxJ3T9ib2XYZn7T1Fg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:HK2PR06MB3492.apcprd06.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(366004)(6486002)(38100700002)(26005)(52116002)(2906002)(956004)(4326008)(508600001)(186003)(316002)(110136005)(6666004)(8936002)(5660300002)(38350700002)(1076003)(86362001)(66556008)(6512007)(66476007)(6506007)(107886003)(36756003)(83380400001)(66946007)(2616005)(8676002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: a4hKdYsY4e5SovbhUwQRSjZogFjn+3HcsgKQjTNBr2mhRC9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3iiml0RxEL6eRPfmo7E7yQUIp6ADfUA4LubqtxgX/P1NQnkde5hUkw62a78DLKJQg/FB4jUgm13a8dp5IT92YcJoLTjW8Q/xqhTIyx2+CVWK5nDQzuOwj5gfciIR30kc39YmvL5r72+j8m5za1q342n9kjsp65JyrCGohnDSF+4/FFQX6i1uqsBPno+8F4LDb3zXrTizq4GhxEKO64sxTRp/urR+qLdqn+p/cGKzh0hQCpJb8/0P6AV0PwDegglxa3ymxH7bERjofOJT0pHbduFtLSP+wAR7/zU+xCKBZNnTlOpL5yUq4GpptH4chp+aCSXkCQXAtfCvA6osYfpfrxzIrEXXHfzg8bo7hkhRSYa6GC5ovdfwoxCZHtTXMfW3cPsupeRxPHLfWUehfxJ1ZNUm7AZ6GqVxf44NYGeUPRQzk3hScg3TedOPMNqm1LvSqUwytochuvhnR/STLaaVcXiJoqmcINFyG9uwHNItkw30BuCTzpK+RV5D3KJuWE= X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 166350bc-ffd5-4cf2-48cc-08d9ab2ed67f X-MS-Exchange-CrossTenant-AuthSource: HK2PR06MB3492.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Nov 2021 07:33:10.7855 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 923e42dc-48d5-4cbe-b582-1a797a6412ed X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: kuAiyYw1Z0aQFCDYiERa4yYyAjG9ap3osROt0XDly6GuU4HH2RaULan8hJHP8V8jBoCNJioyGJqWh9eDEFSgIw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: HK2PR0601MB2033 Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org Use sysfs_emit() instead of snprintf(). Signed-off-by: Guo Zhengkui --- drivers/video/fbdev/omap/omapfb_main.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/drivers/video/fbdev/omap/omapfb_main.c b/drivers/video/fbdev/omap/omapfb_main.c index b495c09e6102..083388a4ceeb 100644 --- a/drivers/video/fbdev/omap/omapfb_main.c +++ b/drivers/video/fbdev/omap/omapfb_main.c @@ -16,6 +16,7 @@ #include #include #include +#include #include @@ -1303,7 +1304,7 @@ static ssize_t omapfb_show_panel_name(struct device *dev, { struct omapfb_device *fbdev = dev_get_drvdata(dev); - return snprintf(buf, PAGE_SIZE, "%s\n", fbdev->panel->name); + return sysfs_emit(buf, "%s\n", fbdev->panel->name); } static ssize_t omapfb_show_bklight_level(struct device *dev, @@ -1314,8 +1315,8 @@ static ssize_t omapfb_show_bklight_level(struct device *dev, int r; if (fbdev->panel->get_bklight_level) { - r = snprintf(buf, PAGE_SIZE, "%d\n", - fbdev->panel->get_bklight_level(fbdev->panel)); + r = sysfs_emit(buf, "%d\n", + fbdev->panel->get_bklight_level(fbdev->panel)); } else r = -ENODEV; return r; @@ -1348,8 +1349,8 @@ static ssize_t omapfb_show_bklight_max(struct device *dev, int r; if (fbdev->panel->get_bklight_level) { - r = snprintf(buf, PAGE_SIZE, "%d\n", - fbdev->panel->get_bklight_max(fbdev->panel)); + r = sysfs_emit(buf, "%d\n", + fbdev->panel->get_bklight_max(fbdev->panel)); } else r = -ENODEV; return r; @@ -1379,7 +1380,7 @@ static ssize_t omapfb_show_ctrl_name(struct device *dev, { struct omapfb_device *fbdev = dev_get_drvdata(dev); - return snprintf(buf, PAGE_SIZE, "%s\n", fbdev->ctrl->name); + return sysfs_emit(buf, "%s\n", fbdev->ctrl->name); } static struct device_attribute dev_attr_ctrl_name =