Commit d8758fa7 authored by Rolf Eike Beer's avatar Rolf Eike Beer Committed by Deepak Saxena

[PATCH] Compaq PCI Hotplug: coding style fixes

The usual coding style fixes, this time for cpqphp_ctrl.c and cpqphp.c.
parent c61b1d93
...@@ -377,11 +377,8 @@ struct resource_lists { ...@@ -377,11 +377,8 @@ struct resource_lists {
#define PCISLOT_66_MHZ_SUPPORTED 0x00000100 #define PCISLOT_66_MHZ_SUPPORTED 0x00000100
#define PCISLOT_64_BIT_SUPPORTED 0x00000200 #define PCISLOT_64_BIT_SUPPORTED 0x00000200
#define PCI_TO_PCI_BRIDGE_CLASS 0x00060400 #define PCI_TO_PCI_BRIDGE_CLASS 0x00060400
#define INTERLOCK_OPEN 0x00000002 #define INTERLOCK_OPEN 0x00000002
#define ADD_NOT_SUPPORTED 0x00000003 #define ADD_NOT_SUPPORTED 0x00000003
#define CARD_FUNCTIONING 0x00000005 #define CARD_FUNCTIONING 0x00000005
...@@ -453,7 +450,6 @@ extern u8 cpqhp_nic_irq; ...@@ -453,7 +450,6 @@ extern u8 cpqhp_nic_irq;
extern u8 cpqhp_disk_irq; extern u8 cpqhp_disk_irq;
/* inline functions */ /* inline functions */
...@@ -496,7 +492,7 @@ static inline struct slot *get_slot (struct hotplug_slot *hotplug_slot, const ch ...@@ -496,7 +492,7 @@ static inline struct slot *get_slot (struct hotplug_slot *hotplug_slot, const ch
* Puts node back in the resource list pointed to by head * Puts node back in the resource list pointed to by head
* *
*/ */
static inline void return_resource (struct pci_resource **head, struct pci_resource *node) static inline void return_resource(struct pci_resource **head, struct pci_resource *node)
{ {
if (!node || !head) if (!node || !head)
return; return;
...@@ -504,7 +500,7 @@ static inline void return_resource (struct pci_resource **head, struct pci_resou ...@@ -504,7 +500,7 @@ static inline void return_resource (struct pci_resource **head, struct pci_resou
*head = node; *head = node;
} }
static inline void set_SOGO (struct controller *ctrl) static inline void set_SOGO(struct controller *ctrl)
{ {
u16 misc; u16 misc;
...@@ -514,7 +510,7 @@ static inline void set_SOGO (struct controller *ctrl) ...@@ -514,7 +510,7 @@ static inline void set_SOGO (struct controller *ctrl)
} }
static inline void amber_LED_on (struct controller *ctrl, u8 slot) static inline void amber_LED_on(struct controller *ctrl, u8 slot)
{ {
u32 led_control; u32 led_control;
...@@ -524,7 +520,7 @@ static inline void amber_LED_on (struct controller *ctrl, u8 slot) ...@@ -524,7 +520,7 @@ static inline void amber_LED_on (struct controller *ctrl, u8 slot)
} }
static inline void amber_LED_off (struct controller *ctrl, u8 slot) static inline void amber_LED_off(struct controller *ctrl, u8 slot)
{ {
u32 led_control; u32 led_control;
...@@ -534,7 +530,7 @@ static inline void amber_LED_off (struct controller *ctrl, u8 slot) ...@@ -534,7 +530,7 @@ static inline void amber_LED_off (struct controller *ctrl, u8 slot)
} }
static inline int read_amber_LED (struct controller *ctrl, u8 slot) static inline int read_amber_LED(struct controller *ctrl, u8 slot)
{ {
u32 led_control; u32 led_control;
...@@ -545,7 +541,7 @@ static inline int read_amber_LED (struct controller *ctrl, u8 slot) ...@@ -545,7 +541,7 @@ static inline int read_amber_LED (struct controller *ctrl, u8 slot)
} }
static inline void green_LED_on (struct controller *ctrl, u8 slot) static inline void green_LED_on(struct controller *ctrl, u8 slot)
{ {
u32 led_control; u32 led_control;
...@@ -554,7 +550,7 @@ static inline void green_LED_on (struct controller *ctrl, u8 slot) ...@@ -554,7 +550,7 @@ static inline void green_LED_on (struct controller *ctrl, u8 slot)
writel(led_control, ctrl->hpc_reg + LED_CONTROL); writel(led_control, ctrl->hpc_reg + LED_CONTROL);
} }
static inline void green_LED_off (struct controller *ctrl, u8 slot) static inline void green_LED_off(struct controller *ctrl, u8 slot)
{ {
u32 led_control; u32 led_control;
...@@ -564,7 +560,7 @@ static inline void green_LED_off (struct controller *ctrl, u8 slot) ...@@ -564,7 +560,7 @@ static inline void green_LED_off (struct controller *ctrl, u8 slot)
} }
static inline void green_LED_blink (struct controller *ctrl, u8 slot) static inline void green_LED_blink(struct controller *ctrl, u8 slot)
{ {
u32 led_control; u32 led_control;
...@@ -575,7 +571,7 @@ static inline void green_LED_blink (struct controller *ctrl, u8 slot) ...@@ -575,7 +571,7 @@ static inline void green_LED_blink (struct controller *ctrl, u8 slot)
} }
static inline void slot_disable (struct controller *ctrl, u8 slot) static inline void slot_disable(struct controller *ctrl, u8 slot)
{ {
u8 slot_enable; u8 slot_enable;
...@@ -585,7 +581,7 @@ static inline void slot_disable (struct controller *ctrl, u8 slot) ...@@ -585,7 +581,7 @@ static inline void slot_disable (struct controller *ctrl, u8 slot)
} }
static inline void slot_enable (struct controller *ctrl, u8 slot) static inline void slot_enable(struct controller *ctrl, u8 slot)
{ {
u8 slot_enable; u8 slot_enable;
...@@ -595,7 +591,7 @@ static inline void slot_enable (struct controller *ctrl, u8 slot) ...@@ -595,7 +591,7 @@ static inline void slot_enable (struct controller *ctrl, u8 slot)
} }
static inline u8 is_slot_enabled (struct controller *ctrl, u8 slot) static inline u8 is_slot_enabled(struct controller *ctrl, u8 slot)
{ {
u8 slot_enable; u8 slot_enable;
...@@ -605,7 +601,7 @@ static inline u8 is_slot_enabled (struct controller *ctrl, u8 slot) ...@@ -605,7 +601,7 @@ static inline u8 is_slot_enabled (struct controller *ctrl, u8 slot)
} }
static inline u8 read_slot_enable (struct controller *ctrl) static inline u8 read_slot_enable(struct controller *ctrl)
{ {
return readb(ctrl->hpc_reg + SLOT_ENABLE); return readb(ctrl->hpc_reg + SLOT_ENABLE);
} }
...@@ -619,7 +615,7 @@ static inline u8 read_slot_enable (struct controller *ctrl) ...@@ -619,7 +615,7 @@ static inline u8 read_slot_enable (struct controller *ctrl)
* Returns controller speed. * Returns controller speed.
* *
*/ */
static inline u8 get_controller_speed (struct controller *ctrl) static inline u8 get_controller_speed(struct controller *ctrl)
{ {
u8 curr_freq; u8 curr_freq;
u16 misc; u16 misc;
...@@ -652,7 +648,7 @@ static inline u8 get_controller_speed (struct controller *ctrl) ...@@ -652,7 +648,7 @@ static inline u8 get_controller_speed (struct controller *ctrl)
* Returns adapter speed. * Returns adapter speed.
* *
*/ */
static inline u8 get_adapter_speed (struct controller *ctrl, u8 hp_slot) static inline u8 get_adapter_speed(struct controller *ctrl, u8 hp_slot)
{ {
u32 temp_dword = readl(ctrl->hpc_reg + NON_INT_INPUT); u32 temp_dword = readl(ctrl->hpc_reg + NON_INT_INPUT);
dbg("slot: %d, PCIXCAP: %8x\n", hp_slot, temp_dword); dbg("slot: %d, PCIXCAP: %8x\n", hp_slot, temp_dword);
...@@ -669,7 +665,7 @@ static inline u8 get_adapter_speed (struct controller *ctrl, u8 hp_slot) ...@@ -669,7 +665,7 @@ static inline u8 get_adapter_speed (struct controller *ctrl, u8 hp_slot)
return PCI_SPEED_33MHz; return PCI_SPEED_33MHz;
} }
static inline void enable_slot_power (struct controller *ctrl, u8 slot) static inline void enable_slot_power(struct controller *ctrl, u8 slot)
{ {
u8 slot_power; u8 slot_power;
...@@ -678,7 +674,7 @@ static inline void enable_slot_power (struct controller *ctrl, u8 slot) ...@@ -678,7 +674,7 @@ static inline void enable_slot_power (struct controller *ctrl, u8 slot)
writeb(slot_power, ctrl->hpc_reg + SLOT_POWER); writeb(slot_power, ctrl->hpc_reg + SLOT_POWER);
} }
static inline void disable_slot_power (struct controller *ctrl, u8 slot) static inline void disable_slot_power(struct controller *ctrl, u8 slot)
{ {
u8 slot_power; u8 slot_power;
...@@ -688,7 +684,7 @@ static inline void disable_slot_power (struct controller *ctrl, u8 slot) ...@@ -688,7 +684,7 @@ static inline void disable_slot_power (struct controller *ctrl, u8 slot)
} }
static inline int cpq_get_attention_status (struct controller *ctrl, struct slot *slot) static inline int cpq_get_attention_status(struct controller *ctrl, struct slot *slot)
{ {
u8 hp_slot; u8 hp_slot;
...@@ -697,11 +693,11 @@ static inline int cpq_get_attention_status (struct controller *ctrl, struct slot ...@@ -697,11 +693,11 @@ static inline int cpq_get_attention_status (struct controller *ctrl, struct slot
hp_slot = slot->device - ctrl->slot_device_offset; hp_slot = slot->device - ctrl->slot_device_offset;
return read_amber_LED (ctrl, hp_slot); return read_amber_LED(ctrl, hp_slot);
} }
static inline int get_slot_enabled (struct controller *ctrl, struct slot *slot) static inline int get_slot_enabled(struct controller *ctrl, struct slot *slot)
{ {
u8 hp_slot; u8 hp_slot;
...@@ -710,11 +706,11 @@ static inline int get_slot_enabled (struct controller *ctrl, struct slot *slot) ...@@ -710,11 +706,11 @@ static inline int get_slot_enabled (struct controller *ctrl, struct slot *slot)
hp_slot = slot->device - ctrl->slot_device_offset; hp_slot = slot->device - ctrl->slot_device_offset;
return is_slot_enabled (ctrl, hp_slot); return is_slot_enabled(ctrl, hp_slot);
} }
static inline int cpq_get_latch_status (struct controller *ctrl, struct slot *slot) static inline int cpq_get_latch_status(struct controller *ctrl, struct slot *slot)
{ {
u32 status; u32 status;
u8 hp_slot; u8 hp_slot;
...@@ -732,7 +728,7 @@ static inline int cpq_get_latch_status (struct controller *ctrl, struct slot *sl ...@@ -732,7 +728,7 @@ static inline int cpq_get_latch_status (struct controller *ctrl, struct slot *sl
} }
static inline int get_presence_status (struct controller *ctrl, struct slot *slot) static inline int get_presence_status(struct controller *ctrl, struct slot *slot)
{ {
int presence_save = 0; int presence_save = 0;
u8 hp_slot; u8 hp_slot;
...@@ -751,13 +747,13 @@ static inline int get_presence_status (struct controller *ctrl, struct slot *slo ...@@ -751,13 +747,13 @@ static inline int get_presence_status (struct controller *ctrl, struct slot *slo
#define SLOT_NAME_SIZE 10 #define SLOT_NAME_SIZE 10
static inline void make_slot_name (char *buffer, int buffer_size, struct slot *slot) static inline void make_slot_name(char *buffer, int buffer_size, struct slot *slot)
{ {
snprintf (buffer, buffer_size, "%d", slot->number); snprintf(buffer, buffer_size, "%d", slot->number);
} }
static inline int wait_for_ctrl_irq (struct controller *ctrl) static inline int wait_for_ctrl_irq(struct controller *ctrl)
{ {
DECLARE_WAITQUEUE(wait, current); DECLARE_WAITQUEUE(wait, current);
int retval = 0; int retval = 0;
......
This diff is collapsed.
...@@ -722,21 +722,21 @@ int cpqhp_save_used_resources (struct controller *ctrl, struct pci_func * func) ...@@ -722,21 +722,21 @@ int cpqhp_save_used_resources (struct controller *ctrl, struct pci_func * func)
devfn = PCI_DEVFN(func->device, func->function); devfn = PCI_DEVFN(func->device, func->function);
// Save the command register // Save the command register
pci_bus_read_config_word (pci_bus, devfn, PCI_COMMAND, &save_command); pci_bus_read_config_word(pci_bus, devfn, PCI_COMMAND, &save_command);
// disable card // disable card
command = 0x00; command = 0x00;
pci_bus_write_config_word (pci_bus, devfn, PCI_COMMAND, command); pci_bus_write_config_word(pci_bus, devfn, PCI_COMMAND, command);
// Check for Bridge // Check for Bridge
pci_bus_read_config_byte (pci_bus, devfn, PCI_HEADER_TYPE, &header_type); pci_bus_read_config_byte(pci_bus, devfn, PCI_HEADER_TYPE, &header_type);
if ((header_type & 0x7F) == PCI_HEADER_TYPE_BRIDGE) { // PCI-PCI Bridge if ((header_type & 0x7F) == PCI_HEADER_TYPE_BRIDGE) { // PCI-PCI Bridge
// Clear Bridge Control Register // Clear Bridge Control Register
command = 0x00; command = 0x00;
pci_bus_write_config_word (pci_bus, devfn, PCI_BRIDGE_CONTROL, command); pci_bus_write_config_word(pci_bus, devfn, PCI_BRIDGE_CONTROL, command);
pci_bus_read_config_byte (pci_bus, devfn, PCI_SECONDARY_BUS, &secondary_bus); pci_bus_read_config_byte(pci_bus, devfn, PCI_SECONDARY_BUS, &secondary_bus);
pci_bus_read_config_byte (pci_bus, devfn, PCI_SUBORDINATE_BUS, &temp_byte); pci_bus_read_config_byte(pci_bus, devfn, PCI_SUBORDINATE_BUS, &temp_byte);
bus_node =(struct pci_resource *) kmalloc(sizeof(struct pci_resource), GFP_KERNEL); bus_node =(struct pci_resource *) kmalloc(sizeof(struct pci_resource), GFP_KERNEL);
if (!bus_node) if (!bus_node)
...@@ -749,8 +749,8 @@ int cpqhp_save_used_resources (struct controller *ctrl, struct pci_func * func) ...@@ -749,8 +749,8 @@ int cpqhp_save_used_resources (struct controller *ctrl, struct pci_func * func)
func->bus_head = bus_node; func->bus_head = bus_node;
// Save IO base and Limit registers // Save IO base and Limit registers
pci_bus_read_config_byte (pci_bus, devfn, PCI_IO_BASE, &b_base); pci_bus_read_config_byte(pci_bus, devfn, PCI_IO_BASE, &b_base);
pci_bus_read_config_byte (pci_bus, devfn, PCI_IO_LIMIT, &b_length); pci_bus_read_config_byte(pci_bus, devfn, PCI_IO_LIMIT, &b_length);
if ((b_base <= b_length) && (save_command & 0x01)) { if ((b_base <= b_length) && (save_command & 0x01)) {
io_node = (struct pci_resource *) kmalloc(sizeof(struct pci_resource), GFP_KERNEL); io_node = (struct pci_resource *) kmalloc(sizeof(struct pci_resource), GFP_KERNEL);
...@@ -765,8 +765,8 @@ int cpqhp_save_used_resources (struct controller *ctrl, struct pci_func * func) ...@@ -765,8 +765,8 @@ int cpqhp_save_used_resources (struct controller *ctrl, struct pci_func * func)
} }
// Save memory base and Limit registers // Save memory base and Limit registers
pci_bus_read_config_word (pci_bus, devfn, PCI_MEMORY_BASE, &w_base); pci_bus_read_config_word(pci_bus, devfn, PCI_MEMORY_BASE, &w_base);
pci_bus_read_config_word (pci_bus, devfn, PCI_MEMORY_LIMIT, &w_length); pci_bus_read_config_word(pci_bus, devfn, PCI_MEMORY_LIMIT, &w_length);
if ((w_base <= w_length) && (save_command & 0x02)) { if ((w_base <= w_length) && (save_command & 0x02)) {
mem_node = (struct pci_resource *) kmalloc(sizeof(struct pci_resource), GFP_KERNEL); mem_node = (struct pci_resource *) kmalloc(sizeof(struct pci_resource), GFP_KERNEL);
...@@ -781,8 +781,8 @@ int cpqhp_save_used_resources (struct controller *ctrl, struct pci_func * func) ...@@ -781,8 +781,8 @@ int cpqhp_save_used_resources (struct controller *ctrl, struct pci_func * func)
} }
// Save prefetchable memory base and Limit registers // Save prefetchable memory base and Limit registers
pci_bus_read_config_word (pci_bus, devfn, PCI_PREF_MEMORY_BASE, &w_base); pci_bus_read_config_word(pci_bus, devfn, PCI_PREF_MEMORY_BASE, &w_base);
pci_bus_read_config_word (pci_bus, devfn, PCI_PREF_MEMORY_LIMIT, &w_length); pci_bus_read_config_word(pci_bus, devfn, PCI_PREF_MEMORY_LIMIT, &w_length);
if ((w_base <= w_length) && (save_command & 0x02)) { if ((w_base <= w_length) && (save_command & 0x02)) {
p_mem_node = (struct pci_resource *) kmalloc(sizeof(struct pci_resource), GFP_KERNEL); p_mem_node = (struct pci_resource *) kmalloc(sizeof(struct pci_resource), GFP_KERNEL);
...@@ -800,8 +800,8 @@ int cpqhp_save_used_resources (struct controller *ctrl, struct pci_func * func) ...@@ -800,8 +800,8 @@ int cpqhp_save_used_resources (struct controller *ctrl, struct pci_func * func)
pci_bus_read_config_dword (pci_bus, devfn, cloop, &save_base); pci_bus_read_config_dword (pci_bus, devfn, cloop, &save_base);
temp_register = 0xFFFFFFFF; temp_register = 0xFFFFFFFF;
pci_bus_write_config_dword (pci_bus, devfn, cloop, temp_register); pci_bus_write_config_dword(pci_bus, devfn, cloop, temp_register);
pci_bus_read_config_dword (pci_bus, devfn, cloop, &base); pci_bus_read_config_dword(pci_bus, devfn, cloop, &base);
temp_register = base; temp_register = base;
...@@ -862,11 +862,11 @@ int cpqhp_save_used_resources (struct controller *ctrl, struct pci_func * func) ...@@ -862,11 +862,11 @@ int cpqhp_save_used_resources (struct controller *ctrl, struct pci_func * func)
} else if ((header_type & 0x7F) == 0x00) { // Standard header } else if ((header_type & 0x7F) == 0x00) { // Standard header
// Figure out IO and memory base lengths // Figure out IO and memory base lengths
for (cloop = 0x10; cloop <= 0x24; cloop += 4) { for (cloop = 0x10; cloop <= 0x24; cloop += 4) {
pci_bus_read_config_dword (pci_bus, devfn, cloop, &save_base); pci_bus_read_config_dword(pci_bus, devfn, cloop, &save_base);
temp_register = 0xFFFFFFFF; temp_register = 0xFFFFFFFF;
pci_bus_write_config_dword (pci_bus, devfn, cloop, temp_register); pci_bus_write_config_dword(pci_bus, devfn, cloop, temp_register);
pci_bus_read_config_dword (pci_bus, devfn, cloop, &base); pci_bus_read_config_dword(pci_bus, devfn, cloop, &base);
temp_register = base; temp_register = base;
...@@ -1300,7 +1300,8 @@ int cpqhp_find_available_resources (struct controller *ctrl, void *rom_start) ...@@ -1300,7 +1300,8 @@ int cpqhp_find_available_resources (struct controller *ctrl, void *rom_start)
io_node->base = io_base; io_node->base = io_base;
io_node->length = io_length; io_node->length = io_length;
dbg("found io_node(base, length) = %x, %x\n", io_node->base, io_node->length); dbg("found io_node(base, length) = %x, %x\n",
io_node->base, io_node->length);
dbg("populated slot =%d \n", populated_slot); dbg("populated slot =%d \n", populated_slot);
if (!populated_slot) { if (!populated_slot) {
io_node->next = ctrl->io_head; io_node->next = ctrl->io_head;
...@@ -1322,7 +1323,8 @@ int cpqhp_find_available_resources (struct controller *ctrl, void *rom_start) ...@@ -1322,7 +1323,8 @@ int cpqhp_find_available_resources (struct controller *ctrl, void *rom_start)
mem_node->length = mem_length << 16; mem_node->length = mem_length << 16;
dbg("found mem_node(base, length) = %x, %x\n", mem_node->base, mem_node->length); dbg("found mem_node(base, length) = %x, %x\n",
mem_node->base, mem_node->length);
dbg("populated slot =%d \n", populated_slot); dbg("populated slot =%d \n", populated_slot);
if (!populated_slot) { if (!populated_slot) {
mem_node->next = ctrl->mem_head; mem_node->next = ctrl->mem_head;
...@@ -1344,7 +1346,8 @@ int cpqhp_find_available_resources (struct controller *ctrl, void *rom_start) ...@@ -1344,7 +1346,8 @@ int cpqhp_find_available_resources (struct controller *ctrl, void *rom_start)
p_mem_node->base = pre_mem_base << 16; p_mem_node->base = pre_mem_base << 16;
p_mem_node->length = pre_mem_length << 16; p_mem_node->length = pre_mem_length << 16;
dbg("found p_mem_node(base, length) = %x, %x\n", p_mem_node->base, p_mem_node->length); dbg("found p_mem_node(base, length) = %x, %x\n",
p_mem_node->base, p_mem_node->length);
dbg("populated slot =%d \n", populated_slot); dbg("populated slot =%d \n", populated_slot);
if (!populated_slot) { if (!populated_slot) {
...@@ -1366,7 +1369,8 @@ int cpqhp_find_available_resources (struct controller *ctrl, void *rom_start) ...@@ -1366,7 +1369,8 @@ int cpqhp_find_available_resources (struct controller *ctrl, void *rom_start)
bus_node->base = secondary_bus; bus_node->base = secondary_bus;
bus_node->length = max_bus - secondary_bus + 1; bus_node->length = max_bus - secondary_bus + 1;
dbg("found bus_node(base, length) = %x, %x\n", bus_node->base, bus_node->length); dbg("found bus_node(base, length) = %x, %x\n",
bus_node->base, bus_node->length);
dbg("populated slot =%d \n", populated_slot); dbg("populated slot =%d \n", populated_slot);
if (!populated_slot) { if (!populated_slot) {
bus_node->next = ctrl->bus_head; bus_node->next = ctrl->bus_head;
......
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