Received: by 2002:a05:7412:8521:b0:e2:908c:2ebd with SMTP id t33csp746127rdf; Fri, 3 Nov 2023 13:57:03 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHG2vquMbGQtGSi+nJd6iLdATHyQ4WmgwjNwze/Is1ZhVJaEH3H/MKI9YO6hdWmX2kr44YJ X-Received: by 2002:a17:907:7e94:b0:9d1:73da:e4fc with SMTP id qb20-20020a1709077e9400b009d173dae4fcmr7776008ejc.73.1699045022986; Fri, 03 Nov 2023 13:57:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1699045022; cv=none; d=google.com; s=arc-20160816; b=UafoRqg6c6HlNesGyJSOjfGIrcl9SCX+WM/GN68Og2Bc/2djP6r09Gbi52P8yQfHor Yb9FCVlFa0reSx+PWXKn2IS7Di/zxO2aLXidFv9slkBfYbP67oFAlkiB6J1/rzUOQMPN g1/HvHQnKytTM3cL1jwa/eOSJdeTRokEiFqKxHcsZdQc8o9kiMBk6/N9GLTl1evVHazH eyHo7T93E/F34gUZSxLQM4lxQDp7iJPZbS2exm4FIMmRYriFDOgg3D+K5kAakbGRpfG6 flZpYvMZNPAFsGsU1WuYakVLwDtBIgEwSyJ8KRjeSQ1k9ytJdpNNeX5lwEH0VpHVGhDb ndIQ== 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 :dkim-signature; bh=OSZahsTgfzl8Q6s5PW8cn8oqc4FB83gwlvt7erLVdV4=; fh=SvhOHfehUV8tt+/DHSWfRHpXzQQzyN3k16tgFjiVtw0=; b=uU+mq2bGAcAK/kzU2uuRyfuz2JM8S9jwi8QXwTaTEfVUDA+pl+r+NLbxl8/HFZqQWQ 6n5Cn/nk4Oihkcn5C+RVqOq3twadZISqotnQuGqi+rowqR8yuxfKiS2Oo2v+SSyKrbRg KeoEiOFuv1cqPPSk3RBTGFqEG11WYz6nEP0XWJ83YK4eosz8pjb/d/fT8jQ49kYoPPbv PLpzTlxUWd2/NS0YVR6tFQEIBIXTGsQwDcUQCmFm0zehSzV8aKYdp1OiREYGDp0Ism6J dSmOz5UmzYd5bwobVedynzPiwhjyHv1kSR7olU/JiIwXgGTazcddRYcaU+oqJ3z8ozL/ kQww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=j7XwkUNJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id t36-20020a170906c3a400b0099bcc37923esi1255315ejz.690.2023.11.03.13.57.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Nov 2023 13:57:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=j7XwkUNJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 723C4831555A; Fri, 3 Nov 2023 13:56:02 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230317AbjKCU4A (ORCPT + 99 others); Fri, 3 Nov 2023 16:56:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54376 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1378183AbjKCTxT (ORCPT ); Fri, 3 Nov 2023 15:53:19 -0400 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.10]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2D0551BC; Fri, 3 Nov 2023 12:53:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1699041197; x=1730577197; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=M2LYr3uiwRiw2hfh8eZTwB7i1h0z6rfdmlPTebmD3d0=; b=j7XwkUNJ9/9TsLf520/+Oq7tI0HVVk7sYI7K0eruNZwAHHTp5APL7stF ZVXqMFPr5J9hxpl56MZqOTuz7X8rVz02qvb7q+JwGhbazGD8vjv9j0Tgm BZkbTz6vSK1Q5goHNQWEjetBUCNSR147I8aNDCVlDiOsFgUYGSOZhDPTD M3CO2M/HdpYagw0KrFQxAF+UPwueJuYHdDSWEzmEqTPyTYYbQ8GrO38Iq bBPMNXOwGsfLszNJ195wjaFfGZqCewALS3ov//dt99aBXUDXqW2AJdZqT cXizvIKbCfllAC9U5mKGTWNUVwu1Bc1FhAAwkGk8g0rCK6aW+JzUdtaEp g==; X-IronPort-AV: E=McAfee;i="6600,9927,10883"; a="1962964" X-IronPort-AV: E=Sophos;i="6.03,275,1694761200"; d="scan'208";a="1962964" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orvoesa102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Nov 2023 12:53:17 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10883"; a="761719316" X-IronPort-AV: E=Sophos;i="6.03,275,1694761200"; d="scan'208";a="761719316" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga002.jf.intel.com with ESMTP; 03 Nov 2023 12:53:14 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id D66EC5E8; Fri, 3 Nov 2023 21:53:13 +0200 (EET) From: Andy Shevchenko To: Andy Shevchenko , Linus Walleij , linux-leds@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Pavel Machek , Lee Jones Subject: [PATCH v1 3/4] leds: trigger: gpio: Use sysfs_emit() to instead of s*printf() Date: Fri, 3 Nov 2023 21:53:09 +0200 Message-Id: <20231103195310.948327-3-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.40.0.1.gaa8946217a0b In-Reply-To: <20231103195310.948327-1-andriy.shevchenko@linux.intel.com> References: <20231103195310.948327-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,SPF_HELO_NONE,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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Fri, 03 Nov 2023 13:56:02 -0700 (PDT) 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: Andy Shevchenko --- drivers/leds/trigger/ledtrig-gpio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/leds/trigger/ledtrig-gpio.c b/drivers/leds/trigger/ledtrig-gpio.c index 8a30f9228186..8824be19881f 100644 --- a/drivers/leds/trigger/ledtrig-gpio.c +++ b/drivers/leds/trigger/ledtrig-gpio.c @@ -46,7 +46,7 @@ static ssize_t gpio_trig_brightness_show(struct device *dev, { struct gpio_trig_data *gpio_data = led_trigger_get_drvdata(dev); - return sprintf(buf, "%u\n", gpio_data->desired_brightness); + return sysfs_emit(buf, "%u\n", gpio_data->desired_brightness); } static ssize_t gpio_trig_brightness_store(struct device *dev, -- 2.40.0.1.gaa8946217a0b