Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp467391rwi; Fri, 14 Oct 2022 04:45:53 -0700 (PDT) X-Google-Smtp-Source: AMsMyM43PqHs6m6yTPbB2p/kLbVZjcY/EuF/tSl1AnlJzFFtqyQUQU88V6nwnPzhonEO8NjCIYiJ X-Received: by 2002:a17:907:d89:b0:78d:b143:7aeb with SMTP id go9-20020a1709070d8900b0078db1437aebmr3252690ejc.459.1665747953354; Fri, 14 Oct 2022 04:45:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665747953; cv=none; d=google.com; s=arc-20160816; b=0Dez1aAPD1EtTF+F33jgzInyJlL+hywwMj9OlAdoa2i8ZR7e46vJGkiPMttlrfxJNU cFWjevVh9EQza64ffZlMpmGlj1j3jjvEshLYt+33XsaHgb+dEdRpWulFYTzcQ3tum3fm mfyZaTI6PNGS6RZ3L8aHX9F3Su/m/R5A3y5NhV1NPKd7ckbW2Oc7LJv84R3aEpwaae75 pfnHiWI8Flm0FrssRDJk1jRqA9+Kh1O9p8rFtMzHZV9+FJ0/0QHV+JShTC5siSWEF0BW 00gC7GzGdjSX8rGUOUgqSgcVjIYryDxDKN6VJ7+wTFVcq2HJ1RSv+xX93OaMb0B0snZ/ gLEQ== 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=RYOgGB3OBp7ooAPIp1xdI0GhJIuSMbuwgDPRPDT+2C8=; b=Z5p2vS/iMsTd1A7tomaUB3gaC/j6BXtDe9iWDdod4iulO86oVWsBM3VMb2OXSQaKSU HvnhMKUPIymS1ATC98lHmwmoMXTQyZqWvdzUn1l2Xr7TLzCppvrQ0v6XA5aK2MEpodvT 0AdNEFB4XvYi5HjZ0kzXs9lKkEiu79/e+xnShUUqjLPAr2zpfR9qQj14pPDVSORY8o0T XNo8Onn+PdnRzmka9k5bciKtJ1VG/4LxpAwfDFtH8ZsMatd8UD4sgbpJP9fa+0q5kqqP gk25ByaYh1YkgYh3Ysy6eeC2bgIi2XDZQYShSilUoJNbCIdoagMfD/CaW8qGCo1qq2S4 gYOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=HzDmIZbv; 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 hb6-20020a170907160600b0078dcee0cf13si2452454ejc.561.2022.10.14.04.45.26; Fri, 14 Oct 2022 04:45:53 -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=HzDmIZbv; 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 S229511AbiJNLGP (ORCPT + 99 others); Fri, 14 Oct 2022 07:06:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56842 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229493AbiJNLGM (ORCPT ); Fri, 14 Oct 2022 07:06:12 -0400 Received: from mail-pl1-x62e.google.com (mail-pl1-x62e.google.com [IPv6:2607:f8b0:4864:20::62e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DBC5328E28; Fri, 14 Oct 2022 04:06:11 -0700 (PDT) Received: by mail-pl1-x62e.google.com with SMTP id b2so4415156plc.7; Fri, 14 Oct 2022 04:06:11 -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=RYOgGB3OBp7ooAPIp1xdI0GhJIuSMbuwgDPRPDT+2C8=; b=HzDmIZbvI+d5dTFWwb7fgn2izvFe1MotC1FrIv7PeIguF+ByOhkbb71y5N3y/w3VxV GrPil13ZA2katsSk3gzeUjOvoHP4kluAtTdyyfNr2vWD5tsJdJ2WOMzpPYzOmZ6iNco7 JuVFYBwBPWj0qr7oBNh8AW4SsMOVobnKNshUK1dX/8N5DMEjMBCz0eBoYjYX0qo24qk4 JkjuaIK1eQd20mn9I3teaLx81iKlY3IKNwIf6v7Q00x6Y/bZBGTwTfZgkkjrvj/G40mB 2z6/GESdDK0+4QOiRYsjwKi6eCeAlnJt7gOyTD3rgokuBiK6DqGeZKSm0iKOPyE7XhRR NNlQ== 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=RYOgGB3OBp7ooAPIp1xdI0GhJIuSMbuwgDPRPDT+2C8=; b=c4lrE7sEsVm4e9t/xPRpLvlofnC7xOOMqtVyRHnsg/wj8T+W8L1EZZ78QkCBBch+dl 2HxGBPWq5GeoG1B4Nl3ef9zcrIXiNxEiMHMUTGHYNd4e28VRyw9waY+kaKQOFLiOuWH0 IWVpiyxKVjxiER/Wgqe8AB5Bu0/dFoefentf9NjTVwThrobQpAcRRRkQhkCYci4z2xEr QeDdxCF0Kb+NrL8wDfyAbBJVgtGcRA41JBM3z0O220in9m6+Te6tRyUHalJgGGMO/TG7 eMz8BCdQ9YFb6F/Fcqae7NBlxo4N1F4pa1CkLA+IRgyol/3ubmx6pYWYZUnGy+6gJia6 pJkA== X-Gm-Message-State: ACrzQf1IW4YfDtJIJD70IrgxzeR3sgB+R9r9+Xh8QTnPAw4cHZ6S/eSQ ebYDO1f+JNV1V161g0HQKec= X-Received: by 2002:a17:902:8a88:b0:17f:8642:7c9a with SMTP id p8-20020a1709028a8800b0017f86427c9amr4675382plo.13.1665745571377; Fri, 14 Oct 2022 04:06:11 -0700 (PDT) Received: from carlis-virtual-machine.localdomain ([156.236.96.164]) by smtp.gmail.com with ESMTPSA id h10-20020a170902680a00b0017300ec80b0sm1416564plk.308.2022.10.14.04.06.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Oct 2022 04:06:11 -0700 (PDT) From: Xuezhi Zhang To: valentina.manea.m@gmail.com, shuah@kernel.org, gregkh@linuxfoundation.org Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Xuezhi Zhang Subject: [PATCH] usbip: convert sysfs snprintf to sysfs_emit Date: Fri, 14 Oct 2022 19:06:06 +0800 Message-Id: <20221014110606.599352-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/usb/usbip/stub_dev.c | 2 +- drivers/usb/usbip/vudc_sysfs.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/usb/usbip/stub_dev.c b/drivers/usb/usbip/stub_dev.c index 3c6d452e3bf4..f92047d860f0 100644 --- a/drivers/usb/usbip/stub_dev.c +++ b/drivers/usb/usbip/stub_dev.c @@ -30,7 +30,7 @@ static ssize_t usbip_status_show(struct device *dev, status = sdev->ud.status; spin_unlock_irq(&sdev->ud.lock); - return snprintf(buf, PAGE_SIZE, "%d\n", status); + return sysfs_emit(buf, "%d\n", status); } static DEVICE_ATTR_RO(usbip_status); diff --git a/drivers/usb/usbip/vudc_sysfs.c b/drivers/usb/usbip/vudc_sysfs.c index c95e6b2bfd32..907a43a00896 100644 --- a/drivers/usb/usbip/vudc_sysfs.c +++ b/drivers/usb/usbip/vudc_sysfs.c @@ -242,7 +242,7 @@ static ssize_t usbip_status_show(struct device *dev, status = udc->ud.status; spin_unlock_irq(&udc->ud.lock); - return snprintf(out, PAGE_SIZE, "%d\n", status); + return sysfs_emit(out, "%d\n", status); } static DEVICE_ATTR_RO(usbip_status); -- 2.25.1