Commit c70d7499 authored by Corey Minyard's avatar Corey Minyard Committed by Linus Torvalds

ipmi: style fixes in the base code

Lots of style fixes for the base IPMI driver.  No functional changes.
Basically fixes everything reported by checkpatch and fixes the comment
style.
Signed-off-by: default avatarCorey Minyard <cminyard@mvista.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent ba8ff1c6
This diff is collapsed.
...@@ -75,8 +75,7 @@ ...@@ -75,8 +75,7 @@
* work for sockets. * work for sockets.
*/ */
#define IPMI_MAX_ADDR_SIZE 32 #define IPMI_MAX_ADDR_SIZE 32
struct ipmi_addr struct ipmi_addr {
{
/* Try to take these from the "Channel Medium Type" table /* Try to take these from the "Channel Medium Type" table
in section 6.5 of the IPMI 1.5 manual. */ in section 6.5 of the IPMI 1.5 manual. */
int addr_type; int addr_type;
...@@ -90,8 +89,7 @@ struct ipmi_addr ...@@ -90,8 +89,7 @@ struct ipmi_addr
* 0), or IPMC_BMC_CHANNEL if communicating directly with the BMC. * 0), or IPMC_BMC_CHANNEL if communicating directly with the BMC.
*/ */
#define IPMI_SYSTEM_INTERFACE_ADDR_TYPE 0x0c #define IPMI_SYSTEM_INTERFACE_ADDR_TYPE 0x0c
struct ipmi_system_interface_addr struct ipmi_system_interface_addr {
{
int addr_type; int addr_type;
short channel; short channel;
unsigned char lun; unsigned char lun;
...@@ -100,10 +98,9 @@ struct ipmi_system_interface_addr ...@@ -100,10 +98,9 @@ struct ipmi_system_interface_addr
/* An IPMB Address. */ /* An IPMB Address. */
#define IPMI_IPMB_ADDR_TYPE 0x01 #define IPMI_IPMB_ADDR_TYPE 0x01
/* Used for broadcast get device id as described in section 17.9 of the /* Used for broadcast get device id as described in section 17.9 of the
IPMI 1.5 manual. */ IPMI 1.5 manual. */
#define IPMI_IPMB_BROADCAST_ADDR_TYPE 0x41 #define IPMI_IPMB_BROADCAST_ADDR_TYPE 0x41
struct ipmi_ipmb_addr struct ipmi_ipmb_addr {
{
int addr_type; int addr_type;
short channel; short channel;
unsigned char slave_addr; unsigned char slave_addr;
...@@ -128,8 +125,7 @@ struct ipmi_ipmb_addr ...@@ -128,8 +125,7 @@ struct ipmi_ipmb_addr
* message is a little weird, but this is required. * message is a little weird, but this is required.
*/ */
#define IPMI_LAN_ADDR_TYPE 0x04 #define IPMI_LAN_ADDR_TYPE 0x04
struct ipmi_lan_addr struct ipmi_lan_addr {
{
int addr_type; int addr_type;
short channel; short channel;
unsigned char privilege; unsigned char privilege;
...@@ -162,16 +158,14 @@ struct ipmi_lan_addr ...@@ -162,16 +158,14 @@ struct ipmi_lan_addr
* byte of data in the response (as the spec shows the messages laid * byte of data in the response (as the spec shows the messages laid
* out). * out).
*/ */
struct ipmi_msg struct ipmi_msg {
{
unsigned char netfn; unsigned char netfn;
unsigned char cmd; unsigned char cmd;
unsigned short data_len; unsigned short data_len;
unsigned char __user *data; unsigned char __user *data;
}; };
struct kernel_ipmi_msg struct kernel_ipmi_msg {
{
unsigned char netfn; unsigned char netfn;
unsigned char cmd; unsigned char cmd;
unsigned short data_len; unsigned short data_len;
...@@ -239,12 +233,11 @@ typedef struct ipmi_user *ipmi_user_t; ...@@ -239,12 +233,11 @@ typedef struct ipmi_user *ipmi_user_t;
* used after the message is delivered, so the upper layer may use the * used after the message is delivered, so the upper layer may use the
* link to build a linked list, if it likes. * link to build a linked list, if it likes.
*/ */
struct ipmi_recv_msg struct ipmi_recv_msg {
{
struct list_head link; struct list_head link;
/* The type of message as defined in the "Receive Types" /* The type of message as defined in the "Receive Types"
defines above. */ defines above. */
int recv_type; int recv_type;
ipmi_user_t user; ipmi_user_t user;
...@@ -271,9 +264,8 @@ struct ipmi_recv_msg ...@@ -271,9 +264,8 @@ struct ipmi_recv_msg
/* Allocate and free the receive message. */ /* Allocate and free the receive message. */
void ipmi_free_recv_msg(struct ipmi_recv_msg *msg); void ipmi_free_recv_msg(struct ipmi_recv_msg *msg);
struct ipmi_user_hndl struct ipmi_user_hndl {
{ /* Routine type to call when a message needs to be routed to
/* Routine type to call when a message needs to be routed to
the upper layer. This will be called with some locks held, the upper layer. This will be called with some locks held,
the only IPMI routines that can be called are ipmi_request the only IPMI routines that can be called are ipmi_request
and the alloc/free operations. The handler_data is the and the alloc/free operations. The handler_data is the
...@@ -433,8 +425,7 @@ int ipmi_set_gets_events(ipmi_user_t user, int val); ...@@ -433,8 +425,7 @@ int ipmi_set_gets_events(ipmi_user_t user, int val);
* every existing interface when a new watcher is registered with * every existing interface when a new watcher is registered with
* ipmi_smi_watcher_register(). * ipmi_smi_watcher_register().
*/ */
struct ipmi_smi_watcher struct ipmi_smi_watcher {
{
struct list_head link; struct list_head link;
/* You must set the owner to the current module, if you are in /* You must set the owner to the current module, if you are in
...@@ -505,8 +496,7 @@ int ipmi_validate_addr(struct ipmi_addr *addr, int len); ...@@ -505,8 +496,7 @@ int ipmi_validate_addr(struct ipmi_addr *addr, int len);
/* Messages sent to the interface are this format. */ /* Messages sent to the interface are this format. */
struct ipmi_req struct ipmi_req {
{
unsigned char __user *addr; /* Address to send the message to. */ unsigned char __user *addr; /* Address to send the message to. */
unsigned int addr_len; unsigned int addr_len;
...@@ -531,12 +521,11 @@ struct ipmi_req ...@@ -531,12 +521,11 @@ struct ipmi_req
/* Messages sent to the interface with timing parameters are this /* Messages sent to the interface with timing parameters are this
format. */ format. */
struct ipmi_req_settime struct ipmi_req_settime {
{
struct ipmi_req req; struct ipmi_req req;
/* See ipmi_request_settime() above for details on these /* See ipmi_request_settime() above for details on these
values. */ values. */
int retries; int retries;
unsigned int retry_time_ms; unsigned int retry_time_ms;
}; };
...@@ -553,8 +542,7 @@ struct ipmi_req_settime ...@@ -553,8 +542,7 @@ struct ipmi_req_settime
struct ipmi_req_settime) struct ipmi_req_settime)
/* Messages received from the interface are this format. */ /* Messages received from the interface are this format. */
struct ipmi_recv struct ipmi_recv {
{
int recv_type; /* Is this a command, response or an int recv_type; /* Is this a command, response or an
asyncronous event. */ asyncronous event. */
...@@ -600,13 +588,12 @@ struct ipmi_recv ...@@ -600,13 +588,12 @@ struct ipmi_recv
struct ipmi_recv) struct ipmi_recv)
/* Register to get commands from other entities on this interface. */ /* Register to get commands from other entities on this interface. */
struct ipmi_cmdspec struct ipmi_cmdspec {
{
unsigned char netfn; unsigned char netfn;
unsigned char cmd; unsigned char cmd;
}; };
/* /*
* Register to receive a specific command. error values: * Register to receive a specific command. error values:
* - EFAULT - an address supplied was invalid. * - EFAULT - an address supplied was invalid.
* - EBUSY - The netfn/cmd supplied was already in use. * - EBUSY - The netfn/cmd supplied was already in use.
...@@ -629,8 +616,7 @@ struct ipmi_cmdspec ...@@ -629,8 +616,7 @@ struct ipmi_cmdspec
* else. The chans field is a bitmask, (1 << channel) for each channel. * else. The chans field is a bitmask, (1 << channel) for each channel.
* It may be IPMI_CHAN_ALL for all channels. * It may be IPMI_CHAN_ALL for all channels.
*/ */
struct ipmi_cmdspec_chans struct ipmi_cmdspec_chans {
{
unsigned int netfn; unsigned int netfn;
unsigned int cmd; unsigned int cmd;
unsigned int chans; unsigned int chans;
...@@ -652,7 +638,7 @@ struct ipmi_cmdspec_chans ...@@ -652,7 +638,7 @@ struct ipmi_cmdspec_chans
#define IPMICTL_UNREGISTER_FOR_CMD_CHANS _IOR(IPMI_IOC_MAGIC, 29, \ #define IPMICTL_UNREGISTER_FOR_CMD_CHANS _IOR(IPMI_IOC_MAGIC, 29, \
struct ipmi_cmdspec_chans) struct ipmi_cmdspec_chans)
/* /*
* Set whether this interface receives events. Note that the first * Set whether this interface receives events. Note that the first
* user registered for events will get all pending events for the * user registered for events will get all pending events for the
* interface. error values: * interface. error values:
...@@ -668,15 +654,18 @@ struct ipmi_cmdspec_chans ...@@ -668,15 +654,18 @@ struct ipmi_cmdspec_chans
* things it takes to determine your address (if not the BMC) and set * things it takes to determine your address (if not the BMC) and set
* it for everyone else. You should probably leave the LUN alone. * it for everyone else. You should probably leave the LUN alone.
*/ */
struct ipmi_channel_lun_address_set struct ipmi_channel_lun_address_set {
{
unsigned short channel; unsigned short channel;
unsigned char value; unsigned char value;
}; };
#define IPMICTL_SET_MY_CHANNEL_ADDRESS_CMD _IOR(IPMI_IOC_MAGIC, 24, struct ipmi_channel_lun_address_set) #define IPMICTL_SET_MY_CHANNEL_ADDRESS_CMD \
#define IPMICTL_GET_MY_CHANNEL_ADDRESS_CMD _IOR(IPMI_IOC_MAGIC, 25, struct ipmi_channel_lun_address_set) _IOR(IPMI_IOC_MAGIC, 24, struct ipmi_channel_lun_address_set)
#define IPMICTL_SET_MY_CHANNEL_LUN_CMD _IOR(IPMI_IOC_MAGIC, 26, struct ipmi_channel_lun_address_set) #define IPMICTL_GET_MY_CHANNEL_ADDRESS_CMD \
#define IPMICTL_GET_MY_CHANNEL_LUN_CMD _IOR(IPMI_IOC_MAGIC, 27, struct ipmi_channel_lun_address_set) _IOR(IPMI_IOC_MAGIC, 25, struct ipmi_channel_lun_address_set)
#define IPMICTL_SET_MY_CHANNEL_LUN_CMD \
_IOR(IPMI_IOC_MAGIC, 26, struct ipmi_channel_lun_address_set)
#define IPMICTL_GET_MY_CHANNEL_LUN_CMD \
_IOR(IPMI_IOC_MAGIC, 27, struct ipmi_channel_lun_address_set)
/* Legacy interfaces, these only set IPMB 0. */ /* Legacy interfaces, these only set IPMB 0. */
#define IPMICTL_SET_MY_ADDRESS_CMD _IOR(IPMI_IOC_MAGIC, 17, unsigned int) #define IPMICTL_SET_MY_ADDRESS_CMD _IOR(IPMI_IOC_MAGIC, 17, unsigned int)
#define IPMICTL_GET_MY_ADDRESS_CMD _IOR(IPMI_IOC_MAGIC, 18, unsigned int) #define IPMICTL_GET_MY_ADDRESS_CMD _IOR(IPMI_IOC_MAGIC, 18, unsigned int)
...@@ -687,8 +676,7 @@ struct ipmi_channel_lun_address_set ...@@ -687,8 +676,7 @@ struct ipmi_channel_lun_address_set
* Get/set the default timing values for an interface. You shouldn't * Get/set the default timing values for an interface. You shouldn't
* generally mess with these. * generally mess with these.
*/ */
struct ipmi_timing_parms struct ipmi_timing_parms {
{
int retries; int retries;
unsigned int retry_time_ms; unsigned int retry_time_ms;
}; };
......
...@@ -60,8 +60,7 @@ typedef struct ipmi_smi *ipmi_smi_t; ...@@ -60,8 +60,7 @@ typedef struct ipmi_smi *ipmi_smi_t;
* asynchronous data and messages and request them from the * asynchronous data and messages and request them from the
* interface. * interface.
*/ */
struct ipmi_smi_msg struct ipmi_smi_msg {
{
struct list_head link; struct list_head link;
long msgid; long msgid;
...@@ -74,12 +73,11 @@ struct ipmi_smi_msg ...@@ -74,12 +73,11 @@ struct ipmi_smi_msg
unsigned char rsp[IPMI_MAX_MSG_LENGTH]; unsigned char rsp[IPMI_MAX_MSG_LENGTH];
/* Will be called when the system is done with the message /* Will be called when the system is done with the message
(presumably to free it). */ (presumably to free it). */
void (*done)(struct ipmi_smi_msg *msg); void (*done)(struct ipmi_smi_msg *msg);
}; };
struct ipmi_smi_handlers struct ipmi_smi_handlers {
{
struct module *owner; struct module *owner;
/* The low-level interface cannot start sending messages to /* The low-level interface cannot start sending messages to
......
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