From: "Heiko Stübner" <heiko@sntech.de>
To: Will Deacon <will@kernel.org>,
Robin Murphy <robin.murphy@arm.com>,
Joerg Roedel <joro@8bytes.org>, Yong Wu <yong.wu@mediatek.com>,
Matthias Brugger <matthias.bgg@gmail.com>,
AngeloGioacchino Del Regno
<angelogioacchino.delregno@collabora.com>,
linux-arm-kernel@lists.infradead.org, iommu@lists.linux.dev,
linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org,
linux-rockchip@lists.infradead.org,
Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Cc: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Subject: Re: [PATCH] iommu: Use str_enable_disable-like helpers
Date: Tue, 14 Jan 2025 20:53:28 +0100 [thread overview]
Message-ID: <23826147.6Emhk5qWAg@diego> (raw)
In-Reply-To: <20250114192642.912331-1-krzysztof.kozlowski@linaro.org>
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@linaro.org>
> ---
> drivers/iommu/rockchip-iommu.c | 3 ++-
For the Rockchip part
Acked-by: Heiko Stuebner <heiko@sntech.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);
>
>
next prev parent reply other threads:[~2025-01-14 19:55 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-14 19:26 [PATCH] iommu: Use str_enable_disable-like helpers Krzysztof Kozlowski
2025-01-14 19:53 ` Heiko Stübner [this message]
2025-01-15 19:12 ` Jason Gunthorpe
2025-01-16 3:05 ` Pranjal Shrivastava
2025-01-17 8:01 ` Joerg Roedel
2025-01-20 12:53 ` AngeloGioacchino Del Regno
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=23826147.6Emhk5qWAg@diego \
--to=heiko@sntech.de \
--cc=angelogioacchino.delregno@collabora.com \
--cc=iommu@lists.linux.dev \
--cc=joro@8bytes.org \
--cc=krzysztof.kozlowski@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=linux-rockchip@lists.infradead.org \
--cc=matthias.bgg@gmail.com \
--cc=robin.murphy@arm.com \
--cc=will@kernel.org \
--cc=yong.wu@mediatek.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).