Skip to contentSkip to conversation

mux: constify mux class

PATCH Superseded Bartosz Golaszewski 2 participants 5 messages Oct 14, 2024 – Nov 30, 2024 Multiplexer

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mux: constify mux class

From: Bartosz Golaszewski <[email protected]>

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

---
 drivers/mux/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mux/core.c +1 -1
index 78c0022697ec..02be4ba37257 100644
@@ -42,7 +42,7 @@ struct mux_state {
 	unsigned int state;
 };
 
-static struct class mux_class = {
+static const struct class mux_class = {
 	.name = "mux",
 };
 
Signature · 1 line
2.43.0
#1 lore raw
Quoted 25 lines · Bartosz Golaszewski

From: Bartosz Golaszewski <[email protected]>

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

---
 drivers/mux/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mux/core.c +1 -2
index 78c0022697ec..02be4ba37257 100644
@@ -42,7 +42,7 @@ struct mux_state {
        unsigned int state;
 };
 
-static struct class mux_class = {
+static const struct class mux_class = {
        .name = "mux",
 };
 
--
Quoted 2 lines

2.43.0

Gentle ping.

Bart

#2 lore raw
Quoted 26 lines · Bartosz Golaszewski
Quoted 24 lines · Bartosz Golaszewski

From: Bartosz Golaszewski <[email protected]>

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

---
 drivers/mux/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mux/core.c +1 -1
index 78c0022697ec..02be4ba37257 100644
@@ -42,7 +42,7 @@ struct mux_state {
        unsigned int state;
 };
 
-static struct class mux_class = {
+static const struct class mux_class = {
        .name = "mux",
 };
 
Quoted 7 lines
Quoted 3 lines

--
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

#3 lore raw

Hi Bartosz,

Quoted 33 lines · Bartosz Golaszewski
Quoted 32 lines · Bartosz Golaszewski
Quoted 25 lines · Bartosz Golaszewski

From: Bartosz Golaszewski <[email protected]>

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

---
 drivers/mux/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mux/core.c +1 -2
index 78c0022697ec..02be4ba37257 100644
@@ -42,7 +42,7 @@ struct mux_state {
        unsigned int state;
 };
 
-static struct class mux_class = {
+static const struct class mux_class = {
        .name = "mux",
 };
 
--
Quoted 2 lines

2.43.0

Gentle ping.

Quoted 6 lines
Quoted 1 line

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

#4 lore raw
Quoted 41 lines · Peter Rosin

Hi Bartosz,

Quoted 37 lines · Bartosz Golaszewski
Quoted 26 lines · Bartosz Golaszewski
Quoted 24 lines · Bartosz Golaszewski

From: Bartosz Golaszewski <[email protected]>

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

---
 drivers/mux/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mux/core.c +1 -1
index 78c0022697ec..02be4ba37257 100644
@@ -42,7 +42,7 @@ struct mux_state {
        unsigned int state;
 };
 
-static struct class mux_class = {
+static const struct class mux_class = {
        .name = "mux",
 };
 
Quoted 7 lines
Quoted 3 lines

--
2.43.0

Gentle ping.

Bart

Peter,

Quoted 8 lines
Quoted 2 lines

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

Peter,

This commit is in next but it's not gone upstream and it's almost the end of the merge window. I don't see any pending PR from you. Can this go upstream?

Bartosz