From nobody Mon Feb 9 16:02:06 2026 Received: from relay2-d.mail.gandi.net (relay2-d.mail.gandi.net [217.70.183.194]) (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 20C1E2D3A7E; Tue, 29 Apr 2025 14:08:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.194 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1745935718; cv=none; b=l4XGJZ0YzDXx2mulVVhNVEGVUUa7plv1ukfPeswoqeUUBl2vNmAQE9N+/CqbWh/Z+QRRM+43oKM1+b27P3f4/I95I915tSPBawL0O4LioMsUT508HM+eflZOBMV/AoxOWOaN/1p2t6F+CEYPwdG+Gar6Df40k0H0MCdEe8++K7o= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1745935718; c=relaxed/simple; bh=+aAA16FTYLRmWbshpJ9pUQeSkphpkdFkRrJ/KdAnQ+8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=FRllTe1pZZgRJLXnamMDEEDSGnd/+QFyuhDIVtQ1ODJu7z1cgd+o1XfkgikQVHeKKrewJxv//6tkgqXzGED+KbBKgbjuzuMD7zXzzfT1ykAgx68YVKMH3QDSjlAWN70YoY47wMH0zkDpHXv9u+PNYIdcESoMy3YsObmxbKmiucU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=AQV21J5d; arc=none smtp.client-ip=217.70.183.194 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="AQV21J5d" Received: by mail.gandi.net (Postfix) with ESMTPSA id 49AB5438D3; Tue, 29 Apr 2025 14:08:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1745935714; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=uVnOTtGeCXTWeccSia58p6zIA8GKsXwjy6PZJHwEICA=; b=AQV21J5d7uGHdVbA0idjVbqHGxfFSgGg0h6ZfxLTh+jxZJ1kU+Ky7iGdBMelXPkGCvTYar nyV0iWx1cVKdoBggJZrpYoWOVIsfKlZX2A3M6uaeGeOriJQDx34qdJZlV4BFEhDyxsRZ81 Y/IeodcKnDzgv9YQ/7oG13Ns9GkoJ+zazB0DA3b8CfjOzv77MuZcdTk3QmAosapRasRTcY IjzjEIJ6KyEAijlEGFdmMKt2GTiz/iRYALoJaxwYLCgeJ4tTfB3yMKRCnZvnbiplMcc0EA 1YxevkaXrvPpbIlqchcu/hFah/xXRLnO99UYGyRUuE+nKbs07B11MSZ1SdpOBA== From: Thomas Richard Date: Tue, 29 Apr 2025 16:08:25 +0200 Subject: [PATCH v4 11/12] lib/string_choices: Add str_input_output() helper Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250429-aaeon-up-board-pinctrl-support-v4-11-b3fffc11417d@bootlin.com> References: <20250429-aaeon-up-board-pinctrl-support-v4-0-b3fffc11417d@bootlin.com> In-Reply-To: <20250429-aaeon-up-board-pinctrl-support-v4-0-b3fffc11417d@bootlin.com> To: Linus Walleij , Andy Shevchenko , Bartosz Golaszewski , Geert Uytterhoeven , Kees Cook , Andy Shevchenko Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, thomas.petazzoni@bootlin.com, DanieleCleri@aaeon.eu, GaryWang@aaeon.com.tw, linux-hardening@vger.kernel.org, Thomas Richard X-Mailer: b4 0.14.1 X-GND-State: clean X-GND-Score: -100 X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgddvieegtddvucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuifetpfffkfdpucggtfgfnhhsuhgsshgtrhhisggvnecuuegrihhlohhuthemuceftddunecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhfffugggtgffkfhgjvfevofesthejredtredtjeenucfhrhhomhepvfhhohhmrghsucftihgthhgrrhguuceothhhohhmrghsrdhrihgthhgrrhgusegsohhothhlihhnrdgtohhmqeenucggtffrrghtthgvrhhnpeektdehvdeiteehtdelteffheduveelgeelvdetgedvueejgefhhfekgefgfeduveenucfkphepvdgrtddumegtsgdugeemheehieemjegrtddtmegutgekudemrggrugdtmehfuggtrgemtggtudgrnecuvehluhhsthgvrhfuihiivgepleenucfrrghrrghmpehinhgvthepvdgrtddumegtsgdugeemheehieemjegrtddtmegutgekudemrggrugdtmehfuggtrgemtggtudgrpdhhvghloheplgduvdejrddtrddurddungdpmhgrihhlfhhrohhmpehthhhomhgrshdrrhhitghhrghrugessghoohhtlhhinhdrtghomhdpnhgspghrtghpthhtohepudefpdhrtghpthhtoheplhhinhhugidqhhgrrhguvghnihhnghesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopehlihhnuhhsrdifrghllhgvihhjsehlihhnrghrohdrohhrghdprhgtphhtthhopegrnhguhieskhgvrhhnvghlrdhorhhgp dhrtghpthhtohepkhgvvghssehkvghrnhgvlhdrohhrghdprhgtphhtthhopehgvggvrhhtodhrvghnvghsrghssehglhhiuggvrhdrsggvpdhrtghpthhtohepffgrnhhivghlvgevlhgvrhhisegrrggvohhnrdgvuhdprhgtphhtthhopegrnhgurhhihidrshhhvghvtghhvghnkhhosehlihhnuhigrdhinhhtvghlrdgtohhmpdhrtghpthhtohepthhhohhmrghsrdhpvghtrgiiiihonhhisegsohhothhlihhnrdgtohhm X-GND-Sasl: thomas.richard@bootlin.com Add str_input_output() helper to return 'input' or 'output' string literal. Also add the inversed variant str_output_input(). Signed-off-by: Thomas Richard Reviewed-by: Andy Shevchenko --- include/linux/string_choices.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/linux/string_choices.h b/include/linux/string_choices.h index f3ba4f52ff26..ca2f37fa1b84 100644 --- a/include/linux/string_choices.h +++ b/include/linux/string_choices.h @@ -41,6 +41,12 @@ static inline const char *str_high_low(bool v) } #define str_low_high(v) str_high_low(!(v)) =20 +static inline const char *str_input_output(bool v) +{ + return v ? "input" : "output"; +} +#define str_output_input str_input_output(!(v)) + static inline const char *str_on_off(bool v) { return v ? "on" : "off"; --=20 2.39.5