Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp238803rwr; Thu, 4 May 2023 02:09:10 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7CBxN93niwqcioZJ3BYIE028qvKiZtTGpQ3qoc1LmAw/JYvvwi5Egqq+9NSydMr3aY8Kho X-Received: by 2002:a17:90a:6809:b0:246:82ac:b6cf with SMTP id p9-20020a17090a680900b0024682acb6cfmr1586421pjj.11.1683191349739; Thu, 04 May 2023 02:09:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683191349; cv=none; d=google.com; s=arc-20160816; b=tqmtRWPmqtPA6ju5edL1rlyQj/W4AqPaUzWVrLTxhLV6wU0jRE8vgHuMvY7IUMGChS s1nskNw6TWFr0awKp65yMbQRQ4/dyxu+lD7Q6GLkybFwIN0ELtM73WuOAFgJL2QeCdC5 WFmWCRQ57DRouWsyc2XqExgXPV32DeG3XVHxA1PYPUqR1xDB8drXcS+oho1+fxFsqkTG M8xtMMrA9U48RzkYgvWITZUwE47fU6IpEI+NbWuZrXrWgJ4eN8Siz0rDqwmfV4U0l+iu 1VPGSGPD/ARLHwatyWXSoEKg9R2mt05oeOpG4UCbq6VZwamHGa3NQdYEVOieLPJTacH8 JnFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:abuse-reports-to:tuid:mime-version:message-id :date:subject:cc:to:from; bh=/05xCxuxKYhbQzdumGU9GnAxvmK5noK4usP/Te0g6X4=; b=K01h5a7BNU2fBukPxueXxbgZnr5nvES00nE1reNm5AZTid0Gi7LrwHL8CuEPgvNrSM iBMKrTOB53RrJhmUDgWylhmTz3HucvJVl8Bf8irWm3lg/tTYsCENwzZD+9SV2l7QCbnS CRa4mT66dNk4/hwOxjTu5nveVPSQVP0236d1XUGs89Yu0CT2MpLs4er4UYpiC4qsqpzs fOH5CCCoaJAlj6txn3X/aEZ+m169JalmrOeapFWnhIA2x2/Z9KgfNJgnGLZY1PNP3MhJ jDWC9dT7ebZtKPxW0dwySdJFyrFuaEIhIL9eHXUJMOW9uvRbILoyJhVjy+DAIMqmJuaD dAWA== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id pc12-20020a17090b3b8c00b00246596483a3si10286612pjb.37.2023.05.04.02.08.55; Thu, 04 May 2023 02:09:09 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229950AbjEDI4g (ORCPT + 99 others); Thu, 4 May 2023 04:56:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56990 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229598AbjEDI4e (ORCPT ); Thu, 4 May 2023 04:56:34 -0400 X-Greylist: delayed 63 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Thu, 04 May 2023 01:56:32 PDT Received: from unicom145.biz-email.net (unicom145.biz-email.net [210.51.26.145]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 50CAD358A; Thu, 4 May 2023 01:56:31 -0700 (PDT) Received: from unicom145.biz-email.net by unicom145.biz-email.net ((D)) with ASMTP (SSL) id AFI00024; Thu, 04 May 2023 16:55:24 +0800 Received: from localhost.localdomain.com (10.73.43.242) by jtjnmail201608.home.langchao.com (10.100.2.8) with Microsoft SMTP Server id 15.1.2507.23; Thu, 4 May 2023 16:55:23 +0800 From: Bo Liu To: CC: , , Bo Liu Subject: [PATCH] bus: ti-sysc: convert sysfs sprintf to sysfs_emit Date: Thu, 4 May 2023 04:55:22 -0400 Message-ID: <20230504085522.2635-1-liubo03@inspur.com> X-Mailer: git-send-email 2.18.2 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.73.43.242] tUid: 2023504165524c241f6fba83c50017744cf9c8f0f8e3c X-Abuse-Reports-To: service@corp-email.com Abuse-Reports-To: service@corp-email.com X-Complaints-To: service@corp-email.com X-Report-Abuse-To: service@corp-email.com X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2,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 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: Bo Liu --- drivers/bus/ti-sysc.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/bus/ti-sysc.c b/drivers/bus/ti-sysc.c index 6c49de37d5e9..e3d043de894d 100644 --- a/drivers/bus/ti-sysc.c +++ b/drivers/bus/ti-sysc.c @@ -969,9 +969,9 @@ static int sysc_show_rev(char *bufp, struct sysc *ddata) int len; if (ddata->offsets[SYSC_REVISION] < 0) - return sprintf(bufp, ":NA"); + return sysfs_emit(bufp, ":NA"); - len = sprintf(bufp, ":%08x", ddata->revision); + len = sysfs_emit(bufp, ":%08x", ddata->revision); return len; } @@ -980,9 +980,9 @@ static int sysc_show_reg(struct sysc *ddata, char *bufp, enum sysc_registers reg) { if (ddata->offsets[reg] < 0) - return sprintf(bufp, ":NA"); + return sysfs_emit(bufp, ":NA"); - return sprintf(bufp, ":%x", ddata->offsets[reg]); + return sysfs_emit(bufp, ":%x", ddata->offsets[reg]); } static int sysc_show_name(char *bufp, struct sysc *ddata) @@ -990,7 +990,7 @@ static int sysc_show_name(char *bufp, struct sysc *ddata) if (!ddata->name) return 0; - return sprintf(bufp, ":%s", ddata->name); + return sysfs_emit(bufp, ":%s", ddata->name); } /** -- 2.27.0