Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp5601315rwi; Tue, 18 Oct 2022 01:09:58 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4NG1r8NnQtG3LNBHV9Czp1prXejSH53bWNqw6RH9aR0KMFlLK3meRfMwqP9Rl8CSRP4Rtz X-Received: by 2002:aa7:c314:0:b0:458:dc90:467a with SMTP id l20-20020aa7c314000000b00458dc90467amr1457033edq.284.1666080597803; Tue, 18 Oct 2022 01:09:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666080597; cv=none; d=google.com; s=arc-20160816; b=KnlI+aOmibD1yi/j6HxWu267nRN9xzjVtQdEN7sApg2fPASTq7CGk/D7v3OJT7ZEik caC8T000xihMdrLA60zn+GrSXHsnMA1MLrcRI7jmf8CYFHA3DmeIHSQUOX+C+jIr5hSB W2+owWVKs1obKgeT4IKR2linToAdPPI1oWR1jSM0fl6StFcMnrCcATZh9wuMUseFs6k6 h8tJ+unDyr+aPFffaxEQYQN1QEvifNm5YkOXu0XRRwyjCnKu+vCpy30Aj1v9wc23n1S8 OfC70sYQCiV+1DP2KXuU7LamN8mq70+aGjkLggfE7WxirNMDEWJf4w6F3TQSjeyRJWoA 3tnQ== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=vl1/9ecW7HlTpZtLd+FURiia+/oZgLLP0reQXEaxp9o=; b=d6m1REPbm/MDrs3qYFhibiBdkPqK2fu2aHzp2ZhYWpshd0eBxdVDV6I4t3LcEfbwfs tJWK/3CEC3MQDHPXbRlIy9pJ/86O/w+KwQaenqFq50+8Wn1LyFS/0sDnKU/50nEzvRqQ LkoZKtGgvDuE9e+rbJozh2BFh4Xqt6vKn8uqAe6YoUNj4xvrbvH1K1mjrRw6QXE7yUBy R0Q4+2pr9KaJ8czGnl+4OCjczED2dGbVQDw1y2W9lLUNTgD/lPHJES3SMWAGNBs9Ga1j QDQTGHU4ijk8BIfoHnSZQg9pYY13+BKKCC1UqYsJLtaJY2x6+ftgRAJfqe5WoNpsjvYA aRbQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=XwJwK3PJ; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e10-20020a170906504a00b0078210c21ecesi9556825ejk.304.2022.10.18.01.09.32; Tue, 18 Oct 2022 01:09:57 -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=@gmail.com header.s=20210112 header.b=XwJwK3PJ; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230238AbiJRHv1 (ORCPT + 99 others); Tue, 18 Oct 2022 03:51:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59526 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229824AbiJRHvY (ORCPT ); Tue, 18 Oct 2022 03:51:24 -0400 Received: from mail-pl1-x631.google.com (mail-pl1-x631.google.com [IPv6:2607:f8b0:4864:20::631]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 349A330F79; Tue, 18 Oct 2022 00:51:23 -0700 (PDT) Received: by mail-pl1-x631.google.com with SMTP id o21so10657979ple.5; Tue, 18 Oct 2022 00:51:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=vl1/9ecW7HlTpZtLd+FURiia+/oZgLLP0reQXEaxp9o=; b=XwJwK3PJkvykkn0S5pGaZYkikEofEiVjJheRW4oOoKev2JE3DDM3XariJP/edXDo81 ZkdksitDaNko4Nm7vlh8MzlIJaQ9t3QfQdni+SaYCed4k1QIVsl5GRfZYfuTiQk8Lc6r FUOsM4C92LPDmilPmf+5KPJulsnGAnER5cJl/WfocCGF/EeIQdjaFZ2+zdN5sedq18kr mD6w4HhzHgH4j/7tHj2LYCdZ5cHyCoGkvwa8np3mPpejWuwsAQs2DJ7qeferWZfwcbGF 79+w+myDh7BiacNkQpvUp8fmyOLVFV7GqyQ2jn/Q/uwT0Tk8PwMHbzAXzxwFWyZhZSPN R9Hw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=vl1/9ecW7HlTpZtLd+FURiia+/oZgLLP0reQXEaxp9o=; b=0yVy7jitAq6QxDeSBdB5pv8rLnB2vRSOJRw0CDb64l6rEtOYNxzph0zsvlJgn1/S7w 8pLPZyrcCwOIPMeVZjyQe8q1LRa4pzO0WzpV+IC2y9PPVRdn9qhnxkScMNtlEwjn6S+t +RK4TIRsRMBn9SaPlpUI/6M+CDeN1wcfxb4nOLPaFQKCSqvwEr7blba56XrDGwnEi8Fi JJFd6RXowTOtLQbkOpBE2clwKd67VLL069Ok5xFLafVUqdfWx8K/2GSIrWKD0hrjSWmh i0zn5ktYd6yMpeIkF3GidgbcAkUNwtO8wMks+nmMXcW48ZQKrMHHEbZyN8fO/LnP+bKa hnCg== X-Gm-Message-State: ACrzQf1O/cUxWbuyPtnvOhihyCWryLPRSK7fIdqClSnfdO9Mr4KVUOxA QxfWj/pt3d/gaZxzKXYofF4= X-Received: by 2002:a17:902:d4d1:b0:185:52c4:f4c6 with SMTP id o17-20020a170902d4d100b0018552c4f4c6mr1794027plg.154.1666079482728; Tue, 18 Oct 2022 00:51:22 -0700 (PDT) Received: from carlis-virtual-machine.localdomain ([156.236.96.164]) by smtp.gmail.com with ESMTPSA id y16-20020a17090264d000b00176e6f553efsm7901882pli.84.2022.10.18.00.51.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Oct 2022 00:51:22 -0700 (PDT) From: Xuezhi Zhang To: zhangxuezhi1@coolpad.com, deller@gmx.de, jiasheng@iscas.ac.cn Cc: linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH] fbdev: gbefb: convert sysfs snprintf to sysfs_emit Date: Tue, 18 Oct 2022 15:51:18 +0800 Message-Id: <20221018075118.922212-1-zhangxuezhi3@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS 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: Xuezhi Zhang 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: Xuezhi Zhang --- drivers/video/fbdev/gbefb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/video/fbdev/gbefb.c b/drivers/video/fbdev/gbefb.c index 1582c718329c..000b4aa44241 100644 --- a/drivers/video/fbdev/gbefb.c +++ b/drivers/video/fbdev/gbefb.c @@ -1060,14 +1060,14 @@ static const struct fb_ops gbefb_ops = { static ssize_t gbefb_show_memsize(struct device *dev, struct device_attribute *attr, char *buf) { - return snprintf(buf, PAGE_SIZE, "%u\n", gbe_mem_size); + return sysfs_emit(buf, "%u\n", gbe_mem_size); } static DEVICE_ATTR(size, S_IRUGO, gbefb_show_memsize, NULL); static ssize_t gbefb_show_rev(struct device *device, struct device_attribute *attr, char *buf) { - return snprintf(buf, PAGE_SIZE, "%d\n", gbe_revision); + return sysfs_emit(buf, "%d\n", gbe_revision); } static DEVICE_ATTR(revision, S_IRUGO, gbefb_show_rev, NULL); -- 2.25.1