From: "Isaac J. Manjarres" <isaacm@codeaurora.org>
To: iommu@lists.linux-foundation.org,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Cc: "Isaac J. Manjarres" <isaacm@codeaurora.org>,
will@kernel.org, joro@8bytes.org, robin.murphy@arm.com,
pdaly@codeaurora.org, pratikp@codeaurora.org,
kernel-team@android.com
Subject: [PATCH 2/3] iommu/io-pgtable: Prepare for modularization
Date: Fri, 18 Dec 2020 00:38:41 -0800 [thread overview]
Message-ID: <1608280722-19841-3-git-send-email-isaacm@codeaurora.org> (raw)
In-Reply-To: <1608280722-19841-1-git-send-email-isaacm@codeaurora.org>
The io-pgtable source file uses the #ifdef preprocessor macro
to construct the io_pgtable_init_table structure. However,
the #ifdef macro evaluates to true if the config it is testing
is set to y. This is not ideal when the configs that the
io-pgtable code checks for can be m, so use IS_ENABLED() instead.
Also, add the GPL v2 module license to the io-pgtable source file.
Signed-off-by: Isaac J. Manjarres <isaacm@codeaurora.org>
---
drivers/iommu/io-pgtable.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/drivers/iommu/io-pgtable.c b/drivers/iommu/io-pgtable.c
index 94394c8..867ecb4 100644
--- a/drivers/iommu/io-pgtable.c
+++ b/drivers/iommu/io-pgtable.c
@@ -10,18 +10,19 @@
#include <linux/bug.h>
#include <linux/io-pgtable.h>
#include <linux/kernel.h>
+#include <linux/module.h>
#include <linux/types.h>
static const struct io_pgtable_init_fns *
io_pgtable_init_table[IO_PGTABLE_NUM_FMTS] = {
-#ifdef CONFIG_IOMMU_IO_PGTABLE_LPAE
+#if IS_ENABLED(CONFIG_IOMMU_IO_PGTABLE_LPAE)
[ARM_32_LPAE_S1] = &io_pgtable_arm_32_lpae_s1_init_fns,
[ARM_32_LPAE_S2] = &io_pgtable_arm_32_lpae_s2_init_fns,
[ARM_64_LPAE_S1] = &io_pgtable_arm_64_lpae_s1_init_fns,
[ARM_64_LPAE_S2] = &io_pgtable_arm_64_lpae_s2_init_fns,
[ARM_MALI_LPAE] = &io_pgtable_arm_mali_lpae_init_fns,
#endif
-#ifdef CONFIG_IOMMU_IO_PGTABLE_ARMV7S
+#if IS_ENABLED(CONFIG_IOMMU_IO_PGTABLE_ARMV7S)
[ARM_V7S] = &io_pgtable_arm_v7s_init_fns,
#endif
};
@@ -68,3 +69,5 @@ void free_io_pgtable_ops(struct io_pgtable_ops *ops)
io_pgtable_init_table[iop->fmt]->free(iop);
}
EXPORT_SYMBOL_GPL(free_io_pgtable_ops);
+
+MODULE_LICENSE("GPL v2");
--
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project
next prev parent reply other threads:[~2020-12-18 8:40 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-18 8:38 [RFC PATCH 0/3] iommu: Permit modular builds of io-pgtable drivers Isaac J. Manjarres
2020-12-18 8:38 ` [PATCH 1/3] iommu/io-pgtable-arm: Prepare for modularization Isaac J. Manjarres
2020-12-18 12:38 ` Robin Murphy
2020-12-18 18:59 ` isaacm
2020-12-21 15:22 ` Robin Murphy
2020-12-22 0:54 ` isaacm
2020-12-18 8:38 ` Isaac J. Manjarres [this message]
2020-12-18 8:38 ` [PATCH 3/3] iommu/io-pgtable: Allow building as a module Isaac J. Manjarres
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=1608280722-19841-3-git-send-email-isaacm@codeaurora.org \
--to=isaacm@codeaurora.org \
--cc=iommu@lists.linux-foundation.org \
--cc=joro@8bytes.org \
--cc=kernel-team@android.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pdaly@codeaurora.org \
--cc=pratikp@codeaurora.org \
--cc=robin.murphy@arm.com \
--cc=will@kernel.org \
/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
Powered by JetHome