Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ipmi: Rename "user_data" to "recv_msg" in an SMI message

It's only used to hold the corresponding receive message, so fix the
name to make that clear and the type so nothing else can be accidentally
assigned to it.

Signed-off-by: Corey Minyard <corey@minyard.net>

+15 -14
+13 -13
drivers/char/ipmi/ipmi_msghandler.c
··· 1959 1959 smi_msg->data[0] = (msg->netfn << 2) | (smi_addr->lun & 0x3); 1960 1960 smi_msg->data[1] = msg->cmd; 1961 1961 smi_msg->msgid = msgid; 1962 - smi_msg->user_data = recv_msg; 1962 + smi_msg->recv_msg = recv_msg; 1963 1963 if (msg->data_len > 0) 1964 1964 memcpy(&smi_msg->data[2], msg->data, msg->data_len); 1965 1965 smi_msg->data_size = msg->data_len + 2; ··· 2040 2040 * Save the receive message so we can use it 2041 2041 * to deliver the response. 2042 2042 */ 2043 - smi_msg->user_data = recv_msg; 2043 + smi_msg->recv_msg = recv_msg; 2044 2044 } else { 2045 2045 mutex_lock(&intf->seq_lock); 2046 2046 ··· 2153 2153 memcpy(smi_msg->data + 4, msg->data, msg->data_len); 2154 2154 smi_msg->data_size = msg->data_len + 4; 2155 2155 2156 - smi_msg->user_data = recv_msg; 2156 + smi_msg->recv_msg = recv_msg; 2157 2157 2158 2158 return 0; 2159 2159 } ··· 2216 2216 * Save the receive message so we can use it 2217 2217 * to deliver the response. 2218 2218 */ 2219 - smi_msg->user_data = recv_msg; 2219 + smi_msg->recv_msg = recv_msg; 2220 2220 } else { 2221 2221 mutex_lock(&intf->seq_lock); 2222 2222 ··· 4066 4066 struct ipmi_recv_msg *recv_msg; 4067 4067 struct ipmi_ipmb_direct_addr *daddr; 4068 4068 4069 - recv_msg = msg->user_data; 4069 + recv_msg = msg->recv_msg; 4070 4070 if (recv_msg == NULL) { 4071 4071 dev_warn(intf->si_dev, 4072 4072 "IPMI direct message received with no owner. This could be because of a malformed message, or because of a hardware error. Contact your hardware vendor for assistance.\n"); ··· 4489 4489 struct ipmi_recv_msg *recv_msg; 4490 4490 struct ipmi_system_interface_addr *smi_addr; 4491 4491 4492 - recv_msg = msg->user_data; 4492 + recv_msg = msg->recv_msg; 4493 4493 if (recv_msg == NULL) { 4494 4494 dev_warn(intf->si_dev, 4495 4495 "IPMI SMI message received with no owner. This could be because of a malformed message, or because of a hardware error. Contact your hardware vendor for assistance.\n"); ··· 4563 4563 } else if ((msg->data_size >= 2) 4564 4564 && (msg->data[0] == (IPMI_NETFN_APP_REQUEST << 2)) 4565 4565 && (msg->data[1] == IPMI_SEND_MSG_CMD) 4566 - && (msg->user_data == NULL)) { 4566 + && (msg->recv_msg == NULL)) { 4567 4567 4568 4568 if (intf->in_shutdown || intf->run_to_completion) 4569 4569 goto out; 4570 4570 4571 4571 /* 4572 4572 * This is the local response to a command send, start 4573 - * the timer for these. The user_data will not be 4573 + * the timer for these. The recv_msg will not be 4574 4574 * NULL if this is a response send, and we will let 4575 4575 * response sends just go through. 4576 4576 */ ··· 4630 4630 requeue = handle_ipmb_direct_rcv_rsp(intf, msg); 4631 4631 } else if ((msg->rsp[0] == ((IPMI_NETFN_APP_REQUEST|1) << 2)) 4632 4632 && (msg->rsp[1] == IPMI_SEND_MSG_CMD) 4633 - && (msg->user_data != NULL)) { 4633 + && (msg->recv_msg != NULL)) { 4634 4634 /* 4635 4635 * It's a response to a response we sent. For this we 4636 4636 * deliver a send message response to the user. ··· 4647 4647 cc = msg->rsp[2]; 4648 4648 4649 4649 process_response_response: 4650 - recv_msg = msg->user_data; 4650 + recv_msg = msg->recv_msg; 4651 4651 4652 4652 requeue = 0; 4653 4653 if (!recv_msg) ··· 4836 4836 if (newmsg) { 4837 4837 cc = intf->handlers->sender(intf->send_info, newmsg); 4838 4838 if (cc) { 4839 - if (newmsg->user_data) 4839 + if (newmsg->recv_msg) 4840 4840 deliver_err_response(intf, 4841 - newmsg->user_data, cc); 4841 + newmsg->recv_msg, cc); 4842 4842 else 4843 4843 ipmi_free_smi_msg(newmsg); 4844 4844 goto restart; ··· 5185 5185 rv = kmalloc(sizeof(struct ipmi_smi_msg), GFP_ATOMIC); 5186 5186 if (rv) { 5187 5187 rv->done = free_smi_msg; 5188 - rv->user_data = NULL; 5188 + rv->recv_msg = NULL; 5189 5189 rv->type = IPMI_SMI_MSG_TYPE_NORMAL; 5190 5190 atomic_inc(&smi_msg_inuse_count); 5191 5191 }
+2 -1
include/linux/ipmi_smi.h
··· 110 110 enum ipmi_smi_msg_type type; 111 111 112 112 long msgid; 113 - void *user_data; 113 + /* Response to this message, will be NULL if not from a user request. */ 114 + struct ipmi_recv_msg *recv_msg; 114 115 115 116 int data_size; 116 117 unsigned char data[IPMI_MAX_MSG_LENGTH];