[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: Jes Sorensen <jes@sgi.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>
This commit is contained in:
Jes Sorensen 2006-02-02 05:15:51 -05:00 committed by Tony Luck
parent 41db6112a5
commit 2fcc3db0cc
4 changed files with 35 additions and 34 deletions

View File

@ -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;

View File

@ -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)
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,10 +218,9 @@ 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)
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)
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)
INIT_LIST_HEAD(sn_irq_lh[i]); INIT_LIST_HEAD(sn_irq_lh[i]);
} }
} }

View File

@ -104,5 +104,4 @@ format_module_id(char *buffer, moduleid_t m, int fmt)
if (position < 10) if (position < 10)
*buffer++ = '0'; *buffer++ = '0';
sprintf(buffer, "%d", position); sprintf(buffer, "%d", position);
} }

View File

@ -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)
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)
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) {