Commit cddeea3c authored by Alexander Viro's avatar Alexander Viro Committed by Linus Torvalds

[PATCH] impi annotation

drivers/char/ipmi/* annotated, structure shared between kernel and
userland (ioctls) split in two.
ACPI callback in the same code used to have wrong type - it should've been
void (...), not u32 (...).  Fixed.
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent b303d8d3
......@@ -174,7 +174,7 @@ static int handle_send_req(ipmi_user_t user,
{
int rv;
struct ipmi_addr addr;
unsigned char *msgdata;
struct kernel_ipmi_msg msg;
if (req->addr_len > sizeof(struct ipmi_addr))
return -EINVAL;
......@@ -182,8 +182,11 @@ static int handle_send_req(ipmi_user_t user,
if (copy_from_user(&addr, req->addr, req->addr_len))
return -EFAULT;
msgdata = kmalloc(IPMI_MAX_MSG_LENGTH, GFP_KERNEL);
if (!msgdata)
msg.netfn = req->msg.netfn;
msg.cmd = req->msg.cmd;
msg.data_len = req->msg.data_len;
msg.data = kmalloc(IPMI_MAX_MSG_LENGTH, GFP_KERNEL);
if (!msg.data)
return -ENOMEM;
/* From here out we cannot return, we must jump to "out" for
......@@ -199,7 +202,7 @@ static int handle_send_req(ipmi_user_t user,
goto out;
}
if (copy_from_user(msgdata,
if (copy_from_user(msg.data,
req->msg.data,
req->msg.data_len))
{
......@@ -207,20 +210,19 @@ static int handle_send_req(ipmi_user_t user,
goto out;
}
} else {
req->msg.data_len = 0;
msg.data_len = 0;
}
req->msg.data = msgdata;
rv = ipmi_request_settime(user,
&addr,
req->msgid,
&(req->msg),
&msg,
NULL,
0,
retries,
retry_time_ms);
out:
kfree(msgdata);
kfree(msg.data);
return rv;
}
......
......@@ -907,7 +907,7 @@ ipmb_checksum(unsigned char *data, int size)
}
static inline void format_ipmb_msg(struct ipmi_smi_msg *smi_msg,
struct ipmi_msg *msg,
struct kernel_ipmi_msg *msg,
struct ipmi_ipmb_addr *ipmb_addr,
long msgid,
unsigned char ipmb_seq,
......@@ -949,7 +949,7 @@ static inline void format_ipmb_msg(struct ipmi_smi_msg *smi_msg,
}
static inline void format_lan_msg(struct ipmi_smi_msg *smi_msg,
struct ipmi_msg *msg,
struct kernel_ipmi_msg *msg,
struct ipmi_lan_addr *lan_addr,
long msgid,
unsigned char ipmb_seq,
......@@ -993,7 +993,7 @@ static inline int i_ipmi_request(ipmi_user_t user,
ipmi_smi_t intf,
struct ipmi_addr *addr,
long msgid,
struct ipmi_msg *msg,
struct kernel_ipmi_msg *msg,
void *user_msg_data,
void *supplied_smi,
struct ipmi_recv_msg *supplied_recv,
......@@ -1335,7 +1335,7 @@ static inline int i_ipmi_request(ipmi_user_t user,
goto out_err;
}
#if DEBUG_MSGING
#ifdef DEBUG_MSGING
{
int m;
for (m=0; m<smi_msg->data_size; m++)
......@@ -1356,7 +1356,7 @@ static inline int i_ipmi_request(ipmi_user_t user,
int ipmi_request(ipmi_user_t user,
struct ipmi_addr *addr,
long msgid,
struct ipmi_msg *msg,
struct kernel_ipmi_msg *msg,
void *user_msg_data,
int priority)
{
......@@ -1376,7 +1376,7 @@ int ipmi_request(ipmi_user_t user,
int ipmi_request_settime(ipmi_user_t user,
struct ipmi_addr *addr,
long msgid,
struct ipmi_msg *msg,
struct kernel_ipmi_msg *msg,
void *user_msg_data,
int priority,
int retries,
......@@ -1399,7 +1399,7 @@ int ipmi_request_settime(ipmi_user_t user,
int ipmi_request_supply_msgs(ipmi_user_t user,
struct ipmi_addr *addr,
long msgid,
struct ipmi_msg *msg,
struct kernel_ipmi_msg *msg,
void *user_msg_data,
void *supplied_smi,
struct ipmi_recv_msg *supplied_recv,
......@@ -1422,7 +1422,7 @@ int ipmi_request_supply_msgs(ipmi_user_t user,
int ipmi_request_with_source(ipmi_user_t user,
struct ipmi_addr *addr,
long msgid,
struct ipmi_msg *msg,
struct kernel_ipmi_msg *msg,
void *user_msg_data,
int priority,
unsigned char source_address,
......@@ -1609,7 +1609,7 @@ static void remove_proc_entries(ipmi_smi_t smi)
static int
send_channel_info_cmd(ipmi_smi_t intf, int chan)
{
struct ipmi_msg msg;
struct kernel_ipmi_msg msg;
unsigned char data[1];
struct ipmi_system_interface_addr si;
......@@ -2033,7 +2033,7 @@ static int handle_ipmb_get_msg_cmd(ipmi_smi_t intf,
msg->data[10] = ipmb_checksum(&(msg->data[6]), 4);
msg->data_size = 11;
#if DEBUG_MSGING
#ifdef DEBUG_MSGING
{
int m;
printk("Invalid command:");
......@@ -2424,7 +2424,7 @@ static int handle_new_recv_msg(ipmi_smi_t intf,
int requeue;
int chan;
#if DEBUG_MSGING
#ifdef DEBUG_MSGING
int m;
printk("Recv:");
for (m=0; m<msg->rsp_size; m++)
......@@ -2639,7 +2639,7 @@ send_from_recv_msg(ipmi_smi_t intf, struct ipmi_recv_msg *recv_msg,
MC, which don't get resent. */
intf->handlers->sender(intf->send_info, smi_msg, 0);
#if DEBUG_MSGING
#ifdef DEBUG_MSGING
{
int m;
printk("Resend: ");
......@@ -2873,7 +2873,7 @@ static void device_id_fetcher(ipmi_smi_t intf, struct ipmi_smi_msg *msg)
static void send_panic_events(char *str)
{
struct ipmi_msg msg;
struct kernel_ipmi_msg msg;
ipmi_smi_t intf;
unsigned char data[16];
int i;
......
......@@ -1132,7 +1132,7 @@ static int try_init_mem(int intf_num, struct smi_info **new_info)
static int acpi_failure = 0;
/* For GPE-type interrupts. */
u32 ipmi_acpi_gpe(void *context)
void ipmi_acpi_gpe(void *context)
{
struct smi_info *smi_info = context;
unsigned long flags;
......@@ -1156,7 +1156,6 @@ u32 ipmi_acpi_gpe(void *context)
smi_event_handler(smi_info, 0);
out:
spin_unlock_irqrestore(&(smi_info->si_lock), flags);
return 0;
}
static int acpi_gpe_irq_setup(struct smi_info *info)
......
......@@ -229,7 +229,7 @@ static int i_ipmi_set_timeout(struct ipmi_smi_msg *smi_msg,
struct ipmi_recv_msg *recv_msg,
int *send_heartbeat_now)
{
struct ipmi_msg msg;
struct kernel_ipmi_msg msg;
unsigned char data[6];
int rv;
struct ipmi_system_interface_addr addr;
......@@ -406,7 +406,7 @@ static struct ipmi_recv_msg panic_halt_heartbeat_recv_msg =
static int ipmi_heartbeat(void)
{
struct ipmi_msg msg;
struct kernel_ipmi_msg msg;
int rv;
struct ipmi_system_interface_addr addr;
......@@ -478,7 +478,7 @@ static int ipmi_heartbeat(void)
static void panic_halt_ipmi_heartbeat(void)
{
struct ipmi_msg msg;
struct kernel_ipmi_msg msg;
struct ipmi_system_interface_addr addr;
......
......@@ -155,6 +155,14 @@ struct ipmi_lan_addr
* out).
*/
struct ipmi_msg
{
unsigned char netfn;
unsigned char cmd;
unsigned short data_len;
unsigned char __user *data;
};
struct kernel_ipmi_msg
{
unsigned char netfn;
unsigned char cmd;
......@@ -223,7 +231,7 @@ struct ipmi_recv_msg
ipmi_user_t user;
struct ipmi_addr addr;
long msgid;
struct ipmi_msg msg;
struct kernel_ipmi_msg msg;
/* The user_msg_data is the data supplied when a message was
sent, if this is a response to a sent message. If this is
......@@ -316,7 +324,7 @@ unsigned char ipmi_get_my_LUN(ipmi_user_t user);
int ipmi_request(ipmi_user_t user,
struct ipmi_addr *addr,
long msgid,
struct ipmi_msg *msg,
struct kernel_ipmi_msg *msg,
void *user_msg_data,
int priority);
......@@ -336,7 +344,7 @@ int ipmi_request(ipmi_user_t user,
int ipmi_request_settime(ipmi_user_t user,
struct ipmi_addr *addr,
long msgid,
struct ipmi_msg *msg,
struct kernel_ipmi_msg *msg,
void *user_msg_data,
int priority,
int max_retries,
......@@ -348,7 +356,7 @@ int ipmi_request_settime(ipmi_user_t user,
int ipmi_request_with_source(ipmi_user_t user,
struct ipmi_addr *addr,
long msgid,
struct ipmi_msg *msg,
struct kernel_ipmi_msg *msg,
void *user_msg_data,
int priority,
unsigned char source_address,
......@@ -366,7 +374,7 @@ int ipmi_request_with_source(ipmi_user_t user,
int ipmi_request_supply_msgs(ipmi_user_t user,
struct ipmi_addr *addr,
long msgid,
struct ipmi_msg *msg,
struct kernel_ipmi_msg *msg,
void *user_msg_data,
void *supplied_smi,
struct ipmi_recv_msg *supplied_recv,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment