aboutsummaryrefslogtreecommitdiffstats
path: root/arch/ia64
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-01-06 21:02:43 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2012-01-06 21:02:43 -0500
commit5ee354a0295c34aa7da07be8490f86edee2c7883 (patch)
tree9ceeba4179d48f0ca7b31a4d2b5a7f1d60df5ecb /arch/ia64
parentc77417132c12af338a7d37956809b2b98d20413c (diff)
parenta4b1d1b3619ee2fac40cdf5ca86a4758e45b9358 (diff)
Merge branch 'misc-3.3' of git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux
* 'misc-3.3' of git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux: ia64: pcibr: Use kmemdup rather than duplicating its implementation ia64: sn: Use kmemdup rather than duplicating its implementation ia64: tioca: Use kmemdup rather than duplicating its implementation [IA64] Merge overlapping reserved regions at boot
Diffstat (limited to 'arch/ia64')
-rw-r--r--arch/ia64/kernel/setup.c19
-rw-r--r--arch/ia64/sn/kernel/irq.c5
-rw-r--r--arch/ia64/sn/pci/pcibr/pcibr_provider.c3
-rw-r--r--arch/ia64/sn/pci/tioca_provider.c4
4 files changed, 24 insertions, 7 deletions
diff --git a/arch/ia64/kernel/setup.c b/arch/ia64/kernel/setup.c
index 5e2c72498c51..cd57d7312de0 100644
--- a/arch/ia64/kernel/setup.c
+++ b/arch/ia64/kernel/setup.c
@@ -220,6 +220,23 @@ sort_regions (struct rsvd_region *rsvd_region, int max)
220 } 220 }
221} 221}
222 222
223/* merge overlaps */
224static int __init
225merge_regions (struct rsvd_region *rsvd_region, int max)
226{
227 int i;
228 for (i = 1; i < max; ++i) {
229 if (rsvd_region[i].start >= rsvd_region[i-1].end)
230 continue;
231 if (rsvd_region[i].end > rsvd_region[i-1].end)
232 rsvd_region[i-1].end = rsvd_region[i].end;
233 --max;
234 memmove(&rsvd_region[i], &rsvd_region[i+1],
235 (max - i) * sizeof(struct rsvd_region));
236 }
237 return max;
238}
239
223/* 240/*
224 * Request address space for all standard resources 241 * Request address space for all standard resources
225 */ 242 */
@@ -270,6 +287,7 @@ static void __init setup_crashkernel(unsigned long total, int *n)
270 if (ret == 0 && size > 0) { 287 if (ret == 0 && size > 0) {
271 if (!base) { 288 if (!base) {
272 sort_regions(rsvd_region, *n); 289 sort_regions(rsvd_region, *n);
290 *n = merge_regions(rsvd_region, *n);
273 base = kdump_find_rsvd_region(size, 291 base = kdump_find_rsvd_region(size,
274 rsvd_region, *n); 292 rsvd_region, *n);
275 } 293 }
@@ -373,6 +391,7 @@ reserve_memory (void)
373 BUG_ON(IA64_MAX_RSVD_REGIONS + 1 < n); 391 BUG_ON(IA64_MAX_RSVD_REGIONS + 1 < n);
374 392
375 sort_regions(rsvd_region, num_rsvd_regions); 393 sort_regions(rsvd_region, num_rsvd_regions);
394 num_rsvd_regions = merge_regions(rsvd_region, num_rsvd_regions);
376} 395}
377 396
378 397
diff --git a/arch/ia64/sn/kernel/irq.c b/arch/ia64/sn/kernel/irq.c
index 485c42d97e83..dfac09ab027a 100644
--- a/arch/ia64/sn/kernel/irq.c
+++ b/arch/ia64/sn/kernel/irq.c
@@ -150,12 +150,11 @@ struct sn_irq_info *sn_retarget_vector(struct sn_irq_info *sn_irq_info,
150 * PROM does not support SAL_INTR_REDIRECT, or it failed. 150 * PROM does not support SAL_INTR_REDIRECT, or it failed.
151 * Revert to old method. 151 * Revert to old method.
152 */ 152 */
153 new_irq_info = kmalloc(sizeof(struct sn_irq_info), GFP_ATOMIC); 153 new_irq_info = kmemdup(sn_irq_info, sizeof(struct sn_irq_info),
154 GFP_ATOMIC);
154 if (new_irq_info == NULL) 155 if (new_irq_info == NULL)
155 return NULL; 156 return NULL;
156 157
157 memcpy(new_irq_info, sn_irq_info, sizeof(struct sn_irq_info));
158
159 /* Free the old PROM new_irq_info structure */ 158 /* Free the old PROM new_irq_info structure */
160 sn_intr_free(local_nasid, local_widget, new_irq_info); 159 sn_intr_free(local_nasid, local_widget, new_irq_info);
161 unregister_intr_pda(new_irq_info); 160 unregister_intr_pda(new_irq_info);
diff --git a/arch/ia64/sn/pci/pcibr/pcibr_provider.c b/arch/ia64/sn/pci/pcibr/pcibr_provider.c
index 5698f29d5add..8886a0bc4a11 100644
--- a/arch/ia64/sn/pci/pcibr/pcibr_provider.c
+++ b/arch/ia64/sn/pci/pcibr/pcibr_provider.c
@@ -127,12 +127,11 @@ pcibr_bus_fixup(struct pcibus_bussoft *prom_bussoft, struct pci_controller *cont
127 * Allocate kernel bus soft and copy from prom. 127 * Allocate kernel bus soft and copy from prom.
128 */ 128 */
129 129
130 soft = kmalloc(sizeof(struct pcibus_info), GFP_KERNEL); 130 soft = kmemdup(prom_bussoft, sizeof(struct pcibus_info), GFP_KERNEL);
131 if (!soft) { 131 if (!soft) {
132 return NULL; 132 return NULL;
133 } 133 }
134 134
135 memcpy(soft, prom_bussoft, sizeof(struct pcibus_info));
136 soft->pbi_buscommon.bs_base = (unsigned long) 135 soft->pbi_buscommon.bs_base = (unsigned long)
137 ioremap(REGION_OFFSET(soft->pbi_buscommon.bs_base), 136 ioremap(REGION_OFFSET(soft->pbi_buscommon.bs_base),
138 sizeof(struct pic)); 137 sizeof(struct pic));
diff --git a/arch/ia64/sn/pci/tioca_provider.c b/arch/ia64/sn/pci/tioca_provider.c
index 642451e770ea..e77c477245fd 100644
--- a/arch/ia64/sn/pci/tioca_provider.c
+++ b/arch/ia64/sn/pci/tioca_provider.c
@@ -600,11 +600,11 @@ tioca_bus_fixup(struct pcibus_bussoft *prom_bussoft, struct pci_controller *cont
600 * Allocate kernel bus soft and copy from prom. 600 * Allocate kernel bus soft and copy from prom.
601 */ 601 */
602 602
603 tioca_common = kzalloc(sizeof(struct tioca_common), GFP_KERNEL); 603 tioca_common = kmemdup(prom_bussoft, sizeof(struct tioca_common),
604 GFP_KERNEL);
604 if (!tioca_common) 605 if (!tioca_common)
605 return NULL; 606 return NULL;
606 607
607 memcpy(tioca_common, prom_bussoft, sizeof(struct tioca_common));
608 tioca_common->ca_common.bs_base = (unsigned long) 608 tioca_common->ca_common.bs_base = (unsigned long)
609 ioremap(REGION_OFFSET(tioca_common->ca_common.bs_base), 609 ioremap(REGION_OFFSET(tioca_common->ca_common.bs_base),
610 sizeof(struct tioca_common)); 610 sizeof(struct tioca_common));