All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] perf/hisi: Constify static attribute_group structs
@ 2021-06-05 22:15 ` Rikard Falkeborn
  0 siblings, 0 replies; 4+ messages in thread
From: Rikard Falkeborn @ 2021-06-05 22:15 UTC (permalink / raw)
  To: Shaokun Zhang, Will Deacon, Mark Rutland
  Cc: linux-arm-kernel, linux-kernel, Rikard Falkeborn

These are only put in an array of pointers to const attribute_group
structs. Make them const like the other static attribute_group structs
to allow the compiler to put them in read-only memory.

Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
---
 drivers/perf/hisilicon/hisi_uncore_pa_pmu.c   | 2 +-
 drivers/perf/hisilicon/hisi_uncore_sllc_pmu.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/perf/hisilicon/hisi_uncore_pa_pmu.c b/drivers/perf/hisilicon/hisi_uncore_pa_pmu.c
index e1f71eab5640..83264ec0a957 100644
--- a/drivers/perf/hisilicon/hisi_uncore_pa_pmu.c
+++ b/drivers/perf/hisilicon/hisi_uncore_pa_pmu.c
@@ -333,7 +333,7 @@ static struct attribute *hisi_pa_pmu_identifier_attrs[] = {
 	NULL
 };
 
-static struct attribute_group hisi_pa_pmu_identifier_group = {
+static const struct attribute_group hisi_pa_pmu_identifier_group = {
 	.attrs = hisi_pa_pmu_identifier_attrs,
 };
 
diff --git a/drivers/perf/hisilicon/hisi_uncore_sllc_pmu.c b/drivers/perf/hisilicon/hisi_uncore_sllc_pmu.c
index 08e028d9a406..6aedc303ff56 100644
--- a/drivers/perf/hisilicon/hisi_uncore_sllc_pmu.c
+++ b/drivers/perf/hisilicon/hisi_uncore_sllc_pmu.c
@@ -366,7 +366,7 @@ static struct attribute *hisi_sllc_pmu_identifier_attrs[] = {
 	NULL
 };
 
-static struct attribute_group hisi_sllc_pmu_identifier_group = {
+static const struct attribute_group hisi_sllc_pmu_identifier_group = {
 	.attrs = hisi_sllc_pmu_identifier_attrs,
 };
 
-- 
2.31.1


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

* [PATCH] perf/hisi: Constify static attribute_group structs
@ 2021-06-05 22:15 ` Rikard Falkeborn
  0 siblings, 0 replies; 4+ messages in thread
From: Rikard Falkeborn @ 2021-06-05 22:15 UTC (permalink / raw)
  To: Shaokun Zhang, Will Deacon, Mark Rutland
  Cc: linux-arm-kernel, linux-kernel, Rikard Falkeborn

These are only put in an array of pointers to const attribute_group
structs. Make them const like the other static attribute_group structs
to allow the compiler to put them in read-only memory.

Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
---
 drivers/perf/hisilicon/hisi_uncore_pa_pmu.c   | 2 +-
 drivers/perf/hisilicon/hisi_uncore_sllc_pmu.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/perf/hisilicon/hisi_uncore_pa_pmu.c b/drivers/perf/hisilicon/hisi_uncore_pa_pmu.c
index e1f71eab5640..83264ec0a957 100644
--- a/drivers/perf/hisilicon/hisi_uncore_pa_pmu.c
+++ b/drivers/perf/hisilicon/hisi_uncore_pa_pmu.c
@@ -333,7 +333,7 @@ static struct attribute *hisi_pa_pmu_identifier_attrs[] = {
 	NULL
 };
 
-static struct attribute_group hisi_pa_pmu_identifier_group = {
+static const struct attribute_group hisi_pa_pmu_identifier_group = {
 	.attrs = hisi_pa_pmu_identifier_attrs,
 };
 
diff --git a/drivers/perf/hisilicon/hisi_uncore_sllc_pmu.c b/drivers/perf/hisilicon/hisi_uncore_sllc_pmu.c
index 08e028d9a406..6aedc303ff56 100644
--- a/drivers/perf/hisilicon/hisi_uncore_sllc_pmu.c
+++ b/drivers/perf/hisilicon/hisi_uncore_sllc_pmu.c
@@ -366,7 +366,7 @@ static struct attribute *hisi_sllc_pmu_identifier_attrs[] = {
 	NULL
 };
 
-static struct attribute_group hisi_sllc_pmu_identifier_group = {
+static const struct attribute_group hisi_sllc_pmu_identifier_group = {
 	.attrs = hisi_sllc_pmu_identifier_attrs,
 };
 
-- 
2.31.1


_______________________________________________
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] perf/hisi: Constify static attribute_group structs
  2021-06-05 22:15 ` Rikard Falkeborn
@ 2021-06-08 13:21   ` Will Deacon
  -1 siblings, 0 replies; 4+ messages in thread
From: Will Deacon @ 2021-06-08 13:21 UTC (permalink / raw)
  To: Mark Rutland, Rikard Falkeborn, Shaokun Zhang
  Cc: catalin.marinas, kernel-team, Will Deacon, linux-arm-kernel,
	linux-kernel

On Sun, 6 Jun 2021 00:15:14 +0200, Rikard Falkeborn wrote:
> These are only put in an array of pointers to const attribute_group
> structs. Make them const like the other static attribute_group structs
> to allow the compiler to put them in read-only memory.

Applied to will (for-next/perf), thanks!

[1/1] perf/hisi: Constify static attribute_group structs
      https://git.kernel.org/will/c/59d697a99daa

Cheers,
-- 
Will

https://fixes.arm64.dev
https://next.arm64.dev
https://will.arm64.dev

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

* Re: [PATCH] perf/hisi: Constify static attribute_group structs
@ 2021-06-08 13:21   ` Will Deacon
  0 siblings, 0 replies; 4+ messages in thread
From: Will Deacon @ 2021-06-08 13:21 UTC (permalink / raw)
  To: Mark Rutland, Rikard Falkeborn, Shaokun Zhang
  Cc: catalin.marinas, kernel-team, Will Deacon, linux-arm-kernel,
	linux-kernel

On Sun, 6 Jun 2021 00:15:14 +0200, Rikard Falkeborn wrote:
> These are only put in an array of pointers to const attribute_group
> structs. Make them const like the other static attribute_group structs
> to allow the compiler to put them in read-only memory.

Applied to will (for-next/perf), thanks!

[1/1] perf/hisi: Constify static attribute_group structs
      https://git.kernel.org/will/c/59d697a99daa

Cheers,
-- 
Will

https://fixes.arm64.dev
https://next.arm64.dev
https://will.arm64.dev

_______________________________________________
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:[~2021-06-08 13:25 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-05 22:15 [PATCH] perf/hisi: Constify static attribute_group structs Rikard Falkeborn
2021-06-05 22:15 ` Rikard Falkeborn
2021-06-08 13:21 ` Will Deacon
2021-06-08 13:21   ` Will Deacon

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.