[PATCH] mux: constify mux class

Bartosz Golaszewski posted 1 patch 1 month, 1 week ago
drivers/mux/core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] mux: constify mux class
Posted by Bartosz Golaszewski 1 month, 1 week ago
From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>

All class functions used here take a const pointer to the class
structure so we can make the struct itself constant.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
---
 drivers/mux/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mux/core.c b/drivers/mux/core.c
index 78c0022697ec..02be4ba37257 100644
--- a/drivers/mux/core.c
+++ b/drivers/mux/core.c
@@ -42,7 +42,7 @@ struct mux_state {
 	unsigned int state;
 };
 
-static struct class mux_class = {
+static const struct class mux_class = {
 	.name = "mux",
 };
 
-- 
2.43.0
Re: [PATCH] mux: constify mux class
Posted by Bartosz Golaszewski 1 month ago
On Mon, Oct 14, 2024 at 2:25 PM Bartosz Golaszewski <brgl@bgdev.pl> wrote:
>
> From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
>
> All class functions used here take a const pointer to the class
> structure so we can make the struct itself constant.
>
> Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
> ---
>  drivers/mux/core.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/mux/core.c b/drivers/mux/core.c
> index 78c0022697ec..02be4ba37257 100644
> --- a/drivers/mux/core.c
> +++ b/drivers/mux/core.c
> @@ -42,7 +42,7 @@ struct mux_state {
>         unsigned int state;
>  };
>
> -static struct class mux_class = {
> +static const struct class mux_class = {
>         .name = "mux",
>  };
>
> --
> 2.43.0
>

Gentle ping.

Bart
Re: [PATCH] mux: constify mux class
Posted by Bartosz Golaszewski 3 weeks, 4 days ago
On Thu, Oct 24, 2024 at 9:08 PM Bartosz Golaszewski <brgl@bgdev.pl> wrote:
>
> On Mon, Oct 14, 2024 at 2:25 PM Bartosz Golaszewski <brgl@bgdev.pl> wrote:
> >
> > From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
> >
> > All class functions used here take a const pointer to the class
> > structure so we can make the struct itself constant.
> >
> > Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
> > ---
> >  drivers/mux/core.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/mux/core.c b/drivers/mux/core.c
> > index 78c0022697ec..02be4ba37257 100644
> > --- a/drivers/mux/core.c
> > +++ b/drivers/mux/core.c
> > @@ -42,7 +42,7 @@ struct mux_state {
> >         unsigned int state;
> >  };
> >
> > -static struct class mux_class = {
> > +static const struct class mux_class = {
> >         .name = "mux",
> >  };
> >
> > --
> > 2.43.0
> >
>
> Gentle ping.
>
> Bart

Peter,

Your email doesn't bounce so I assume you are getting this. Any reason
why this simple change is not being picked up?

Bart
Re: [PATCH] mux: constify mux class
Posted by Peter Rosin 3 weeks ago
Hi Bartosz,

2024-11-01 at 15:21, Bartosz Golaszewski wrote:
> On Thu, Oct 24, 2024 at 9:08 PM Bartosz Golaszewski <brgl@bgdev.pl> wrote:
>>
>> On Mon, Oct 14, 2024 at 2:25 PM Bartosz Golaszewski <brgl@bgdev.pl> wrote:
>>>
>>> From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
>>>
>>> All class functions used here take a const pointer to the class
>>> structure so we can make the struct itself constant.
>>>
>>> Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
>>> ---
>>>  drivers/mux/core.c | 2 +-
>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/drivers/mux/core.c b/drivers/mux/core.c
>>> index 78c0022697ec..02be4ba37257 100644
>>> --- a/drivers/mux/core.c
>>> +++ b/drivers/mux/core.c
>>> @@ -42,7 +42,7 @@ struct mux_state {
>>>         unsigned int state;
>>>  };
>>>
>>> -static struct class mux_class = {
>>> +static const struct class mux_class = {
>>>         .name = "mux",
>>>  };
>>>
>>> --
>>> 2.43.0
>>>
>>
>> Gentle ping.
>>
>> Bart
> 
> Peter,
> 
> Your email doesn't bounce so I assume you are getting this. Any reason
> why this simple change is not being picked up?

I'm here, and am just being slow as usual. Sorry about that. I have now
added the patch to linux-next.

Cheers,
Peter