From patchwork Mon Dec 5 08:08:04 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: ye.xingchen@zte.com.cn X-Patchwork-Id: 29588 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp2122748wrr; Mon, 5 Dec 2022 00:10:51 -0800 (PST) X-Google-Smtp-Source: AA0mqf6X0qgv9w1/vrtWe/bYOyTb4IoED4vHOHyBmZx9AYT6qX6UySmJ8wqVO19bVPKhwygZUur0 X-Received: by 2002:a17:907:cf84:b0:78d:4795:ff1f with SMTP id ux4-20020a170907cf8400b0078d4795ff1fmr23183404ejc.331.1670227851688; Mon, 05 Dec 2022 00:10:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670227851; cv=none; d=google.com; s=arc-20160816; b=ouL/2Hui0tpkhn3sqhszMa15usJQtvycjgcalROQalvNBomPgYOrMiMVqMOzkeUrth 2hiNfQgMNl3VX2Y0Toek+Ur6C+YVJlAgSoxlyb9fDaSsST5g9iuA6bv1c9ny2Wk5E9Ah QvEM+lYEjCxEb0VL3wUjKTY13w7tplvPTY30LxLWs73h+kHObjbb+/f3/sjb33QSlbZg gIGfg/1W590w7zh0GqyrqUTu02cIicTaHYKp8YCXjxUouydzuVnWDPoBfWPMIy+eosdp 1Uw9h1SpmEkCwoY/iOxpCm7qCFMaEpGTycCZQjc72LS1e8g2k32rl+S4hSXKHEDJQ9jz 8uXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:subject:cc:to:from:mime-version:message-id:date; bh=9QEAlQzK/0BOyi/pOESzhG5CDdPkY/c5I2obU4JJDxU=; b=LTivY9x3q1/yNPi8+IbO5SShpejvIt3zYBOGoOx6YXFaCowZ51MrbPiYbtcaDELz1P qZTYn6bhiQ8bOW2cu14xkJPa2AJpXso0ReQFGPOsF+WSAEaVliqj14oXZ6q4OlhiJiNi Gn1sJGLgGA+C9PdjNMQTPtZQpN1Nj7cnqaO9JFdZq9ZuwLsqGE0u5In/rcF7Xw0V6Ge8 6lRq7xre5K34hMhEgo2beqxP6XW1UgQEG8jzTKoFtDIbzE8YkyR9i9RYq551L3rhp6TD cUIOx8ee3UHTN72C3LDO8oqvyumfdfqfve/Vp0/3kHuWYcV2acvjKR6BNrjYBehFXgtv dy1Q== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=zte.com.cn Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id sa13-20020a170906edad00b00782b261ea21si8491615ejb.729.2022.12.05.00.10.25; Mon, 05 Dec 2022 00:10:51 -0800 (PST) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=zte.com.cn Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231891AbiLEII3 (ORCPT + 99 others); Mon, 5 Dec 2022 03:08:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59464 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231910AbiLEIIV (ORCPT ); Mon, 5 Dec 2022 03:08:21 -0500 Received: from mxct.zte.com.cn (mxct.zte.com.cn [183.62.165.209]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E7AFE1408F; Mon, 5 Dec 2022 00:08:16 -0800 (PST) Received: from mse-fl2.zte.com.cn (unknown [10.5.228.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mxct.zte.com.cn (FangMail) with ESMTPS id 4NQblM2R66z4y0vF; Mon, 5 Dec 2022 16:08:15 +0800 (CST) Received: from xaxapp01.zte.com.cn ([10.88.40.50]) by mse-fl2.zte.com.cn with SMTP id 2B58825v016075; Mon, 5 Dec 2022 16:08:02 +0800 (+08) (envelope-from ye.xingchen@zte.com.cn) Received: from mapi (xaxapp01[null]) by mapi (Zmail) with MAPI id mid31; Mon, 5 Dec 2022 16:08:04 +0800 (CST) Date: Mon, 5 Dec 2022 16:08:04 +0800 (CST) X-Zmail-TransId: 2af9638da6e4fffffffffc58ba99 X-Mailer: Zmail v1.0 Message-ID: <202212051608044377107@zte.com.cn> Mime-Version: 1.0 From: To: Cc: , , , , , Subject: =?utf-8?q?=5BPATCH_linux-next=5D_fbdev=3A_use_sysfs=5Femit=28=29_to?= =?utf-8?q?_instead_of_scnprintf=28=29?= X-MAIL: mse-fl2.zte.com.cn 2B58825v016075 X-Fangmail-Gw-Spam-Type: 0 X-FangMail-Miltered: at cgslv5.04-192.168.251.13.novalocal with ID 638DA6EF.000 by FangMail milter! X-FangMail-Envelope: 1670227695/4NQblM2R66z4y0vF/638DA6EF.000/10.5.228.133/[10.5.228.133]/mse-fl2.zte.com.cn/ X-Fangmail-Anti-Spam-Filtered: true X-Fangmail-MID-QID: 638DA6EF.000/4NQblM2R66z4y0vF X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS,UNPARSEABLE_RELAY 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1751360839605986602?= X-GMAIL-MSGID: =?utf-8?q?1751360839605986602?= From: ye xingchen Follow the advice of the Documentation/filesystems/sysfs.rst and show() should only use sysfs_emit() or sysfs_emit_at() when formatting the value to be returned to user space. Signed-off-by: ye xingchen --- drivers/video/fbdev/sh_mobile_lcdcfb.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/video/fbdev/sh_mobile_lcdcfb.c b/drivers/video/fbdev/sh_mobile_lcdcfb.c index 6d00893d41f4..ad9323ed8e2e 100644 --- a/drivers/video/fbdev/sh_mobile_lcdcfb.c +++ b/drivers/video/fbdev/sh_mobile_lcdcfb.c @@ -1188,7 +1188,7 @@ overlay_alpha_show(struct device *dev, struct device_attribute *attr, char *buf) struct fb_info *info = dev_get_drvdata(dev); struct sh_mobile_lcdc_overlay *ovl = info->par; - return scnprintf(buf, PAGE_SIZE, "%u\n", ovl->alpha); + return sysfs_emit(buf, "%u\n", ovl->alpha); } static ssize_t @@ -1226,7 +1226,7 @@ overlay_mode_show(struct device *dev, struct device_attribute *attr, char *buf) struct fb_info *info = dev_get_drvdata(dev); struct sh_mobile_lcdc_overlay *ovl = info->par; - return scnprintf(buf, PAGE_SIZE, "%u\n", ovl->mode); + return sysfs_emit(buf, "%u\n", ovl->mode); } static ssize_t @@ -1265,7 +1265,7 @@ overlay_position_show(struct device *dev, struct device_attribute *attr, struct fb_info *info = dev_get_drvdata(dev); struct sh_mobile_lcdc_overlay *ovl = info->par; - return scnprintf(buf, PAGE_SIZE, "%d,%d\n", ovl->pos_x, ovl->pos_y); + return sysfs_emit(buf, "%d,%d\n", ovl->pos_x, ovl->pos_y); } static ssize_t @@ -1306,7 +1306,7 @@ overlay_rop3_show(struct device *dev, struct device_attribute *attr, char *buf) struct fb_info *info = dev_get_drvdata(dev); struct sh_mobile_lcdc_overlay *ovl = info->par; - return scnprintf(buf, PAGE_SIZE, "%u\n", ovl->rop3); + return sysfs_emit(buf, "%u\n", ovl->rop3); } static ssize_t