Commit 6b3a3e12 authored by Rohan McLure's avatar Rohan McLure Committed by Michael Ellerman
Browse files

powerpc: declare unmodified attribute_group usages const

Inspired by (bd75b4ef: Constify static attribute_group structs),
accepted by linux-next, reported:
https://patchwork.ozlabs.org/project/linuxppc-dev/patch/20220210202805.7750-4-rikard.falkeborn@gmail.com/



Nearly all singletons of type struct attribute_group are never modified,
and so are candidates for being const. Declare them as const.

Signed-off-by: default avatarRohan McLure <rmclure@linux.ibm.com>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20220307231414.86560-1-rmclure@linux.ibm.com
parent 5986f6b6
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -249,8 +249,8 @@ void unregister_spu_syscalls(struct spufs_calls *calls);
int spu_add_dev_attr(struct device_attribute *attr);
void spu_remove_dev_attr(struct device_attribute *attr);

int spu_add_dev_attr_group(struct attribute_group *attrs);
void spu_remove_dev_attr_group(struct attribute_group *attrs);
int spu_add_dev_attr_group(const struct attribute_group *attrs);
void spu_remove_dev_attr_group(const struct attribute_group *attrs);

extern void notify_spus_active(void);
extern void do_notify_spus_active(void);
+2 −2
Original line number Diff line number Diff line
@@ -130,7 +130,7 @@ static struct attribute *generic_compat_events_attr[] = {
	NULL
};

static struct attribute_group generic_compat_pmu_events_group = {
static const struct attribute_group generic_compat_pmu_events_group = {
	.name = "events",
	.attrs = generic_compat_events_attr,
};
@@ -146,7 +146,7 @@ static struct attribute *generic_compat_pmu_format_attr[] = {
	NULL,
};

static struct attribute_group generic_compat_pmu_format_group = {
static const struct attribute_group generic_compat_pmu_format_group = {
	.name = "format",
	.attrs = generic_compat_pmu_format_attr,
};
+3 −3
Original line number Diff line number Diff line
@@ -204,7 +204,7 @@ static struct attribute *format_attrs[] = {
	NULL,
};

static struct attribute_group format_group = {
static const struct attribute_group format_group = {
	.name = "format",
	.attrs = format_attrs,
};
@@ -1148,7 +1148,7 @@ static struct attribute *cpumask_attrs[] = {
	NULL,
};

static struct attribute_group cpumask_attr_group = {
static const struct attribute_group cpumask_attr_group = {
	.attrs = cpumask_attrs,
};

@@ -1162,7 +1162,7 @@ static struct attribute *if_attrs[] = {
	NULL,
};

static struct attribute_group if_group = {
static const struct attribute_group if_group = {
	.name = "interface",
	.bin_attrs = if_bin_attrs,
	.attrs = if_attrs,
+4 −4
Original line number Diff line number Diff line
@@ -65,12 +65,12 @@ static struct attribute *format_attrs[] = {
	NULL,
};

static struct attribute_group format_group = {
static const struct attribute_group format_group = {
	.name = "format",
	.attrs = format_attrs,
};

static struct attribute_group event_group = {
static const struct attribute_group event_group = {
	.name  = "events",
	.attrs = hv_gpci_event_attrs,
};
@@ -126,11 +126,11 @@ static struct attribute *cpumask_attrs[] = {
	NULL,
};

static struct attribute_group cpumask_attr_group = {
static const struct attribute_group cpumask_attr_group = {
	.attrs = cpumask_attrs,
};

static struct attribute_group interface_group = {
static const struct attribute_group interface_group = {
	.name = "interface",
	.attrs = interface_attrs,
};
+3 −3
Original line number Diff line number Diff line
@@ -71,7 +71,7 @@ static struct attribute *imc_format_attrs[] = {
	NULL,
};

static struct attribute_group imc_format_group = {
static const struct attribute_group imc_format_group = {
	.name = "format",
	.attrs = imc_format_attrs,
};
@@ -90,7 +90,7 @@ static struct attribute *trace_imc_format_attrs[] = {
	NULL,
};

static struct attribute_group trace_imc_format_group = {
static const struct attribute_group trace_imc_format_group = {
.name = "format",
.attrs = trace_imc_format_attrs,
};
@@ -125,7 +125,7 @@ static struct attribute *imc_pmu_cpumask_attrs[] = {
	NULL,
};

static struct attribute_group imc_pmu_cpumask_attr_group = {
static const struct attribute_group imc_pmu_cpumask_attr_group = {
	.attrs = imc_pmu_cpumask_attrs,
};

Loading