Received: by 2002:a05:6358:e9c4:b0:b2:91dc:71ab with SMTP id hc4csp4280105rwb; Sun, 7 Aug 2022 20:12:49 -0700 (PDT) X-Google-Smtp-Source: AA6agR7aDwlctohiSxbsjvOGGbieoIKbzdQ5FGAkS9wm+thfSSXMzjiayFuIey79zOaWZI1KkFqL X-Received: by 2002:a17:907:7fa5:b0:730:5d54:4c24 with SMTP id qk37-20020a1709077fa500b007305d544c24mr12498238ejc.641.1659928369396; Sun, 07 Aug 2022 20:12:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659928369; cv=none; d=google.com; s=arc-20160816; b=JVAnNMjdZbVE2XAqEhNSWW9jyZ6ph1CAclVIkDEekDHOOu7gHDnuhIAiv/V0yl+Rdi bg/qoLr2nD53UIwI1xRQSjSGwm/0asUSAAEiB7XF4PvC5KLMlwCxXw+UyBW6Vdfa7ur0 pwvZiIcrUcBRkBwQU4YE+k2jTJ6xTFKVUPKw4v9JWK37Io7dC9tlnoaJzIDJpinL7sjX JGFV1bYkzYF2LUnDAriszzmAvHG/aPrLg/H9kjGb0/MAhnMUBZo6FLKRpRLU+fnk1Dog StjRY7uUUHq8Jddep+/NK3RslhuJ5Ji+kxmtEl1G+QUtZGvHyoHjK+AHtRCni6UrcfBc Zyzg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :feedback-id:dkim-signature:dkim-signature; bh=CbkfhbdI8L3C3EeP6YMMpqMtzalfJzOZjgHdKwXmum8=; b=LzVt2ASJsCQM6M1n61nyCODdLmKoiYqXsPqBJtS7ARQNk9LNrl5qBMtPSUjRVeiyoC wcB1OYOhahLlOp7AMbNt0AtG1dQpa/zzGuMFmzPx2U77z8Btdh8zOovy7PW+iM9FeFmK I5CypFQxYwLgkE86728HNwAFqqaT5j3vKExvgeqvzjxaHqJYEaUEoMNlMWWKsgSHvz5Z d/W7ikbwovozekZF5zFK9tXNCY1hGaWElTod8vtR/WxgyyEjyZ0uGxTvLozuabvKa+S5 lIzEjquNKaOnO3AXR4g6bUw+qzdRVDwuYzp9lu6dszwGVjGaASMqI/j2teKw0jYFu3Dh 48lQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ljones.dev header.s=fm2 header.b=m1cAoTTp; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=bFrqvcrL; 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 fy3-20020a170906b7c300b007305b0156c9si8274523ejb.576.2022.08.07.20.12.24; Sun, 07 Aug 2022 20:12:49 -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=@ljones.dev header.s=fm2 header.b=m1cAoTTp; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=bFrqvcrL; 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 S236350AbiHHDFg (ORCPT + 99 others); Sun, 7 Aug 2022 23:05:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49694 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235718AbiHHDFC (ORCPT ); Sun, 7 Aug 2022 23:05:02 -0400 Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 89001BE27; Sun, 7 Aug 2022 20:05:01 -0700 (PDT) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id CCDDE5C00BB; Sun, 7 Aug 2022 23:05:00 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Sun, 07 Aug 2022 23:05:00 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ljones.dev; h=cc :cc:content-transfer-encoding:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm2; t=1659927900; x=1660014300; bh=Cb kfhbdI8L3C3EeP6YMMpqMtzalfJzOZjgHdKwXmum8=; b=m1cAoTTpCkRHofnlxN 2iBSKnRQl8Vv0SWCuod13eVkHVZtb6+NUN593BJfjo3ELYQzlEVtV/EIfQkfeD+B 8re/ro18I4SLi9B5n2KKj0pdcfjCGyhqBe6xKarR1DYq42nw8sBc/fqbjcvBba7y EkK9vH58CfXf97C5T8lXIf4QfUDGAsOGBUT7gmOmIpW/Qf3l9YEywGW1mQoqj0M9 cm48t/zipn6JnXt00nSLDEplS/SG4YZOeWwLy8pzxZKQ2qW54CSeSKV2JaFdHa1n Txf6C/UxjyIF7TpwhR7COHxGYtK85mzziXG7MjQ/abbjzclK3VT8Fht199xh0RYe NHLQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; t=1659927900; x=1660014300; bh=CbkfhbdI8L3C3 EeP6YMMpqMtzalfJzOZjgHdKwXmum8=; b=bFrqvcrLCK/YT5mXzdECTb0kZqS12 H4of8HymFe0GjNLfHljlR7VRW6aJ/XEejDoeAqK1SUNjrftbNJkZF7JhEmckxGx+ FHxlguxlsWQZno4FT9NsBzQLN6qrLgJyL4V8rDlE3pNQNAMzdzu28EMf8DBq9Rql iUOl9eYsTnIz0Vanwg2mt57nWxxWI5gI3wcY/0zWd8cvE3V0BwCFEJmEOYWTQ8Te hJYF80SgnIMEyxnZBlIke+TWtkNT7etwDlRKfXoEyahsvKGrz0TaLTpG1W+G7XxO 9NSScyly6+JOiD6orDeNC7ndSrGeGGWysJ5sg2veOF8TbTGBeldCg1oEw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrvdefjedgieegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvfevufffkffojghfggfgsedtke ertdertddtnecuhfhrohhmpedfnfhukhgvucffrdculfhonhgvshdfuceolhhukhgvsehl jhhonhgvshdruggvvheqnecuggftrfgrthhtvghrnhepgfetfedugfetudeuheetjefhue fggfelleetvdevtefhueeujeefvdegleevhefgnecuvehluhhsthgvrhfuihiivgepuden ucfrrghrrghmpehmrghilhhfrhhomheplhhukhgvsehljhhonhgvshdruggvvh X-ME-Proxy: Feedback-ID: i5ec1447f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 7 Aug 2022 23:04:58 -0400 (EDT) From: "Luke D. Jones" To: hdegoede@redhat.com Cc: markgross@kernel.org, platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, "Luke D. Jones" Subject: [PATCH v2 5/6] asus-wmi: Convert all attr-show to use sysfs_emit Date: Mon, 8 Aug 2022 15:04:19 +1200 Message-Id: <20220808030420.8633-6-luke@ljones.dev> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220808030420.8633-1-luke@ljones.dev> References: <20220808030420.8633-1-luke@ljones.dev> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_NONE, 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 This changes all *_show attributes in asus-wmi.c to use sysfs_emit instead of the older method of writing to the output buffer manually. Signed-off-by: Luke D. Jones --- drivers/platform/x86/asus-wmi.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c index 9b2c54726955..b9e5d87e3e18 100644 --- a/drivers/platform/x86/asus-wmi.c +++ b/drivers/platform/x86/asus-wmi.c @@ -919,7 +919,7 @@ static ssize_t charge_control_end_threshold_show(struct device *device, struct device_attribute *attr, char *buf) { - return sprintf(buf, "%d\n", charge_end_threshold); + return sysfs_emit(buf, "%d\n", charge_end_threshold); } static DEVICE_ATTR_RW(charge_control_end_threshold); @@ -2009,7 +2009,7 @@ static ssize_t pwm1_show(struct device *dev, value = -1; } - return sprintf(buf, "%d\n", value); + return sysfs_emit(buf, "%d\n", value); } static ssize_t pwm1_store(struct device *dev, @@ -2069,7 +2069,7 @@ static ssize_t fan1_input_show(struct device *dev, return -ENXIO; } - return sprintf(buf, "%d\n", value < 0 ? -1 : value*100); + return sysfs_emit(buf, "%d\n", value < 0 ? -1 : value*100); } static ssize_t pwm1_enable_show(struct device *dev, @@ -2087,7 +2087,7 @@ static ssize_t pwm1_enable_show(struct device *dev, * in practice on X532FL at least (the bit is always 0) and there's * also nothing in the DSDT to indicate that this behaviour exists. */ - return sprintf(buf, "%d\n", asus->fan_pwm_mode); + return sysfs_emit(buf, "%d\n", asus->fan_pwm_mode); } static ssize_t pwm1_enable_store(struct device *dev, @@ -2155,7 +2155,7 @@ static ssize_t fan1_label_show(struct device *dev, struct device_attribute *attr, char *buf) { - return sprintf(buf, "%s\n", ASUS_FAN_DESC); + return sysfs_emit(buf, "%s\n", ASUS_FAN_DESC); } static ssize_t asus_hwmon_temp1(struct device *dev, @@ -2348,7 +2348,7 @@ static ssize_t fan_boost_mode_show(struct device *dev, { struct asus_wmi *asus = dev_get_drvdata(dev); - return scnprintf(buf, PAGE_SIZE, "%d\n", asus->fan_boost_mode); + return sysfs_emit(buf, "%d\n", asus->fan_boost_mode); } static ssize_t fan_boost_mode_store(struct device *dev, @@ -2901,7 +2901,7 @@ static ssize_t throttle_thermal_policy_show(struct device *dev, struct asus_wmi *asus = dev_get_drvdata(dev); u8 mode = asus->throttle_thermal_policy_mode; - return scnprintf(buf, PAGE_SIZE, "%d\n", mode); + return sysfs_emit(buf, "%d\n", mode); } static ssize_t throttle_thermal_policy_store(struct device *dev, -- 2.37.1