Commit 2fcc3db0 authored by Jes Sorensen's avatar Jes Sorensen Committed by Tony Luck

[IA64-SGI] sn2 housekeeping

Maintenance patch:
 - Add missing __init calls
 - Do not zero initialize global variables
 - No need to typecast function call returns to void
 - Some formatting
Signed-off-by: default avatarJes Sorensen <jes@sgi.com>
Signed-off-by: default avatarTony Luck <tony.luck@intel.com>
parent 41db6112
...@@ -208,7 +208,7 @@ static s64 sn_device_fixup_war(u64 nasid, u64 widget, int device, ...@@ -208,7 +208,7 @@ static s64 sn_device_fixup_war(u64 nasid, u64 widget, int device,
* sn_fixup_ionodes() - This routine initializes the HUB data strcuture for * sn_fixup_ionodes() - This routine initializes the HUB data strcuture for
* each node in the system. * each node in the system.
*/ */
static void sn_fixup_ionodes(void) static void __init sn_fixup_ionodes(void)
{ {
struct sn_flush_device_kernel *sn_flush_device_kernel; struct sn_flush_device_kernel *sn_flush_device_kernel;
struct sn_flush_device_kernel *dev_entry; struct sn_flush_device_kernel *dev_entry;
......
...@@ -5,11 +5,12 @@ ...@@ -5,11 +5,12 @@
* License. See the file "COPYING" in the main directory of this archive * License. See the file "COPYING" in the main directory of this archive
* for more details. * for more details.
* *
* Copyright (c) 2000-2005 Silicon Graphics, Inc. All Rights Reserved. * Copyright (c) 2000-2006 Silicon Graphics, Inc. All Rights Reserved.
*/ */
#include <linux/irq.h> #include <linux/irq.h>
#include <linux/spinlock.h> #include <linux/spinlock.h>
#include <linux/init.h>
#include <asm/sn/addrs.h> #include <asm/sn/addrs.h>
#include <asm/sn/arch.h> #include <asm/sn/arch.h>
#include <asm/sn/intr.h> #include <asm/sn/intr.h>
...@@ -76,14 +77,12 @@ static void sn_enable_irq(unsigned int irq) ...@@ -76,14 +77,12 @@ static void sn_enable_irq(unsigned int irq)
static void sn_ack_irq(unsigned int irq) static void sn_ack_irq(unsigned int irq)
{ {
u64 event_occurred, mask = 0; u64 event_occurred, mask;
irq = irq & 0xff; irq = irq & 0xff;
event_occurred = event_occurred = HUB_L((u64*)LOCAL_MMR_ADDR(SH_EVENT_OCCURRED));
HUB_L((u64*)LOCAL_MMR_ADDR(SH_EVENT_OCCURRED));
mask = event_occurred & SH_ALL_INT_MASK; mask = event_occurred & SH_ALL_INT_MASK;
HUB_S((u64*)LOCAL_MMR_ADDR(SH_EVENT_OCCURRED_ALIAS), HUB_S((u64*)LOCAL_MMR_ADDR(SH_EVENT_OCCURRED_ALIAS), mask);
mask);
__set_bit(irq, (volatile void *)pda->sn_in_service_ivecs); __set_bit(irq, (volatile void *)pda->sn_in_service_ivecs);
move_native_irq(irq); move_native_irq(irq);
...@@ -219,9 +218,8 @@ static void register_intr_pda(struct sn_irq_info *sn_irq_info) ...@@ -219,9 +218,8 @@ static void register_intr_pda(struct sn_irq_info *sn_irq_info)
pdacpu(cpu)->sn_last_irq = irq; pdacpu(cpu)->sn_last_irq = irq;
} }
if (pdacpu(cpu)->sn_first_irq == 0 || pdacpu(cpu)->sn_first_irq > irq) { if (pdacpu(cpu)->sn_first_irq == 0 || pdacpu(cpu)->sn_first_irq > irq)
pdacpu(cpu)->sn_first_irq = irq; pdacpu(cpu)->sn_first_irq = irq;
}
} }
static void unregister_intr_pda(struct sn_irq_info *sn_irq_info) static void unregister_intr_pda(struct sn_irq_info *sn_irq_info)
...@@ -289,7 +287,7 @@ void sn_irq_fixup(struct pci_dev *pci_dev, struct sn_irq_info *sn_irq_info) ...@@ -289,7 +287,7 @@ void sn_irq_fixup(struct pci_dev *pci_dev, struct sn_irq_info *sn_irq_info)
list_add_rcu(&sn_irq_info->list, sn_irq_lh[sn_irq_info->irq_irq]); list_add_rcu(&sn_irq_info->list, sn_irq_lh[sn_irq_info->irq_irq]);
spin_unlock(&sn_irq_info_lock); spin_unlock(&sn_irq_info_lock);
(void)register_intr_pda(sn_irq_info); register_intr_pda(sn_irq_info);
} }
void sn_irq_unfixup(struct pci_dev *pci_dev) void sn_irq_unfixup(struct pci_dev *pci_dev)
...@@ -419,7 +417,7 @@ void sn_lb_int_war_check(void) ...@@ -419,7 +417,7 @@ void sn_lb_int_war_check(void)
rcu_read_unlock(); rcu_read_unlock();
} }
void sn_irq_lh_init(void) void __init sn_irq_lh_init(void)
{ {
int i; int i;
...@@ -434,5 +432,4 @@ void sn_irq_lh_init(void) ...@@ -434,5 +432,4 @@ void sn_irq_lh_init(void)
INIT_LIST_HEAD(sn_irq_lh[i]); INIT_LIST_HEAD(sn_irq_lh[i]);
} }
} }
...@@ -78,31 +78,30 @@ format_module_id(char *buffer, moduleid_t m, int fmt) ...@@ -78,31 +78,30 @@ format_module_id(char *buffer, moduleid_t m, int fmt)
position = MODULE_GET_BPOS(m); position = MODULE_GET_BPOS(m);
if ((fmt == MODULE_FORMAT_BRIEF) || (fmt == MODULE_FORMAT_LCD)) { if ((fmt == MODULE_FORMAT_BRIEF) || (fmt == MODULE_FORMAT_LCD)) {
/* Brief module number format, eg. 002c15 */ /* Brief module number format, eg. 002c15 */
/* Decompress the rack number */ /* Decompress the rack number */
*buffer++ = '0' + RACK_GET_CLASS(rack); *buffer++ = '0' + RACK_GET_CLASS(rack);
*buffer++ = '0' + RACK_GET_GROUP(rack); *buffer++ = '0' + RACK_GET_GROUP(rack);
*buffer++ = '0' + RACK_GET_NUM(rack); *buffer++ = '0' + RACK_GET_NUM(rack);
/* Add the brick type */ /* Add the brick type */
*buffer++ = brickchar; *buffer++ = brickchar;
} }
else if (fmt == MODULE_FORMAT_LONG) { else if (fmt == MODULE_FORMAT_LONG) {
/* Fuller hwgraph format, eg. rack/002/bay/15 */ /* Fuller hwgraph format, eg. rack/002/bay/15 */
strcpy(buffer, "rack" "/"); buffer += strlen(buffer); strcpy(buffer, "rack" "/"); buffer += strlen(buffer);
*buffer++ = '0' + RACK_GET_CLASS(rack); *buffer++ = '0' + RACK_GET_CLASS(rack);
*buffer++ = '0' + RACK_GET_GROUP(rack); *buffer++ = '0' + RACK_GET_GROUP(rack);
*buffer++ = '0' + RACK_GET_NUM(rack); *buffer++ = '0' + RACK_GET_NUM(rack);
strcpy(buffer, "/" "bay" "/"); buffer += strlen(buffer); strcpy(buffer, "/" "bay" "/"); buffer += strlen(buffer);
} }
/* Add the bay position, using at least two digits */ /* Add the bay position, using at least two digits */
if (position < 10) if (position < 10)
*buffer++ = '0'; *buffer++ = '0';
sprintf(buffer, "%d", position); sprintf(buffer, "%d", position);
} }
...@@ -209,7 +209,7 @@ void __init early_sn_setup(void) ...@@ -209,7 +209,7 @@ void __init early_sn_setup(void)
} }
extern int platform_intr_list[]; extern int platform_intr_list[];
static int __initdata shub_1_1_found = 0; static int __initdata shub_1_1_found;
/* /*
* sn_check_for_wars * sn_check_for_wars
...@@ -578,13 +578,17 @@ void __init sn_cpu_init(void) ...@@ -578,13 +578,17 @@ void __init sn_cpu_init(void)
sn_prom_type = 2; sn_prom_type = 2;
else else
sn_prom_type = 1; sn_prom_type = 1;
printk("Running on medusa with %s PROM\n", (sn_prom_type == 1) ? "real" : "fake"); printk(KERN_INFO "Running on medusa with %s PROM\n",
(sn_prom_type == 1) ? "real" : "fake");
} }
memset(pda, 0, sizeof(pda)); memset(pda, 0, sizeof(pda));
if (ia64_sn_get_sn_info(0, &sn_hub_info->shub2, &sn_hub_info->nasid_bitmask, &sn_hub_info->nasid_shift, if (ia64_sn_get_sn_info(0, &sn_hub_info->shub2,
&sn_system_size, &sn_sharing_domain_size, &sn_partition_id, &sn_hub_info->nasid_bitmask,
&sn_coherency_id, &sn_region_size)) &sn_hub_info->nasid_shift,
&sn_system_size, &sn_sharing_domain_size,
&sn_partition_id, &sn_coherency_id,
&sn_region_size))
BUG(); BUG();
sn_hub_info->as_shift = sn_hub_info->nasid_shift - 2; sn_hub_info->as_shift = sn_hub_info->nasid_shift - 2;
...@@ -716,7 +720,8 @@ void __init build_cnode_tables(void) ...@@ -716,7 +720,8 @@ void __init build_cnode_tables(void)
for_each_online_node(node) { for_each_online_node(node) {
kl_config_hdr_t *klgraph_header; kl_config_hdr_t *klgraph_header;
nasid = cnodeid_to_nasid(node); nasid = cnodeid_to_nasid(node);
if ((klgraph_header = ia64_sn_get_klconfig_addr(nasid)) == NULL) klgraph_header = ia64_sn_get_klconfig_addr(nasid);
if (klgraph_header == NULL)
BUG(); BUG();
brd = NODE_OFFSET_TO_LBOARD(nasid, klgraph_header->ch_board_info); brd = NODE_OFFSET_TO_LBOARD(nasid, klgraph_header->ch_board_info);
while (brd) { while (brd) {
...@@ -734,7 +739,7 @@ nasid_slice_to_cpuid(int nasid, int slice) ...@@ -734,7 +739,7 @@ nasid_slice_to_cpuid(int nasid, int slice)
{ {
long cpu; long cpu;
for (cpu=0; cpu < NR_CPUS; cpu++) for (cpu = 0; cpu < NR_CPUS; cpu++)
if (cpuid_to_nasid(cpu) == nasid && if (cpuid_to_nasid(cpu) == nasid &&
cpuid_to_slice(cpu) == slice) cpuid_to_slice(cpu) == slice)
return cpu; return cpu;
......
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