From patchwork Thu Dec 1 11:50:11 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: 28344 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp231835wrr; Thu, 1 Dec 2022 04:29:21 -0800 (PST) X-Google-Smtp-Source: AA0mqf5NP9EBbOsbgOJpQ41yAVbshjGBVVmTK0CpD2PY6hecC0HmpIZTcyYF8lj1aiJYu+U1y8/L X-Received: by 2002:a17:902:cec8:b0:189:30cd:8f9d with SMTP id d8-20020a170902cec800b0018930cd8f9dmr48498154plg.144.1669897760693; Thu, 01 Dec 2022 04:29:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669897760; cv=none; d=google.com; s=arc-20160816; b=rNNwq8yhZ/PoKIr2d81WJqi5SVDRV4ZfzVG75IsHJgk0z/tikoWs7U2tAPv+nSZPcX gwVApwqWBKOKCtkWa31h+Aufa5z+ZCX6O/THUOUWSzlJC3m7HZod8egR4W+8sV8tRWbQ sIwICpl0FWNu8V5K892Si69i5JjADApYxucgJXyIUF6c+V0l/1wZBIk5oGQ235VYTu6d JgsiCBL5c4BcmjaXOj5G6YI7YLPkJ58ZSOfaS6bxOMcARJdxfE2TL8PFn8w25D4f1W01 OAhaDxm2FhkOwlHxhiSIRw2a2P0SPtc87erbBKGNQTP5k2elK0Te64InUl+TlXGn1n/5 UmAQ== 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=suYzMio/68B2d+dhES7APBoq/oLNSF1nkcNZrIlcWOA=; b=moqbNfH2iFw0f6QpoGCEkOc+cTSSrmWhJWY1PrsdLnFHmTehQF9d+fJ6yVYk4Uaatw 9Bkkb3Wr84nAoaSjWmcNcmG2RJPGLaBhdAfHm1HJDH3dOJDHaqUpKDDcPBhgYPMx0WNn 2J2rRoqq+ZJN1GhU8bwtW7ggCiY6UN0yRUCP0g2nmrKp6Z00iL54nlibtAwctSYqT6Ce JSEKxlTBjSsRbkwato44Ru8JjpLezbCEKIsB4pk2HQ1H47P+6Ae29drB5rYa1Hbvv2oJ l1pkjScQT/M6GZeSNEvUfjQfChoGQdgxnKTW5l0KG10f5kthW3/lBcycpxKY4zJUJWc/ X3AA== 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 c24-20020a170902b69800b0017db9b9d54asi3918658pls.300.2022.12.01.04.29.06; Thu, 01 Dec 2022 04:29:20 -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 S230462AbiLALu0 (ORCPT + 99 others); Thu, 1 Dec 2022 06:50:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38276 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229717AbiLALuW (ORCPT ); Thu, 1 Dec 2022 06:50:22 -0500 Received: from mxhk.zte.com.cn (mxhk.zte.com.cn [63.216.63.35]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 24244A06D9; Thu, 1 Dec 2022 03:50:21 -0800 (PST) Received: from mse-fl1.zte.com.cn (unknown [10.5.228.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mxhk.zte.com.cn (FangMail) with ESMTPS id 4NNDsR4Qy8z5BNRf; Thu, 1 Dec 2022 19:50:19 +0800 (CST) Received: from xaxapp01.zte.com.cn ([10.88.40.50]) by mse-fl1.zte.com.cn with SMTP id 2B1Bo8V6012745; Thu, 1 Dec 2022 19:50:08 +0800 (+08) (envelope-from ye.xingchen@zte.com.cn) Received: from mapi (xaxapp01[null]) by mapi (Zmail) with MAPI id mid31; Thu, 1 Dec 2022 19:50:11 +0800 (CST) Date: Thu, 1 Dec 2022 19:50:11 +0800 (CST) X-Zmail-TransId: 2af9638894f32519310a X-Mailer: Zmail v1.0 Message-ID: <202212011950119139713@zte.com.cn> Mime-Version: 1.0 From: To: Cc: , , , , , Subject: =?utf-8?q?=5BPATCH=5D_memstick/mspro=5Fblock=3A_use_sysfs=5Femit=28?= =?utf-8?q?=29_to_instead_of=C2=A0scnprintf=28=29?= X-MAIL: mse-fl1.zte.com.cn 2B1Bo8V6012745 X-Fangmail-Gw-Spam-Type: 0 X-FangMail-Miltered: at cgslv5.04-192.168.250.138.novalocal with ID 638894FB.000 by FangMail milter! X-FangMail-Envelope: 1669895419/4NNDsR4Qy8z5BNRf/638894FB.000/10.5.228.132/[10.5.228.132]/mse-fl1.zte.com.cn/ X-Fangmail-Anti-Spam-Filtered: true X-Fangmail-MID-QID: 638894FB.000/4NNDsR4Qy8z5BNRf 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?1751014714301735381?= X-GMAIL-MSGID: =?utf-8?q?1751014714301735381?= 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/memstick/core/mspro_block.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/memstick/core/mspro_block.c b/drivers/memstick/core/mspro_block.c index 61cf75d4a01e..ae3a5dc00344 100644 --- a/drivers/memstick/core/mspro_block.c +++ b/drivers/memstick/core/mspro_block.c @@ -356,7 +356,7 @@ static ssize_t mspro_block_attr_show_modelname(struct device *dev, struct mspro_sys_attr, dev_attr); - return scnprintf(buffer, PAGE_SIZE, "%s", (char *)s_attr->data); + return sysfs_emit(buffer, "%s\n", (char *)s_attr->data); } static ssize_t mspro_block_attr_show_mbr(struct device *dev,