Skip to contentSkip to conversation

ipmi: Make ipmi_usr_hndl const

PATCH In review [email protected] 2 participants 5 messages Jan 10, 2017 – Feb 9, 2017

Subsystems (2)
lore
Share & tools
lore
#2 lore raw

PATCH 2/2 acpi:ipmi: Make IPMI user handler const

In reply to [email protected]

From: Corey Minyard <[email protected]>

ipmi_create_user() now takes the user handlers as const, make it const in the ACPI IPMI code.

---
 drivers/acpi/acpi_ipmi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/acpi/acpi_ipmi.c +1 -1
index f77956c..747c2ba 100644
@@ -56,7 +56,7 @@ struct acpi_ipmi_device {
 struct ipmi_driver_data {
 	struct list_head ipmi_devices;
 	struct ipmi_smi_watcher bmc_events;
-	struct ipmi_user_hndl ipmi_hndlrs;
+	const struct ipmi_user_hndl ipmi_hndlrs;
 	struct mutex ipmi_lock;
 
 	/*
Signature · 1 line
2.7.4
#0 lore raw

cover ipmi: Make ipmi_usr_hndl const

This makes the handlers for IPMI users able to be const, then sets all the users const. Trivial, but I need an ack from the ACPI people on this. Thanks.

#1 lore raw

PATCH 1/2 ipmi: make ipmi_usr_hndl const

From: Corey Minyard <[email protected]>

It's only function pointers.

---
 drivers/char/ipmi/ipmi_devintf.c    | 2 +-
 drivers/char/ipmi/ipmi_msghandler.c | 4 ++--
 drivers/char/ipmi/ipmi_watchdog.c   | 2 +-
 include/linux/ipmi.h                | 2 +-
 4 files changed, 5 insertions(+), 5 deletions(-)
drivers/char/ipmi/ipmi_devintf.c +1 -1
index a21407d..f45119c 100644
@@ -108,7 +108,7 @@ static int ipmi_fasync(int fd, struct file *file, int on)
 	return (result);
 }
 
-static struct ipmi_user_hndl ipmi_hndlrs =
+static const struct ipmi_user_hndl ipmi_hndlrs =
 {
 	.ipmi_recv_hndl	= file_receive_handler,
 };
drivers/char/ipmi/ipmi_msghandler.c +2 -2
index 92e53ac..9f69995 100644
@@ -102,7 +102,7 @@ struct ipmi_user {
 	struct kref refcount;
 
 	/* The upper layer that handles receive messages. */
-	struct ipmi_user_hndl *handler;
+	const struct ipmi_user_hndl *handler;
 	void             *handler_data;
 
 	/* The interface this user is bound to. */
@@ -919,7 +919,7 @@ static int intf_err_seq(ipmi_smi_t   intf,
 
 
 int ipmi_create_user(unsigned int          if_num,
-		     struct ipmi_user_hndl *handler,
+		     const struct ipmi_user_hndl *handler,
 		     void                  *handler_data,
 		     ipmi_user_t           *user)
 {
drivers/char/ipmi/ipmi_watchdog.c +1 -1
index 4035495..30b9e83 100644
@@ -985,7 +985,7 @@ static void ipmi_wdog_pretimeout_handler(void *handler_data)
 	pretimeout_since_last_heartbeat = 1;
 }
 
-static struct ipmi_user_hndl ipmi_hndlrs = {
+static const struct ipmi_user_hndl ipmi_hndlrs = {
 	.ipmi_recv_hndl           = ipmi_wdog_msg_handler,
 	.ipmi_watchdog_pretimeout = ipmi_wdog_pretimeout_handler
 };
include/linux/ipmi.h +1 -1
index 78c5d5a..f1045b2 100644
@@ -100,7 +100,7 @@ struct ipmi_user_hndl {
 
 /* Create a new user of the IPMI layer on the given interface number. */
 int ipmi_create_user(unsigned int          if_num,
-		     struct ipmi_user_hndl *handler,
+		     const struct ipmi_user_hndl *handler,
 		     void                  *handler_data,
 		     ipmi_user_t           *user);
 
Signature · 1 line
2.7.4
#3 lore raw

Re: [PATCH 2/2] acpi:ipmi: Make IPMI user handler const

In reply to [email protected]
Quoted 9 lines · On Tuesday, January 10, 2017 07:40:13 AM [email protected] wrote:

From: Corey Minyard <[email protected]>

ipmi_create_user() now takes the user handlers as const, make it const in the ACPI IPMI code.

Please let me know if you want me to apply this.

Otherwise, feel free to add my ACK to it and route it whatever way you think is appropriate.

Quoted 10 lines
---
 drivers/acpi/acpi_ipmi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/acpi/acpi_ipmi.c +0 -0
index f77956c..747c2ba 100644

drivers/acpi/acpi_ipmi.c struct acpi_ipmi_device { · line 62

Quoted 8 lines
drivers/acpi/acpi_ipmi.c +1 -1
@@ -56,7 +56,7 @@ struct acpi_ipmi_device {
 struct ipmi_driver_data {
 	struct list_head ipmi_devices;
 	struct ipmi_smi_watcher bmc_events;
-	struct ipmi_user_hndl ipmi_hndlrs;
+	const struct ipmi_user_hndl ipmi_hndlrs;
 	struct mutex ipmi_lock;
 
 	/*

Thanks,
Rafael

#4 lore raw

Re: [PATCH 2/2] acpi:ipmi: Make IPMI user handler const

Quoted 6 lines · Rafael J. Wysocki
Quoted 5 lines · On Tuesday, January 10, 2017 07:40:13 AM [email protected] wrote:

From: Corey Minyard <[email protected]>

ipmi_create_user() now takes the user handlers as const, make it const in the ACPI IPMI code.

Quoted 8 lines
Quoted 4 lines

Please let me know if you want me to apply this.

Otherwise, feel free to add my ACK to it and route it whatever way you think is appropriate.

Thanks, I'll add your ACK and apply it through the IPMI tree.

-corey

Quoted 16 lines
Quoted 16 lines
---
  drivers/acpi/acpi_ipmi.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/acpi/acpi_ipmi.c +1 -1
index f77956c..747c2ba 100644
@@ -56,7 +56,7 @@ struct acpi_ipmi_device {
  struct ipmi_driver_data {
  	struct list_head ipmi_devices;
  	struct ipmi_smi_watcher bmc_events;
-	struct ipmi_user_hndl ipmi_hndlrs;
+	const struct ipmi_user_hndl ipmi_hndlrs;
  	struct mutex ipmi_lock;
 
Quoted 5 lines

drivers/acpi/acpi_ipmi.c struct acpi_ipmi_device { · line 62

Quoted 2 lines
drivers/acpi/acpi_ipmi.c +0 -0
  	/*

Thanks,
Rafael

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most engaging tech sites, SlashDot.org! http://sdm.link/slashdot