ia32/syscall32.c | 3 ++- kernel/aperture.c | 27 +++++++++++++++++---------- kernel/bluesmoke.c | 8 +++++--- kernel/nmi.c | 4 ++-- kernel/pci-gart.c | 15 +++++++-------- kernel/setup.c | 2 +- kernel/smp.c | 3 ++- lib/csum-partial.c | 5 +++-- mm/fault.c | 9 ++++++--- mm/ioremap.c | 10 ++++++---- 10 files changed, 51 insertions(+), 35 deletions(-) ===== arch/x86_64/ia32/syscall32.c 1.4 vs edited ===== --- 1.4/arch/x86_64/ia32/syscall32.c Fri May 23 03:22:07 2003 +++ edited/arch/x86_64/ia32/syscall32.c Tue Oct 21 15:33:29 2003 @@ -30,10 +30,11 @@ int map_syscall32(struct mm_struct *mm, unsigned long address) { pte_t *pte; + pmd_t *pmd; int err = 0; down_read(&mm->mmap_sem); spin_lock(&mm->page_table_lock); - pmd_t *pmd = pmd_alloc(mm, pgd_offset(mm, address), address); + pmd = pmd_alloc(mm, pgd_offset(mm, address), address); if (pmd && (pte = pte_alloc_map(mm, pmd, address)) != NULL) { if (pte_none(*pte)) { set_pte(pte, ===== arch/x86_64/kernel/aperture.c 1.5 vs edited ===== --- 1.5/arch/x86_64/kernel/aperture.c Fri Aug 8 18:31:35 2003 +++ edited/arch/x86_64/kernel/aperture.c Tue Oct 21 16:10:35 2003 @@ -87,13 +87,15 @@ /* Find a PCI capability */ static __u32 __init find_cap(int num, int slot, int func, int cap) { + u8 pos; + int bytes; if (!(read_pci_config_16(num,slot,func,PCI_STATUS) & PCI_STATUS_CAP_LIST)) return 0; - u8 pos = read_pci_config_byte(num,slot,func,PCI_CAPABILITY_LIST); - int bytes; + pos = read_pci_config_byte(num,slot,func,PCI_CAPABILITY_LIST); for (bytes = 0; bytes < 48 && pos >= 0x40; bytes++) { + u8 id; pos &= ~3; - u8 id = read_pci_config_byte(num,slot,func,pos+PCI_CAP_LIST_ID); + id = read_pci_config_byte(num,slot,func,pos+PCI_CAP_LIST_ID); if (id == 0xff) break; if (id == cap) @@ -106,26 +108,30 @@ /* Read a standard AGPv3 bridge header */ static __u32 __init read_agp(int num, int slot, int func, int cap, u32 *order) { - printk("AGP bridge at %02x:%02x:%02x\n", num, slot, func); u32 apsizereg = read_pci_config_16(num,slot,func, cap + 0x14); + u32 apsize, aper_low, aper_hi; + int nbits; + u64 aper; + + printk("AGP bridge at %02x:%02x:%02x\n", num, slot, func); if (apsizereg == 0xffffffff) { printk("APSIZE in AGP bridge unreadable\n"); return 0; } - u32 apsize = apsizereg & 0xfff; + apsize = apsizereg & 0xfff; /* Some BIOS use weird encodings not in the AGPv3 table. */ if (apsize & 0xff) apsize |= 0xf00; - int nbits = hweight16(apsize); + nbits = hweight16(apsize); *order = 7 - nbits; if ((int)*order < 0) /* < 32MB */ *order = 0; - u32 aper_low = read_pci_config(num,slot,func, 0x10); - u32 aper_hi = read_pci_config(num,slot,func,0x14); - u64 aper = (aper_low & ~((1<<22)-1)) | ((u64)aper_hi << 32); + aper_low = read_pci_config(num,slot,func, 0x10); + aper_hi = read_pci_config(num,slot,func,0x14); + aper = (aper_low & ~((1<<22)-1)) | ((u64)aper_hi << 32); printk("Aperture from AGP @ %Lx size %u MB (APSIZE %x)\n", aper, 32 << *order, apsizereg); @@ -155,6 +161,7 @@ for (slot = 0; slot < 32; slot++) { for (func = 0; func < 8; func++) { u32 class, cap; + u8 type; class = read_pci_config(num,slot,func, PCI_CLASS_REVISION); if (class == 0xffffffff) @@ -172,7 +179,7 @@ } /* No multi-function device? */ - u8 type = read_pci_config_byte(num,slot,func, + type = read_pci_config_byte(num,slot,func, PCI_HEADER_TYPE); if (!(type & 0x80)) break; ===== arch/x86_64/kernel/bluesmoke.c 1.14 vs edited ===== --- 1.14/arch/x86_64/kernel/bluesmoke.c Fri Jul 11 04:34:21 2003 +++ edited/arch/x86_64/kernel/bluesmoke.c Tue Oct 21 14:57:45 2003 @@ -200,11 +200,14 @@ static void check_k8_nb(int header) { struct pci_dev *nb; + u32 statuslow, statushigh; + unsigned short errcode; + int i; + nb = find_k8_nb(); if (nb == NULL) return; - u32 statuslow, statushigh; pci_read_config_dword(nb, 0x48, &statuslow); pci_read_config_dword(nb, 0x4c, &statushigh); if (!(statushigh & (1<<31))) @@ -215,7 +218,7 @@ printk(KERN_ERR "Northbridge status %08x%08x\n", statushigh,statuslow); - unsigned short errcode = statuslow & 0xffff; + errcode = statuslow & 0xffff; switch (errcode >> 8) { case 0: printk(KERN_ERR " GART TLB error %s %s\n", @@ -249,7 +252,6 @@ /* should only print when it was a HyperTransport related error. */ printk(KERN_ERR " link number %x\n", (statushigh >> 4) & 3); - int i; for (i = 0; i < 32; i++) if (highbits[i] && (statushigh & (1<dma_address; + unsigned long addr = start_addr; BUG_ON(i > 0 && s->offset); if (i == start) { *sout = *s; @@ -403,7 +404,6 @@ } else { sout->length += s->length; } - unsigned long addr = start_addr; while (addr < start_addr + s->length) { iommu_gatt_base[iommu_page] = GPTE_ENCODE(addr); SET_LEAK(iommu_page); @@ -503,13 +503,12 @@ size_t size, int direction) { unsigned long iommu_page; - int npages; + int npages, i; if (dma_addr < iommu_bus_base + EMERGENCY_PAGES*PAGE_SIZE || dma_addr > iommu_bus_base + iommu_size) return; iommu_page = (dma_addr - iommu_bus_base)>>PAGE_SHIFT; npages = to_pages(dma_addr, size); - int i; for (i = 0; i < npages; i++) { iommu_gatt_base[iommu_page + i] = 0; CLEAR_LEAK(iommu_page + i); ===== arch/x86_64/kernel/setup.c 1.24 vs edited ===== --- 1.24/arch/x86_64/kernel/setup.c Tue Oct 7 16:33:05 2003 +++ edited/arch/x86_64/kernel/setup.c Tue Oct 21 14:55:34 2003 @@ -332,6 +332,7 @@ void __init setup_arch(char **cmdline_p) { unsigned long low_mem_size; + unsigned long kernel_end; ROOT_DEV = old_decode_dev(ORIG_ROOT_DEV); drive_info = DRIVE_INFO; @@ -380,7 +381,6 @@ (table_end - table_start) << PAGE_SHIFT); /* reserve kernel */ - unsigned long kernel_end; kernel_end = round_up(__pa_symbol(&_end),PAGE_SIZE); reserve_bootmem_generic(HIGH_MEMORY, kernel_end - HIGH_MEMORY); ===== arch/x86_64/kernel/smp.c 1.17 vs edited ===== --- 1.17/arch/x86_64/kernel/smp.c Mon Aug 18 19:46:23 2003 +++ edited/arch/x86_64/kernel/smp.c Tue Oct 21 14:59:03 2003 @@ -496,13 +496,14 @@ int offset = 0, cpu; for (offset = 0; next_cpu(offset, cpu_online_map) < NR_CPUS; offset = cpu + 1) { + unsigned long estack; cpu = next_cpu(offset, cpu_online_map); if (sp >= (u64)cpu_pda[cpu].irqstackptr - IRQSTACKSIZE && sp <= (u64)cpu_pda[cpu].irqstackptr) return cpu; - unsigned long estack = init_tss[cpu].ist[0] - EXCEPTION_STKSZ; + estack = init_tss[cpu].ist[0] - EXCEPTION_STKSZ; if (sp >= estack && sp <= estack+(1<<(PAGE_SHIFT+EXCEPTION_STK_ORDER))) return cpu; } ===== arch/x86_64/lib/csum-partial.c 1.4 vs edited ===== --- 1.4/arch/x86_64/lib/csum-partial.c Tue Oct 7 19:53:42 2003 +++ edited/arch/x86_64/lib/csum-partial.c Tue Oct 21 15:35:50 2003 @@ -48,6 +48,8 @@ } count = len >> 1; /* nr of 16-bit words.. */ if (count) { + unsigned long zero = 0; + unsigned count64; if (2 & (unsigned long) buff) { result += *(unsigned short *)buff; count--; @@ -65,8 +67,7 @@ count >>= 1; /* nr of 64-bit words.. */ /* main loop using 64byte blocks */ - unsigned long zero = 0; - unsigned count64 = count >> 3; + count64 = count >> 3; while (count64) { asm("addq 0*8(%[src]),%[res]\n\t" "adcq 1*8(%[src]),%[res]\n\t" ===== arch/x86_64/mm/fault.c 1.15 vs edited ===== --- 1.15/arch/x86_64/mm/fault.c Thu Sep 25 19:27:11 2003 +++ edited/arch/x86_64/mm/fault.c Tue Oct 21 15:23:02 2003 @@ -143,6 +143,9 @@ void dump_pagetable(unsigned long address) { + pgd_t *pgd; + pmd_t *pmd; + pte_t *pte; pml4_t *pml4; asm("movq %%cr3,%0" : "=r" (pml4)); @@ -152,17 +155,17 @@ if (bad_address(pml4)) goto bad; if (!pml4_present(*pml4)) goto ret; - pgd_t *pgd = __pgd_offset_k((pgd_t *)pml4_page(*pml4), address); + pgd = __pgd_offset_k((pgd_t *)pml4_page(*pml4), address); if (bad_address(pgd)) goto bad; printk("PGD %lx ", pgd_val(*pgd)); if (!pgd_present(*pgd)) goto ret; - pmd_t *pmd = pmd_offset(pgd, address); + pmd = pmd_offset(pgd, address); if (bad_address(pmd)) goto bad; printk("PMD %lx ", pmd_val(*pmd)); if (!pmd_present(*pmd)) goto ret; - pte_t *pte = pte_offset_kernel(pmd, address); + pte = pte_offset_kernel(pmd, address); if (bad_address(pte)) goto bad; printk("PTE %lx", pte_val(*pte)); ret: ===== arch/x86_64/mm/ioremap.c 1.11 vs edited ===== --- 1.11/arch/x86_64/mm/ioremap.c Thu Oct 2 00:11:59 2003 +++ edited/arch/x86_64/mm/ioremap.c Tue Oct 21 15:32:49 2003 @@ -138,10 +138,12 @@ t_end = t_addr + (size - 1); #ifndef CONFIG_DISCONTIGMEM - struct page *page; - for(page = virt_to_page(t_addr); page <= virt_to_page(t_end); page++) - if(!PageReserved(page)) - return NULL; + { + struct page *page; + for(page = virt_to_page(t_addr); page <= virt_to_page(t_end); page++) + if(!PageReserved(page)) + return NULL; + } #endif }