From patchwork Thu Jun 13 14:48:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Patchwork-Id: 13696922 Received: from todd.t-8ch.de (todd.t-8ch.de [159.69.126.157]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 75F4E1DFE1 for ; Thu, 13 Jun 2024 14:48:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=159.69.126.157 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718290128; cv=none; b=XtNUbjldervRS4jzEou60Q1IhhLFZQNDGVzGlcFs6Z18WGwW8cIVwodtMxC9RnxZY+wis1ZPLBL0CbGmuViKoaWGlcZOH5hORK5Ky8gSPI9Ga98umIf45jZClB1u6uovwSUEDIV9A6zz9Va8FVUluKTds/6IdWjqeZqxB1dB158= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718290128; c=relaxed/simple; bh=RYdWV51r8PcyeNbSw5etkeGipgLJ2iNvDv6KpRFCB3g=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=TxaIn3hisntSsydeppEpMP86Lm/qKXsDWuDP/5l/n4L6cECLObL+3YHKVwskIRPOGv4Obu80FOg2BK58TCkIi+quny4cqZOObMUEmOhOlNcZrxJf3Vcs8qaNhREhPIbGsM4roHW4AuzPy/3VtXOmV8g28RS+GM0lzGGxRJpQwNc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=weissschuh.net; spf=pass smtp.mailfrom=weissschuh.net; dkim=pass (1024-bit key) header.d=weissschuh.net header.i=@weissschuh.net header.b=XN1JFlti; arc=none smtp.client-ip=159.69.126.157 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=weissschuh.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=weissschuh.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=weissschuh.net header.i=@weissschuh.net header.b="XN1JFlti" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1718290120; bh=RYdWV51r8PcyeNbSw5etkeGipgLJ2iNvDv6KpRFCB3g=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=XN1JFltiFXp2L2rqTWR4Bz22ATckDg7dp1tfm/cpV2hBrSJEvEOCSoL97+FO3IO+z 85ywGoHF876rW5xjwbhMHGwN7zw3rMNyabdV8OpnQSAgk0NAQBXksKAKAK2j+e5tUS F6JedxHDukOqh/Zv8Ql0ybBwe6hROnjwyN0LtxKo= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Thu, 13 Jun 2024 16:48:37 +0200 Subject: [PATCH v3 2/5] leds: multicolor: Use led_get_color_name() function Precedence: bulk X-Mailing-List: chrome-platform@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240613-cros_ec-led-v3-2-500b50f41e0f@weissschuh.net> References: <20240613-cros_ec-led-v3-0-500b50f41e0f@weissschuh.net> In-Reply-To: <20240613-cros_ec-led-v3-0-500b50f41e0f@weissschuh.net> To: Pavel Machek , Lee Jones , =?utf-8?q?Thoma?= =?utf-8?q?s_Wei=C3=9Fschuh?= , Benson Leung , Guenter Roeck , Tzung-Bi Shih Cc: linux-leds@vger.kernel.org, linux-kernel@vger.kernel.org, chrome-platform@lists.linux.dev, Dustin Howett , Mario Limonciello , =?utf-8?q?Thomas_Wei=C3=9Fs?= =?utf-8?q?chuh?= X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1718290119; l=942; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=RYdWV51r8PcyeNbSw5etkeGipgLJ2iNvDv6KpRFCB3g=; b=OItp3aZh/jgZ1XoXq/Awow9+PJGcoX1ucS+3ULAY1SaAQkDtBjZYWsqdkIXTJJsHIMeZ7pUsA CuWDYaZXNKMDlICN14C6oy/Lv+V9npjsNFOx04X51PW3RxG0yI4/cYO X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= led_get_color_name() is a safer alternative to led_colors. led-class-multicolor.c is the only external user of led_colors and its removal allows unexporting the array. Signed-off-by: Thomas Weißschuh --- drivers/leds/led-class-multicolor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/leds/led-class-multicolor.c b/drivers/leds/led-class-multicolor.c index ec62a4811613..584e3786a1e7 100644 --- a/drivers/leds/led-class-multicolor.c +++ b/drivers/leds/led-class-multicolor.c @@ -101,7 +101,7 @@ static ssize_t multi_index_show(struct device *dev, for (i = 0; i < mcled_cdev->num_colors; i++) { index = mcled_cdev->subled_info[i].color_index; - len += sprintf(buf + len, "%s", led_colors[index]); + len += sprintf(buf + len, "%s", led_get_color_name(index)); if (i < mcled_cdev->num_colors - 1) len += sprintf(buf + len, " "); }