[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <23826147.6Emhk5qWAg@diego>
Date: Tue, 14 Jan 2025 20:53:28 +0100
From: Heiko Stübner <heiko@...ech.de>
To: Will Deacon <will@...nel.org>, Robin Murphy <robin.murphy@....com>,
Joerg Roedel <joro@...tes.org>, Yong Wu <yong.wu@...iatek.com>,
Matthias Brugger <matthias.bgg@...il.com>,
AngeloGioacchino Del Regno <angelogioacchino.delregno@...labora.com>,
linux-arm-kernel@...ts.infradead.org, iommu@...ts.linux.dev,
linux-kernel@...r.kernel.org, linux-mediatek@...ts.infradead.org,
linux-rockchip@...ts.infradead.org,
Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org>
Cc: Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org>
Subject: Re: [PATCH] iommu: Use str_enable_disable-like helpers
Am Dienstag, 14. Januar 2025, 20:26:42 CET schrieb Krzysztof Kozlowski:
> Replace ternary (condition ? "enable" : "disable") syntax with helpers
> from string_choices.h because:
> 1. Simple function call with one argument is easier to read. Ternary
> operator has three arguments and with wrapping might lead to quite
> long code.
> 2. Is slightly shorter thus also easier to read.
> 3. It brings uniformity in the text - same string.
> 4. Allows deduping by the linker, which results in a smaller binary
> file.
>
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org>
> ---
> drivers/iommu/rockchip-iommu.c | 3 ++-
For the Rockchip part
Acked-by: Heiko Stuebner <heiko@...ech.de>
> diff --git a/drivers/iommu/rockchip-iommu.c b/drivers/iommu/rockchip-iommu.c
> index 4b369419b32c..323cc665c357 100644
> --- a/drivers/iommu/rockchip-iommu.c
> +++ b/drivers/iommu/rockchip-iommu.c
> @@ -25,6 +25,7 @@
> #include <linux/pm_runtime.h>
> #include <linux/slab.h>
> #include <linux/spinlock.h>
> +#include <linux/string_choices.h>
>
> #include "iommu-pages.h"
>
> @@ -611,7 +612,7 @@ static irqreturn_t rk_iommu_irq(int irq, void *dev_id)
>
> dev_err(iommu->dev, "Page fault at %pad of type %s\n",
> &iova,
> - (flags == IOMMU_FAULT_WRITE) ? "write" : "read");
> + str_write_read(flags == IOMMU_FAULT_WRITE));
>
> log_iova(iommu, i, iova);
>
>
Powered by blists - more mailing lists