Skip to contentSkip to conversation

mux: constify mux class

PATCH RESEND In review Bartosz Golaszewski 2 participants 4 messages Dec 5, 2024 – Jan 10, 2025 Multiplexer

lore
Share & tools
lore
#0 lore raw

PATCH RESEND 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.

---
Greg: Peter picked this up into his branch long before the v6.13 merge window, then never sent it upstream. Could you pick this up this time into your tree?

 drivers/mux/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mux/core.c +1 -1
index 78c0022697ec7..02be4ba372571 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.45.2
#1 lore raw
Quoted 30 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.

---
Greg: Peter picked this up into his branch long before the v6.13 merge window, then never sent it upstream. Could you pick this up this time into your tree?

 drivers/mux/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mux/core.c +1 -1
index 78c0022697ec7..02be4ba372571 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.45.2

Sure, will do, thanks. I should sweep the tree for the remaining ones as well...

thanks,

greg k-h

#2 lore raw
Quoted 36 lines · Greg Kroah-Hartman
Quoted 28 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.

---
Greg: Peter picked this up into his branch long before the v6.13 merge window, then never sent it upstream. Could you pick this up this time into your tree?

 drivers/mux/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mux/core.c +1 -2
index 78c0022697ec7..02be4ba372571 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.45.2

Sure, will do, thanks. I should sweep the tree for the remaining ones as well...

Quoted 3 lines

thanks,

greg k-h

Hi! Gentle ping because I'm not sure if this got lost or you're still getting to it in your queue.

Bart

#3 lore raw
Quoted 38 lines · Bartosz Golaszewski
Quoted 36 lines · Greg Kroah-Hartman
Quoted 28 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.

---
Greg: Peter picked this up into his branch long before the v6.13 merge window, then never sent it upstream. Could you pick this up this time into your tree?

 drivers/mux/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mux/core.c +1 -2
index 78c0022697ec7..02be4ba372571 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.45.2

Sure, will do, thanks. I should sweep the tree for the remaining ones as well...

Quoted 6 lines
Quoted 3 lines

thanks,

greg k-h

Hi! Gentle ping because I'm not sure if this got lost or you're still getting to it in your queue.

Sorry for the delay, will get this now.

greg k-h