linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] drivers/iommu: Constify structs
@ 2020-05-25 21:49 Rikard Falkeborn
  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
  0 siblings, 2 replies; 4+ 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


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 4+ 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 ` Rikard Falkeborn
  2020-05-26  7:56   ` Maxime Ripard
  2020-05-27 12:39 ` [PATCH 0/2] drivers/iommu: Constify structs Joerg Roedel
  1 sibling, 1 reply; 4+ 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


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 4+ 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; 4+ messages in thread
From: Maxime Ripard @ 2020-05-26  7:56 UTC (permalink / raw)
  To: Rikard Falkeborn
  Cc: Joerg Roedel, 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

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 4+ 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 2/2] iommu/sun50i: Constify sun50i_iommu_ops Rikard Falkeborn
@ 2020-05-27 12:39 ` Joerg Roedel
  1 sibling, 0 replies; 4+ 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.

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-05-27 12:39 UTC | newest]

Thread overview: 4+ 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 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).