Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp3012597rwl; Tue, 27 Dec 2022 03:07:49 -0800 (PST) X-Google-Smtp-Source: AMrXdXvtzl3uHIjb9/sEORXW2/MHdU793P6ypo5qceUqZDatT31BQP4sxm0hNFkxCkkQC9CVbRFM X-Received: by 2002:a17:907:b9d5:b0:7c1:f6c:dd4e with SMTP id xa21-20020a170907b9d500b007c10f6cdd4emr17830245ejc.40.1672139269080; Tue, 27 Dec 2022 03:07:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672139269; cv=none; d=google.com; s=arc-20160816; b=oNqXCK8QoSYnZn+nnuOXtiCjqKNlR4eiMk0SOWVuZQXDsI1s2MmAmkgrqSZKqiUHis XBtdyKSq9fjAicBH1DKAl8z394uCkA/iwNRQiGSuBUJ7vs/a7xOwrId7Eok7u1DRWLXI dNBCTiKcOgKyd3xWEA3INxfQ0CrEi7TJ8+n2dbTqTv8f/yrRAdRcr9/CbalgDgC/t65R GhV+nJBzG8ay0FC00jiIuElCxqX7/ueCxpG9bTQPgAOeAete3xI64W3/Fn8pEC2P99Uh mDWSOEmmUBpyKnqOU9fP3d9iRzF2m+hjpMla8E4JRnE3aU3V+XO6jeOSg3qMrzgLJ2xL mWxQ== 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=rgu6mM4Jqs66vBJ1eVaVAeL/gltzz7QwmhdjdBu7Ti8=; b=MUTGvM9uRI+zcRNn0COu2xCNZG6Nws5aUQKb/qTCvw5DZI5Q+v6QypguDAPw29Ka7Q kY8JAuqu7vz2g14fDZma2mOUS+5/icd22XjHCl3s8hNdMeNSASIEXZmnPEP20/aBGugx LkEGJ/w7mlebDAm+kmXOX1SACDDy1ylIn2cnPic/jF5nPuc+rFSV1OilJC1RtdVeOGJU 7M7mimiwOMSuxwMU15YAg/OPPm+wzD1iyJ8DF7DaR5VqWKOGI+oPizAQ9obcRfqOB7/N wKrGXxyniOjUcQTsMIZr3n/xaf7WpcjR42NBkCDkSE1ISDg6yLXV+2wrPZxZIRR/abm9 kHvA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=QpPu3Nph; 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 cr11-20020a170906d54b00b0084a5289627asi8533452ejc.965.2022.12.27.03.07.33; Tue, 27 Dec 2022 03:07:49 -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; dkim=pass header.i=@gmail.com header.s=20210112 header.b=QpPu3Nph; 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 S230497AbiL0LDy (ORCPT + 66 others); Tue, 27 Dec 2022 06:03:54 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53792 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229550AbiL0LDu (ORCPT ); Tue, 27 Dec 2022 06:03:50 -0500 Received: from mail-pj1-x102f.google.com (mail-pj1-x102f.google.com [IPv6:2607:f8b0:4864:20::102f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EC50EA477; Tue, 27 Dec 2022 03:03:47 -0800 (PST) Received: by mail-pj1-x102f.google.com with SMTP id o1-20020a17090a678100b00219cf69e5f0so16956802pjj.2; Tue, 27 Dec 2022 03:03:47 -0800 (PST) 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=rgu6mM4Jqs66vBJ1eVaVAeL/gltzz7QwmhdjdBu7Ti8=; b=QpPu3NphcdtA7vXQLMbNoD05acMughBTynihyWef+NBpXlxok81SW4MrpqCjkLO/ll Y1Ri8WqDZYc34DNVw+iekBqZKPLaKFnJI2USEFOYR+bpq6uFTPTHgaYcfQfI9PViD0w6 r1HZWRxqNE2aKgh7jyEJ0XhhVaruVRF9tAM/o21IZdoQISAv80BJmz/BVh8cbKCIY1Gz nQflNgKwfwPCABJiRwCeptducnWEu7hoDOOGLTUFlwG3bFhq0IJvuzlrSwudILWh7ozN pKbZ5yy51+Jr2qVTTFJWnpVj3PVLDhM5Ktw5sI6YLzACmWgJ36m/vMMf9tFYVYi/CfOM LJtQ== 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=rgu6mM4Jqs66vBJ1eVaVAeL/gltzz7QwmhdjdBu7Ti8=; b=jiSwo43LayBaBCIzvLj2iF1zRo0+PpVv8vYxDv08RidcSA8b5eFeD7LO9NuuHku4TD KQ4+pQB1Kequ2FzeKPVUAChOz/BQPYIeQp2MBqLm8k0JbebWxpsXZx8svxqYxhGRdSuZ HhKG4KiYZeoVRZWn2PEDe3QVbNE3Igh4YNQwxqdirgXPCPlYc74UClGqp93MkMtuCuvD vFwowMQVWa8RIJpP7DjAMJpNe9eYx7V99rmTXiaXUEV4IdUqag2W/bP6MCj2MuMbNFjk ZjwbfAV0NLZqObI4BXyX1nANIs1saeGpsYdjrlfrcF94laoL5lRlw7u8jnGeY4fbdb/H z+3A== X-Gm-Message-State: AFqh2kq3gRu28ZH1SY3mhZYFm/6q4UFZtM3hN4mDLsqnKjvKTHDx3joe OhC26K3IR0tmrdNg3JK+Mru4yvi2hGMB/w== X-Received: by 2002:a17:903:1c1:b0:191:271f:47be with SMTP id e1-20020a17090301c100b00191271f47bemr35769960plh.35.1672139027479; Tue, 27 Dec 2022 03:03:47 -0800 (PST) Received: from carlis-virtual-machine.localdomain ([156.236.96.164]) by smtp.gmail.com with ESMTPSA id u2-20020a170902714200b001865c298588sm8683764plm.258.2022.12.27.03.03.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Dec 2022 03:03:47 -0800 (PST) From: Xuezhi Zhang To: zhangxuezhi1@coolpad.com, wintera@linux.ibm.com, gor@linux.ibm.com, agordeev@linux.ibm.com, borntraeger@linux.ibm.com, svens@linux.ibm.com Cc: linux-s390@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] s390/qeth: convert sysfs snprintf to sysfs_emit Date: Tue, 27 Dec 2022 19:03:42 +0800 Message-Id: <20221227110342.1436070-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/s390/net/qeth_core_sys.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/s390/net/qeth_core_sys.c b/drivers/s390/net/qeth_core_sys.c index 406be169173c..d1adc4b83193 100644 --- a/drivers/s390/net/qeth_core_sys.c +++ b/drivers/s390/net/qeth_core_sys.c @@ -410,13 +410,13 @@ static ssize_t qeth_dev_isolation_show(struct device *dev, switch (card->options.isolation) { case ISOLATION_MODE_NONE: - return snprintf(buf, 6, "%s\n", ATTR_QETH_ISOLATION_NONE); + return sysfs_emit(buf, "%s\n", ATTR_QETH_ISOLATION_NONE); case ISOLATION_MODE_FWD: - return snprintf(buf, 9, "%s\n", ATTR_QETH_ISOLATION_FWD); + return sysfs_emit(buf, "%s\n", ATTR_QETH_ISOLATION_FWD); case ISOLATION_MODE_DROP: - return snprintf(buf, 6, "%s\n", ATTR_QETH_ISOLATION_DROP); + return sysfs_emit(buf, "%s\n", ATTR_QETH_ISOLATION_DROP); default: - return snprintf(buf, 5, "%s\n", "N/A"); + return sysfs_emit(buf, "%s\n", "N/A"); } } @@ -500,9 +500,9 @@ static ssize_t qeth_hw_trap_show(struct device *dev, struct qeth_card *card = dev_get_drvdata(dev); if (card->info.hwtrap) - return snprintf(buf, 5, "arm\n"); + return sysfs_emit(buf, "arm\n"); else - return snprintf(buf, 8, "disarm\n"); + return sysfs_emit(buf, "disarm\n"); } static ssize_t qeth_hw_trap_store(struct device *dev, -- 2.25.1