linux-hyperv.vger.kernel.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 1/2] iommu/hyper-v: Constify hyperv_ir_domain_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: iommu, linux-kernel, Rikard Falkeborn, K. Y. Srinivasan,
	Haiyang Zhang, Stephen Hemminger, Wei Liu, linux-hyperv,
	Maxime Ripard, Chen-Yu Tsai, 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


^ permalink raw reply	[flat|nested] 4+ 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-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: iommu, linux-kernel, Rikard Falkeborn, K. Y. Srinivasan,
	Haiyang Zhang, Stephen Hemminger, Wei Liu, linux-hyperv

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


^ permalink raw reply related	[flat|nested] 4+ 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; 4+ messages in thread
From: Wei Liu @ 2020-05-26  9:09 UTC (permalink / raw)
  To: Rikard Falkeborn
  Cc: Joerg Roedel, iommu, linux-kernel, K. Y. Srinivasan,
	Haiyang Zhang, Stephen Hemminger, Wei Liu, linux-hyperv

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
> 

^ 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 1/2] iommu/hyper-v: Constify hyperv_ir_domain_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: iommu, linux-kernel, K. Y. Srinivasan, Haiyang Zhang,
	Stephen Hemminger, Wei Liu, linux-hyperv, Maxime Ripard,
	Chen-Yu Tsai, 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.

^ 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 1/2] iommu/hyper-v: Constify hyperv_ir_domain_ops Rikard Falkeborn
2020-05-26  9:09   ` Wei Liu
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).