diff options
author | Jes Sorensen <jes@sgi.com> | 2006-02-02 05:15:51 -0500 |
---|---|---|
committer | Tony Luck <tony.luck@intel.com> | 2006-02-02 16:35:59 -0500 |
commit | 2fcc3db0ccee9b47df7a4f732e6624f4f643c035 (patch) | |
tree | ead470915fdf782c1357ddc07baac22ec4136a6e /arch | |
parent | 41db6112a5558bd09c8ec5b0e61566db11f0d86d (diff) |
[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>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/ia64/sn/kernel/io_init.c | 2 | ||||
-rw-r--r-- | arch/ia64/sn/kernel/irq.c | 19 | ||||
-rw-r--r-- | arch/ia64/sn/kernel/klconflib.c | 29 | ||||
-rw-r--r-- | arch/ia64/sn/kernel/setup.c | 19 |
4 files changed, 35 insertions, 34 deletions
diff --git a/arch/ia64/sn/kernel/io_init.c b/arch/ia64/sn/kernel/io_init.c index 6dbb7fca1c57..d7e4d79e16a8 100644 --- a/arch/ia64/sn/kernel/io_init.c +++ b/arch/ia64/sn/kernel/io_init.c | |||
@@ -208,7 +208,7 @@ static s64 sn_device_fixup_war(u64 nasid, u64 widget, int device, | |||
208 | * sn_fixup_ionodes() - This routine initializes the HUB data strcuture for | 208 | * sn_fixup_ionodes() - This routine initializes the HUB data strcuture for |
209 | * each node in the system. | 209 | * each node in the system. |
210 | */ | 210 | */ |
211 | static void sn_fixup_ionodes(void) | 211 | static void __init sn_fixup_ionodes(void) |
212 | { | 212 | { |
213 | struct sn_flush_device_kernel *sn_flush_device_kernel; | 213 | struct sn_flush_device_kernel *sn_flush_device_kernel; |
214 | struct sn_flush_device_kernel *dev_entry; | 214 | struct sn_flush_device_kernel *dev_entry; |
diff --git a/arch/ia64/sn/kernel/irq.c b/arch/ia64/sn/kernel/irq.c index 928b4ac5e7de..74d87d903d5d 100644 --- a/arch/ia64/sn/kernel/irq.c +++ b/arch/ia64/sn/kernel/irq.c | |||
@@ -5,11 +5,12 @@ | |||
5 | * License. See the file "COPYING" in the main directory of this archive | 5 | * License. See the file "COPYING" in the main directory of this archive |
6 | * for more details. | 6 | * for more details. |
7 | * | 7 | * |
8 | * Copyright (c) 2000-2005 Silicon Graphics, Inc. All Rights Reserved. | 8 | * Copyright (c) 2000-2006 Silicon Graphics, Inc. All Rights Reserved. |
9 | */ | 9 | */ |
10 | 10 | ||
11 | #include <linux/irq.h> | 11 | #include <linux/irq.h> |
12 | #include <linux/spinlock.h> | 12 | #include <linux/spinlock.h> |
13 | #include <linux/init.h> | ||
13 | #include <asm/sn/addrs.h> | 14 | #include <asm/sn/addrs.h> |
14 | #include <asm/sn/arch.h> | 15 | #include <asm/sn/arch.h> |
15 | #include <asm/sn/intr.h> | 16 | #include <asm/sn/intr.h> |
@@ -76,14 +77,12 @@ static void sn_enable_irq(unsigned int irq) | |||
76 | 77 | ||
77 | static void sn_ack_irq(unsigned int irq) | 78 | static void sn_ack_irq(unsigned int irq) |
78 | { | 79 | { |
79 | u64 event_occurred, mask = 0; | 80 | u64 event_occurred, mask; |
80 | 81 | ||
81 | irq = irq & 0xff; | 82 | irq = irq & 0xff; |
82 | event_occurred = | 83 | event_occurred = HUB_L((u64*)LOCAL_MMR_ADDR(SH_EVENT_OCCURRED)); |
83 | HUB_L((u64*)LOCAL_MMR_ADDR(SH_EVENT_OCCURRED)); | ||
84 | mask = event_occurred & SH_ALL_INT_MASK; | 84 | mask = event_occurred & SH_ALL_INT_MASK; |
85 | HUB_S((u64*)LOCAL_MMR_ADDR(SH_EVENT_OCCURRED_ALIAS), | 85 | HUB_S((u64*)LOCAL_MMR_ADDR(SH_EVENT_OCCURRED_ALIAS), mask); |
86 | mask); | ||
87 | __set_bit(irq, (volatile void *)pda->sn_in_service_ivecs); | 86 | __set_bit(irq, (volatile void *)pda->sn_in_service_ivecs); |
88 | 87 | ||
89 | move_native_irq(irq); | 88 | move_native_irq(irq); |
@@ -219,9 +218,8 @@ static void register_intr_pda(struct sn_irq_info *sn_irq_info) | |||
219 | pdacpu(cpu)->sn_last_irq = irq; | 218 | pdacpu(cpu)->sn_last_irq = irq; |
220 | } | 219 | } |
221 | 220 | ||
222 | if (pdacpu(cpu)->sn_first_irq == 0 || pdacpu(cpu)->sn_first_irq > irq) { | 221 | if (pdacpu(cpu)->sn_first_irq == 0 || pdacpu(cpu)->sn_first_irq > irq) |
223 | pdacpu(cpu)->sn_first_irq = irq; | 222 | pdacpu(cpu)->sn_first_irq = irq; |
224 | } | ||
225 | } | 223 | } |
226 | 224 | ||
227 | static void unregister_intr_pda(struct sn_irq_info *sn_irq_info) | 225 | 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 | list_add_rcu(&sn_irq_info->list, sn_irq_lh[sn_irq_info->irq_irq]); | 287 | list_add_rcu(&sn_irq_info->list, sn_irq_lh[sn_irq_info->irq_irq]); |
290 | spin_unlock(&sn_irq_info_lock); | 288 | spin_unlock(&sn_irq_info_lock); |
291 | 289 | ||
292 | (void)register_intr_pda(sn_irq_info); | 290 | register_intr_pda(sn_irq_info); |
293 | } | 291 | } |
294 | 292 | ||
295 | void sn_irq_unfixup(struct pci_dev *pci_dev) | 293 | void sn_irq_unfixup(struct pci_dev *pci_dev) |
@@ -419,7 +417,7 @@ void sn_lb_int_war_check(void) | |||
419 | rcu_read_unlock(); | 417 | rcu_read_unlock(); |
420 | } | 418 | } |
421 | 419 | ||
422 | void sn_irq_lh_init(void) | 420 | void __init sn_irq_lh_init(void) |
423 | { | 421 | { |
424 | int i; | 422 | int i; |
425 | 423 | ||
@@ -434,5 +432,4 @@ void sn_irq_lh_init(void) | |||
434 | 432 | ||
435 | INIT_LIST_HEAD(sn_irq_lh[i]); | 433 | INIT_LIST_HEAD(sn_irq_lh[i]); |
436 | } | 434 | } |
437 | |||
438 | } | 435 | } |
diff --git a/arch/ia64/sn/kernel/klconflib.c b/arch/ia64/sn/kernel/klconflib.c index 0f11a3299cd2..87682b48ef83 100644 --- a/arch/ia64/sn/kernel/klconflib.c +++ b/arch/ia64/sn/kernel/klconflib.c | |||
@@ -78,31 +78,30 @@ format_module_id(char *buffer, moduleid_t m, int fmt) | |||
78 | position = MODULE_GET_BPOS(m); | 78 | position = MODULE_GET_BPOS(m); |
79 | 79 | ||
80 | if ((fmt == MODULE_FORMAT_BRIEF) || (fmt == MODULE_FORMAT_LCD)) { | 80 | if ((fmt == MODULE_FORMAT_BRIEF) || (fmt == MODULE_FORMAT_LCD)) { |
81 | /* Brief module number format, eg. 002c15 */ | 81 | /* Brief module number format, eg. 002c15 */ |
82 | 82 | ||
83 | /* Decompress the rack number */ | 83 | /* Decompress the rack number */ |
84 | *buffer++ = '0' + RACK_GET_CLASS(rack); | 84 | *buffer++ = '0' + RACK_GET_CLASS(rack); |
85 | *buffer++ = '0' + RACK_GET_GROUP(rack); | 85 | *buffer++ = '0' + RACK_GET_GROUP(rack); |
86 | *buffer++ = '0' + RACK_GET_NUM(rack); | 86 | *buffer++ = '0' + RACK_GET_NUM(rack); |
87 | 87 | ||
88 | /* Add the brick type */ | 88 | /* Add the brick type */ |
89 | *buffer++ = brickchar; | 89 | *buffer++ = brickchar; |
90 | } | 90 | } |
91 | else if (fmt == MODULE_FORMAT_LONG) { | 91 | else if (fmt == MODULE_FORMAT_LONG) { |
92 | /* Fuller hwgraph format, eg. rack/002/bay/15 */ | 92 | /* Fuller hwgraph format, eg. rack/002/bay/15 */ |
93 | 93 | ||
94 | strcpy(buffer, "rack" "/"); buffer += strlen(buffer); | 94 | strcpy(buffer, "rack" "/"); buffer += strlen(buffer); |
95 | 95 | ||
96 | *buffer++ = '0' + RACK_GET_CLASS(rack); | 96 | *buffer++ = '0' + RACK_GET_CLASS(rack); |
97 | *buffer++ = '0' + RACK_GET_GROUP(rack); | 97 | *buffer++ = '0' + RACK_GET_GROUP(rack); |
98 | *buffer++ = '0' + RACK_GET_NUM(rack); | 98 | *buffer++ = '0' + RACK_GET_NUM(rack); |
99 | 99 | ||
100 | strcpy(buffer, "/" "bay" "/"); buffer += strlen(buffer); | 100 | strcpy(buffer, "/" "bay" "/"); buffer += strlen(buffer); |
101 | } | 101 | } |
102 | 102 | ||
103 | /* Add the bay position, using at least two digits */ | 103 | /* Add the bay position, using at least two digits */ |
104 | if (position < 10) | 104 | if (position < 10) |
105 | *buffer++ = '0'; | 105 | *buffer++ = '0'; |
106 | sprintf(buffer, "%d", position); | 106 | sprintf(buffer, "%d", position); |
107 | |||
108 | } | 107 | } |
diff --git a/arch/ia64/sn/kernel/setup.c b/arch/ia64/sn/kernel/setup.c index e510dce9971f..ee36bff93c30 100644 --- a/arch/ia64/sn/kernel/setup.c +++ b/arch/ia64/sn/kernel/setup.c | |||
@@ -209,7 +209,7 @@ void __init early_sn_setup(void) | |||
209 | } | 209 | } |
210 | 210 | ||
211 | extern int platform_intr_list[]; | 211 | extern int platform_intr_list[]; |
212 | static int __initdata shub_1_1_found = 0; | 212 | static int __initdata shub_1_1_found; |
213 | 213 | ||
214 | /* | 214 | /* |
215 | * sn_check_for_wars | 215 | * sn_check_for_wars |
@@ -578,13 +578,17 @@ void __init sn_cpu_init(void) | |||
578 | sn_prom_type = 2; | 578 | sn_prom_type = 2; |
579 | else | 579 | else |
580 | sn_prom_type = 1; | 580 | sn_prom_type = 1; |
581 | printk("Running on medusa with %s PROM\n", (sn_prom_type == 1) ? "real" : "fake"); | 581 | printk(KERN_INFO "Running on medusa with %s PROM\n", |
582 | (sn_prom_type == 1) ? "real" : "fake"); | ||
582 | } | 583 | } |
583 | 584 | ||
584 | memset(pda, 0, sizeof(pda)); | 585 | memset(pda, 0, sizeof(pda)); |
585 | if (ia64_sn_get_sn_info(0, &sn_hub_info->shub2, &sn_hub_info->nasid_bitmask, &sn_hub_info->nasid_shift, | 586 | if (ia64_sn_get_sn_info(0, &sn_hub_info->shub2, |
586 | &sn_system_size, &sn_sharing_domain_size, &sn_partition_id, | 587 | &sn_hub_info->nasid_bitmask, |
587 | &sn_coherency_id, &sn_region_size)) | 588 | &sn_hub_info->nasid_shift, |
589 | &sn_system_size, &sn_sharing_domain_size, | ||
590 | &sn_partition_id, &sn_coherency_id, | ||
591 | &sn_region_size)) | ||
588 | BUG(); | 592 | BUG(); |
589 | sn_hub_info->as_shift = sn_hub_info->nasid_shift - 2; | 593 | sn_hub_info->as_shift = sn_hub_info->nasid_shift - 2; |
590 | 594 | ||
@@ -716,7 +720,8 @@ void __init build_cnode_tables(void) | |||
716 | for_each_online_node(node) { | 720 | for_each_online_node(node) { |
717 | kl_config_hdr_t *klgraph_header; | 721 | kl_config_hdr_t *klgraph_header; |
718 | nasid = cnodeid_to_nasid(node); | 722 | nasid = cnodeid_to_nasid(node); |
719 | if ((klgraph_header = ia64_sn_get_klconfig_addr(nasid)) == NULL) | 723 | klgraph_header = ia64_sn_get_klconfig_addr(nasid); |
724 | if (klgraph_header == NULL) | ||
720 | BUG(); | 725 | BUG(); |
721 | brd = NODE_OFFSET_TO_LBOARD(nasid, klgraph_header->ch_board_info); | 726 | brd = NODE_OFFSET_TO_LBOARD(nasid, klgraph_header->ch_board_info); |
722 | while (brd) { | 727 | while (brd) { |
@@ -734,7 +739,7 @@ nasid_slice_to_cpuid(int nasid, int slice) | |||
734 | { | 739 | { |
735 | long cpu; | 740 | long cpu; |
736 | 741 | ||
737 | for (cpu=0; cpu < NR_CPUS; cpu++) | 742 | for (cpu = 0; cpu < NR_CPUS; cpu++) |
738 | if (cpuid_to_nasid(cpu) == nasid && | 743 | if (cpuid_to_nasid(cpu) == nasid && |
739 | cpuid_to_slice(cpu) == slice) | 744 | cpuid_to_slice(cpu) == slice) |
740 | return cpu; | 745 | return cpu; |