* [PATCH 0/2] drivers/iommu: Constify structs
@ 2020-05-25 21:49 Rikard Falkeborn
2020-05-25 21:49 ` [PATCH 1/2] iommu/hyper-v: Constify hyperv_ir_domain_ops Rikard Falkeborn
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Rikard Falkeborn @ 2020-05-25 21:49 UTC (permalink / raw)
To: Joerg Roedel
Cc: Wei Liu, Stephen Hemminger, linux-hyperv, Haiyang Zhang,
linux-kernel, Rikard Falkeborn, Chen-Yu Tsai, iommu,
Maxime Ripard, K. Y. Srinivasan, linux-arm-kernel
Constify some structs with function pointers to allow the compiler to
put them in read-only memory. There is not dependency between the
patches.
Rikard Falkeborn (2):
iommu/hyper-v: Constify hyperv_ir_domain_ops
iommu/sun50i: Constify sun50i_iommu_ops
drivers/iommu/hyperv-iommu.c | 2 +-
drivers/iommu/sun50i-iommu.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
--
2.26.2
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 1/2] iommu/hyper-v: Constify hyperv_ir_domain_ops
2020-05-25 21:49 [PATCH 0/2] drivers/iommu: Constify structs Rikard Falkeborn
@ 2020-05-25 21:49 ` Rikard Falkeborn
2020-05-26 9:09 ` Wei Liu
2020-05-25 21:49 ` [PATCH 2/2] iommu/sun50i: Constify sun50i_iommu_ops Rikard Falkeborn
2020-05-27 12:39 ` [PATCH 0/2] drivers/iommu: Constify structs Joerg Roedel
2 siblings, 1 reply; 6+ messages in thread
From: Rikard Falkeborn @ 2020-05-25 21:49 UTC (permalink / raw)
To: Joerg Roedel
Cc: Wei Liu, Stephen Hemminger, linux-hyperv, Haiyang Zhang,
linux-kernel, Rikard Falkeborn, iommu, K. Y. Srinivasan
The struct hyperv_ir_domain_ops is not modified and can be made const to
allow the compiler to put it in read-only memory.
Before:
text data bss dec hex filename
2916 1180 1120 5216 1460 drivers/iommu/hyperv-iommu.o
After:
text data bss dec hex filename
3044 1052 1120 5216 1460 drivers/iommu/hyperv-iommu.o
Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
---
drivers/iommu/hyperv-iommu.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/iommu/hyperv-iommu.c b/drivers/iommu/hyperv-iommu.c
index a386b83e0e34..3c0c67a99c7b 100644
--- a/drivers/iommu/hyperv-iommu.c
+++ b/drivers/iommu/hyperv-iommu.c
@@ -131,7 +131,7 @@ static int hyperv_irq_remapping_activate(struct irq_domain *domain,
return 0;
}
-static struct irq_domain_ops hyperv_ir_domain_ops = {
+static const struct irq_domain_ops hyperv_ir_domain_ops = {
.alloc = hyperv_irq_remapping_alloc,
.free = hyperv_irq_remapping_free,
.activate = hyperv_irq_remapping_activate,
--
2.26.2
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 2/2] iommu/sun50i: Constify sun50i_iommu_ops
2020-05-25 21:49 [PATCH 0/2] drivers/iommu: Constify structs Rikard Falkeborn
2020-05-25 21:49 ` [PATCH 1/2] iommu/hyper-v: Constify hyperv_ir_domain_ops Rikard Falkeborn
@ 2020-05-25 21:49 ` Rikard Falkeborn
2020-05-26 7:56 ` Maxime Ripard
2020-05-27 12:39 ` [PATCH 0/2] drivers/iommu: Constify structs Joerg Roedel
2 siblings, 1 reply; 6+ messages in thread
From: Rikard Falkeborn @ 2020-05-25 21:49 UTC (permalink / raw)
To: Joerg Roedel
Cc: Chen-Yu Tsai, Maxime Ripard, linux-kernel, iommu,
Rikard Falkeborn, linux-arm-kernel
The struct sun50i_iommu_ops is not modified and can be made const to
allow the compiler to put it in read-only memory.
Before:
text data bss dec hex filename
14358 2501 64 16923 421b drivers/iommu/sun50i-iommu.o
After:
text data bss dec hex filename
14726 2117 64 16907 420b drivers/iommu/sun50i-iommu.o
Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
---
drivers/iommu/sun50i-iommu.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/iommu/sun50i-iommu.c b/drivers/iommu/sun50i-iommu.c
index 1fa09ddcebd4..fce605e96aa2 100644
--- a/drivers/iommu/sun50i-iommu.c
+++ b/drivers/iommu/sun50i-iommu.c
@@ -771,7 +771,7 @@ static int sun50i_iommu_of_xlate(struct device *dev,
return iommu_fwspec_add_ids(dev, &id, 1);
}
-static struct iommu_ops sun50i_iommu_ops = {
+static const struct iommu_ops sun50i_iommu_ops = {
.pgsize_bitmap = SZ_4K,
.attach_dev = sun50i_iommu_attach_device,
.detach_dev = sun50i_iommu_detach_device,
--
2.26.2
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 2/2] iommu/sun50i: Constify sun50i_iommu_ops
2020-05-25 21:49 ` [PATCH 2/2] iommu/sun50i: Constify sun50i_iommu_ops Rikard Falkeborn
@ 2020-05-26 7:56 ` Maxime Ripard
0 siblings, 0 replies; 6+ messages in thread
From: Maxime Ripard @ 2020-05-26 7:56 UTC (permalink / raw)
To: Rikard Falkeborn; +Cc: Chen-Yu Tsai, iommu, linux-arm-kernel, linux-kernel
On Mon, May 25, 2020 at 11:49:58PM +0200, Rikard Falkeborn wrote:
> The struct sun50i_iommu_ops is not modified and can be made const to
> allow the compiler to put it in read-only memory.
>
> Before:
> text data bss dec hex filename
> 14358 2501 64 16923 421b drivers/iommu/sun50i-iommu.o
>
> After:
> text data bss dec hex filename
> 14726 2117 64 16907 420b drivers/iommu/sun50i-iommu.o
>
> Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
Acked-by: Maxime Ripard <mripard@kernel.org>
Thanks!
Maxime
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 1/2] iommu/hyper-v: Constify hyperv_ir_domain_ops
2020-05-25 21:49 ` [PATCH 1/2] iommu/hyper-v: Constify hyperv_ir_domain_ops Rikard Falkeborn
@ 2020-05-26 9:09 ` Wei Liu
0 siblings, 0 replies; 6+ messages in thread
From: Wei Liu @ 2020-05-26 9:09 UTC (permalink / raw)
To: Rikard Falkeborn
Cc: Wei Liu, Stephen Hemminger, linux-hyperv, linux-kernel, iommu,
K. Y. Srinivasan, Haiyang Zhang
On Mon, May 25, 2020 at 11:49:57PM +0200, Rikard Falkeborn wrote:
> The struct hyperv_ir_domain_ops is not modified and can be made const to
> allow the compiler to put it in read-only memory.
>
> Before:
> text data bss dec hex filename
> 2916 1180 1120 5216 1460 drivers/iommu/hyperv-iommu.o
>
> After:
> text data bss dec hex filename
> 3044 1052 1120 5216 1460 drivers/iommu/hyperv-iommu.o
>
> Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
Acked-by: Wei Liu <wei.liu@kernel.org>
> ---
> drivers/iommu/hyperv-iommu.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/iommu/hyperv-iommu.c b/drivers/iommu/hyperv-iommu.c
> index a386b83e0e34..3c0c67a99c7b 100644
> --- a/drivers/iommu/hyperv-iommu.c
> +++ b/drivers/iommu/hyperv-iommu.c
> @@ -131,7 +131,7 @@ static int hyperv_irq_remapping_activate(struct irq_domain *domain,
> return 0;
> }
>
> -static struct irq_domain_ops hyperv_ir_domain_ops = {
> +static const struct irq_domain_ops hyperv_ir_domain_ops = {
> .alloc = hyperv_irq_remapping_alloc,
> .free = hyperv_irq_remapping_free,
> .activate = hyperv_irq_remapping_activate,
> --
> 2.26.2
>
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 0/2] drivers/iommu: Constify structs
2020-05-25 21:49 [PATCH 0/2] drivers/iommu: Constify structs Rikard Falkeborn
2020-05-25 21:49 ` [PATCH 1/2] iommu/hyper-v: Constify hyperv_ir_domain_ops Rikard Falkeborn
2020-05-25 21:49 ` [PATCH 2/2] iommu/sun50i: Constify sun50i_iommu_ops Rikard Falkeborn
@ 2020-05-27 12:39 ` Joerg Roedel
2 siblings, 0 replies; 6+ messages in thread
From: Joerg Roedel @ 2020-05-27 12:39 UTC (permalink / raw)
To: Rikard Falkeborn
Cc: Wei Liu, Stephen Hemminger, linux-hyperv, Haiyang Zhang,
linux-kernel, Maxime Ripard, Chen-Yu Tsai, iommu,
K. Y. Srinivasan, linux-arm-kernel
On Mon, May 25, 2020 at 11:49:56PM +0200, Rikard Falkeborn wrote:
> Constify some structs with function pointers to allow the compiler to
> put them in read-only memory. There is not dependency between the
> patches.
>
> Rikard Falkeborn (2):
> iommu/hyper-v: Constify hyperv_ir_domain_ops
> iommu/sun50i: Constify sun50i_iommu_ops
>
> drivers/iommu/hyperv-iommu.c | 2 +-
> drivers/iommu/sun50i-iommu.c | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
Applied both, thanks.
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2020-05-27 12:39 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-25 21:49 [PATCH 0/2] drivers/iommu: Constify structs Rikard Falkeborn
2020-05-25 21:49 ` [PATCH 1/2] iommu/hyper-v: Constify hyperv_ir_domain_ops Rikard Falkeborn
2020-05-26 9:09 ` Wei Liu
2020-05-25 21:49 ` [PATCH 2/2] iommu/sun50i: Constify sun50i_iommu_ops Rikard Falkeborn
2020-05-26 7:56 ` Maxime Ripard
2020-05-27 12:39 ` [PATCH 0/2] drivers/iommu: Constify structs Joerg Roedel
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).