2021-01-31 14:28:58

by Rikard Falkeborn

[permalink] [raw]
Subject: [PATCH 1/3] mfd: gateworks-gsc: Constify static struct attribute_group

The only usage of attr_group is to pass its address to
sysfs_create_group() and sysfs_remove_group(), both which takes pointers
to const attribute_group structs. Make it const to allow the compiler to
put it in read-only memory.

Done with the help of coccinelle.

Signed-off-by: Rikard Falkeborn <[email protected]>
---
drivers/mfd/gateworks-gsc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mfd/gateworks-gsc.c b/drivers/mfd/gateworks-gsc.c
index d87876747b91..8745f9d8c26f 100644
--- a/drivers/mfd/gateworks-gsc.c
+++ b/drivers/mfd/gateworks-gsc.c
@@ -150,7 +150,7 @@ static struct attribute *gsc_attrs[] = {
NULL,
};

-static struct attribute_group attr_group = {
+static const struct attribute_group attr_group = {
.attrs = gsc_attrs,
};

--
2.30.0


2021-03-03 01:56:05

by Lee Jones

[permalink] [raw]
Subject: Re: [PATCH 1/3] mfd: gateworks-gsc: Constify static struct attribute_group

On Sun, 31 Jan 2021, Rikard Falkeborn wrote:

> The only usage of attr_group is to pass its address to
> sysfs_create_group() and sysfs_remove_group(), both which takes pointers
> to const attribute_group structs. Make it const to allow the compiler to
> put it in read-only memory.
>
> Done with the help of coccinelle.
>
> Signed-off-by: Rikard Falkeborn <[email protected]>
> ---
> drivers/mfd/gateworks-gsc.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)

These patches do not seem to be on LKML.

Do you know if they were rejected for some reason?

--
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog

2021-03-04 05:23:33

by Rikard Falkeborn

[permalink] [raw]
Subject: Re: [PATCH 1/3] mfd: gateworks-gsc: Constify static struct attribute_group

On Mon, Mar 01, 2021 at 09:56:45AM +0000, Lee Jones wrote:
> On Sun, 31 Jan 2021, Rikard Falkeborn wrote:
>
> > The only usage of attr_group is to pass its address to
> > sysfs_create_group() and sysfs_remove_group(), both which takes pointers
> > to const attribute_group structs. Make it const to allow the compiler to
> > put it in read-only memory.
> >
> > Done with the help of coccinelle.
> >
> > Signed-off-by: Rikard Falkeborn <[email protected]>
> > ---
> > drivers/mfd/gateworks-gsc.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
>
> These patches do not seem to be on LKML.
>
> Do you know if they were rejected for some reason?
>

I did not recieve any bounce or rejection emails. I have a vague memory
that I saw someone mentioning in another mail that there was some
problems with LKML and that patches were lost, but I can't find it now,
and I'm not sure if it was around the same time as these patches were
sent.

Should I resend the series?

/Rikard

2021-03-04 06:07:10

by Lee Jones

[permalink] [raw]
Subject: Re: [PATCH 1/3] mfd: gateworks-gsc: Constify static struct attribute_group

On Mon, 01 Mar 2021, Rikard Falkeborn wrote:

> On Mon, Mar 01, 2021 at 09:56:45AM +0000, Lee Jones wrote:
> > On Sun, 31 Jan 2021, Rikard Falkeborn wrote:
> >
> > > The only usage of attr_group is to pass its address to
> > > sysfs_create_group() and sysfs_remove_group(), both which takes pointers
> > > to const attribute_group structs. Make it const to allow the compiler to
> > > put it in read-only memory.
> > >
> > > Done with the help of coccinelle.
> > >
> > > Signed-off-by: Rikard Falkeborn <[email protected]>
> > > ---
> > > drivers/mfd/gateworks-gsc.c | 2 +-
> > > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > These patches do not seem to be on LKML.
> >
> > Do you know if they were rejected for some reason?
> >
>
> I did not recieve any bounce or rejection emails. I have a vague memory
> that I saw someone mentioning in another mail that there was some
> problems with LKML and that patches were lost, but I can't find it now,
> and I'm not sure if it was around the same time as these patches were
> sent.
>
> Should I resend the series?

Please submit a [RESEND].

If it fails again, I'll apply the patches manually.

--
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog