From patchwork Wed Aug 2 16:07:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Marek_Beh=C3=BAn?= X-Patchwork-Id: 710458 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1E786C001DF for ; Wed, 2 Aug 2023 16:08:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229689AbjHBQIP (ORCPT ); Wed, 2 Aug 2023 12:08:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53730 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235494AbjHBQIA (ORCPT ); Wed, 2 Aug 2023 12:08:00 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B146B171B for ; Wed, 2 Aug 2023 09:07:57 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 15FC361A3D for ; Wed, 2 Aug 2023 16:07:57 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 72933C433CC; Wed, 2 Aug 2023 16:07:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1690992476; bh=avOfQmV9Z9Lnbmep5+IC25tsNLI6S6GVFISxDXZdVvc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CqJiJNrH8ipg3m6gOM0AuzAcarWZEKP4l3FLswivObKCd7GWI7to6HThaXNNbgsiu sed4V/TJFE2+kmX0X5ic2ErrvAPZSVrvLYzgEpRMrEVcP/buLccgDtJ88As2O6UyY4 lNGSBAxwTKB0rft++gO1FRKDUUY5clmBBphRpfhf0BPvv0p/rHGMLOGFtrl4GquZIS FhmJ9yURL8+egjxVIFQ0pm4OW7w/o5GxmzLFqBjWzxAzzUnVgKZKw9CWphVM0Wucoe 8e05GtbMvMM/Lp+pr3nmfq2r4heuXZGUQHdma+JWAMdPs1lL5pc8UPfQgmGUAnSQm3 UImtrb00e41VA== From: =?utf-8?q?Marek_Beh=C3=BAn?= To: Pavel Machek , Lee Jones , linux-leds@vger.kernel.org Cc: =?utf-8?q?Marek_Beh=C3=BAn?= Subject: [PATCH v3 3/6] leds: turris-omnia: use sysfs_emit() instead of sprintf() Date: Wed, 2 Aug 2023 18:07:45 +0200 Message-ID: <20230802160748.11208-4-kabel@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230802160748.11208-1-kabel@kernel.org> References: <20230802160748.11208-1-kabel@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-leds@vger.kernel.org Use the dedicated sysfs_emit() function instead of sprintf() in sysfs attribute accessor brightness_show(). Signed-off-by: Marek BehĂșn --- drivers/leds/leds-turris-omnia.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/leds/leds-turris-omnia.c b/drivers/leds/leds-turris-omnia.c index bb2a2b411a56..9fca0acb2270 100644 --- a/drivers/leds/leds-turris-omnia.c +++ b/drivers/leds/leds-turris-omnia.c @@ -196,7 +196,7 @@ static ssize_t brightness_show(struct device *dev, struct device_attribute *a, if (ret < 0) return ret; - return sprintf(buf, "%d\n", ret); + return sysfs_emit(buf, "%d\n", ret); } static ssize_t brightness_store(struct device *dev, struct device_attribute *a,