Merge git://git.kernel.org/pub/scm/linux/kernel/git/bart/ide-2.6
authorLinus Torvalds <torvalds@woody.linux-foundation.org>
Sun, 28 Oct 2007 19:03:14 +0000 (12:03 -0700)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Sun, 28 Oct 2007 19:03:14 +0000 (12:03 -0700)
* git://git.kernel.org/pub/scm/linux/kernel/git/bart/ide-2.6:
  ide: add SH-S202J to ivb_list[]
  drivers/ide/pci/sc1200.c: fix suspend/resume buglets and warnings
  drivers/ide/pci/generic: fix build for CONFIG_HOTPLUG=n
  hpt366: fix build for CONFIG_HOTPLUG=n
  cy82c693: fix build for CONFIG_HOTPLUG=n

97 files changed:
MAINTAINERS
Makefile
arch/frv/mb93090-mb00/pci-dma.c
arch/i386/.gitignore [deleted file]
arch/sparc/kernel/pcic.c
arch/sparc/kernel/process.c
arch/sparc/kernel/time.c
arch/sparc/mm/btfixup.c
arch/sparc/mm/io-unit.c
arch/sparc/mm/sun4c.c
arch/sparc64/kernel/binfmt_elf32.c
arch/sparc64/kernel/central.c
arch/sparc64/kernel/semaphore.c
arch/sparc64/kernel/smp.c
arch/sparc64/kernel/traps.c
arch/sparc64/mm/init.c
arch/sparc64/prom/console.c
arch/sparc64/prom/tree.c
arch/x86/Kconfig.cpu [moved from arch/i386/Kconfig.cpu with 100% similarity]
arch/x86/Kconfig.debug [moved from arch/i386/Kconfig.debug with 65% similarity]
arch/x86/Kconfig.i386 [moved from arch/i386/Kconfig with 99% similarity]
arch/x86/Kconfig.x86_64 [moved from arch/x86_64/Kconfig with 99% similarity]
arch/x86/Makefile [new file with mode: 0644]
arch/x86/Makefile_32 [moved from arch/i386/Makefile with 98% similarity]
arch/x86/Makefile_32.cpu [moved from arch/i386/Makefile.cpu with 100% similarity]
arch/x86/Makefile_64 [moved from arch/x86_64/Makefile with 99% similarity]
arch/x86/boot/boot.h
arch/x86/boot/compressed/head_32.S
arch/x86/boot/compressed/head_64.S
arch/x86/boot/header.S
arch/x86/boot/video-bios.c
arch/x86/boot/video-vesa.c
arch/x86/boot/video.c
arch/x86/configs/i386_defconfig [moved from arch/i386/defconfig with 100% similarity]
arch/x86/configs/x86_64_defconfig [moved from arch/x86_64/defconfig with 100% similarity]
arch/x86/kernel/acpi/processor.c
arch/x86/kernel/asm-offsets_64.c
arch/x86/kernel/early-quirks.c
arch/x86/kernel/machine_kexec_64.c
arch/x86/kernel/smp_32.c
arch/x86/mach-voyager/voyager_smp.c
arch/x86_64/.gitignore [deleted file]
arch/x86_64/Kconfig.debug [deleted file]
crypto/tcrypt.c
drivers/crypto/padlock-sha.c
drivers/ide/arm/icside.c
drivers/md/dm-crypt.c
drivers/mmc/core/mmc_ops.c
drivers/mmc/core/sd_ops.c
drivers/mmc/host/au1xmmc.c
drivers/mmc/host/mmc_spi.c
drivers/net/loopback.c
drivers/net/ppp_mppe.c
drivers/scsi/iscsi_tcp.c
drivers/video/cirrusfb.c
fs/ecryptfs/crypto.c
fs/jffs2/acl.c
fs/proc/proc_net.c
include/asm-sparc/atomic.h
include/asm-sparc/dma.h
include/asm-sparc/floppy.h
include/asm-sparc/ide.h
include/asm-sparc/posix_types.h
include/asm-sparc/system.h
include/asm-sparc64/atomic.h
include/asm-sparc64/backoff.h
include/asm-sparc64/byteorder.h
include/asm-sparc64/fpumacro.h
include/asm-sparc64/io.h
include/asm-sparc64/irq.h
include/asm-sparc64/mostek.h
include/asm-sparc64/ns87303.h
include/asm-sparc64/parport.h
include/asm-sparc64/posix_types.h
include/asm-sparc64/sbus.h
include/asm-sparc64/spitfire.h
include/asm-sparc64/system.h
include/asm-sparc64/upa.h
include/asm-sparc64/visasm.h
include/asm-x86/smp_32.h
include/linux/mv643xx_eth.h
include/net/net_namespace.h
net/core/dev.c
net/core/dev_mcast.c
net/core/rtnetlink.c
net/ipv4/esp4.c
net/ipv6/esp6.c
net/ipv6/tcp_ipv6.c
net/netlink/af_netlink.c
net/rxrpc/rxkad.c
net/sctp/auth.c
net/sctp/sm_make_chunk.c
net/sunrpc/auth_gss/gss_krb5_crypto.c
net/sunrpc/auth_gss/gss_spkm3_seal.c
net/sunrpc/xdr.c
scripts/kconfig/Makefile
sound/pci/hda/patch_realtek.c

index 5b45462..231bda2 100644 (file)
@@ -2129,8 +2129,8 @@ S:        Maintained
 JOURNALLING FLASH FILE SYSTEM V2 (JFFS2)
 P:     David Woodhouse
 M:     dwmw2@infradead.org
-L:     jffs-dev@axis.com
-W:     http://sources.redhat.com/jffs2/
+L:     linux-mtd@lists.infradead.org
+W:     http://www.linux-mtd.infradead.org/doc/jffs2.html
 S:     Maintained
 
 JFS FILESYSTEM
index 2a47290..8816060 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -196,6 +196,9 @@ CROSS_COMPILE       ?=
 UTS_MACHINE    := $(ARCH)
 SRCARCH        := $(ARCH)
 
+# for i386 and x86_64 we use SRCARCH equal to x86
+SRCARCH := $(if $(filter x86_64 i386,$(SRCARCH)),x86,$(SRCARCH))
+
 KCONFIG_CONFIG ?= .config
 
 # SHELL used by kbuild
@@ -418,7 +421,7 @@ ifeq ($(config-targets),1)
 # Read arch specific Makefile to set KBUILD_DEFCONFIG as needed.
 # KBUILD_DEFCONFIG may point out an alternative default configuration
 # used for 'make defconfig'
-include $(srctree)/arch/$(ARCH)/Makefile
+include $(srctree)/arch/$(SRCARCH)/Makefile
 export KBUILD_DEFCONFIG
 
 config %config: scripts_basic outputmakefile FORCE
@@ -497,7 +500,7 @@ else
 KBUILD_CFLAGS  += -O2
 endif
 
-include $(srctree)/arch/$(ARCH)/Makefile
+include $(srctree)/arch/$(SRCARCH)/Makefile
 
 ifdef CONFIG_FRAME_POINTER
 KBUILD_CFLAGS  += -fno-omit-frame-pointer -fno-optimize-sibling-calls
index 671ce1e..662f7b1 100644 (file)
@@ -15,6 +15,7 @@
 #include <linux/list.h>
 #include <linux/pci.h>
 #include <linux/highmem.h>
+#include <linux/scatterlist.h>
 #include <asm/io.h>
 
 void *dma_alloc_coherent(struct device *hwdev, size_t size, dma_addr_t *dma_handle, gfp_t gfp)
@@ -86,7 +87,7 @@ int dma_map_sg(struct device *dev, struct scatterlist *sg, int nents,
        dampr2 = __get_DAMPR(2);
 
        for (i = 0; i < nents; i++) {
-               vaddr = kmap_atomic(sg[i].page, __KM_CACHE);
+               vaddr = kmap_atomic(sg_page(&sg[i]), __KM_CACHE);
 
                frv_dcache_writeback((unsigned long) vaddr,
                                     (unsigned long) vaddr + PAGE_SIZE);
diff --git a/arch/i386/.gitignore b/arch/i386/.gitignore
deleted file mode 100644 (file)
index 36ef4c3..0000000
+++ /dev/null
@@ -1 +0,0 @@
-boot
index f2eae45..f2d432e 100644 (file)
@@ -753,7 +753,7 @@ void __init pci_time_init(void)
        local_irq_enable();
 }
 
-static __inline__ unsigned long do_gettimeoffset(void)
+static inline unsigned long do_gettimeoffset(void)
 {
        /*
         * We divide all by 100
index 33f7a3d..77460e3 100644 (file)
@@ -1,7 +1,6 @@
-/*  $Id: process.c,v 1.161 2002/01/23 11:27:32 davem Exp $
- *  linux/arch/sparc/kernel/process.c
+/*  linux/arch/sparc/kernel/process.c
  *
- *  Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
+ *  Copyright (C) 1995 David S. Miller (davem@davemloft.net)
  *  Copyright (C) 1996 Eddie C. Dost   (ecd@skynet.be)
  */
 
@@ -397,7 +396,7 @@ void flush_thread(void)
        }
 }
 
-static __inline__ struct sparc_stackf __user *
+static inline struct sparc_stackf __user *
 clone_stackframe(struct sparc_stackf __user *dst,
                 struct sparc_stackf __user *src)
 {
index 4bf78a5..45cb7c5 100644 (file)
@@ -1,7 +1,6 @@
-/* $Id: time.c,v 1.60 2002/01/23 14:33:55 davem Exp $
- * linux/arch/sparc/kernel/time.c
+/* linux/arch/sparc/kernel/time.c
  *
- * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
+ * Copyright (C) 1995 David S. Miller (davem@davemloft.net)
  * Copyright (C) 1996 Thomas K. Dyas (tdyas@eden.rutgers.edu)
  *
  * Chris Davis (cdavis@cois.on.ca) 03/27/1998
@@ -210,7 +209,7 @@ static void __devinit kick_start_clock(void)
 }
 
 /* Return nonzero if the clock chip battery is low. */
-static __inline__ int has_low_battery(void)
+static inline int has_low_battery(void)
 {
        struct mostek48t02 *regs = (struct mostek48t02 *)mstk48t02_regs;
        unsigned char data1, data2;
@@ -252,7 +251,7 @@ static void __devinit mostek_set_system_time(void)
 }
 
 /* Probe for the real time clock chip on Sun4 */
-static __inline__ void sun4_clock_probe(void)
+static inline void sun4_clock_probe(void)
 {
 #ifdef CONFIG_SUN4
        int temp;
index ec4231c..a312d12 100644 (file)
@@ -1,5 +1,4 @@
-/* $Id: btfixup.c,v 1.10 2000/05/09 17:40:13 davem Exp $
- * btfixup.c: Boot time code fixup and relocator, so that
+/* btfixup.c: Boot time code fixup and relocator, so that
  * we can get rid of most indirect calls to achieve single
  * image sun4c and srmmu kernel.
  *
@@ -69,7 +68,7 @@ static void __init set_addr(unsigned int *addr, unsigned int q1, int fmangled, u
        }
 }
 #else
-static __inline__ void set_addr(unsigned int *addr, unsigned int q1, int fmangled, unsigned int value)
+static inline void set_addr(unsigned int *addr, unsigned int q1, int fmangled, unsigned int value)
 {
        *addr = value;
 }
index 1666087..b86dfce 100644 (file)
@@ -144,7 +144,7 @@ static void iounit_get_scsi_sgl(struct scatterlist *sg, int sz, struct sbus_bus
        spin_lock_irqsave(&iounit->lock, flags);
        while (sz != 0) {
                --sz;
-               sg->dvma_address = iounit_get_area(iounit, sg_virt(sg), sg->length);
+               sg->dvma_address = iounit_get_area(iounit, (unsigned long) sg_virt(sg), sg->length);
                sg->dvma_length = sg->length;
                sg = sg_next(sg);
        }
index a2cc141..0729305 100644 (file)
@@ -1,7 +1,6 @@
-/* $Id: sun4c.c,v 1.212 2001/12/21 04:56:15 davem Exp $
- * sun4c.c: Doing in software what should be done in hardware.
+/* sun4c.c: Doing in software what should be done in hardware.
  *
- * Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu)
+ * Copyright (C) 1996 David S. Miller (davem@davemloft.net)
  * Copyright (C) 1996 Eddie C. Dost (ecd@skynet.be)
  * Copyright (C) 1996 Andrew Tridgell (Andrew.Tridgell@anu.edu.au)
  * Copyright (C) 1997-2000 Anton Blanchard (anton@samba.org)
@@ -719,7 +718,7 @@ static void add_ring(struct sun4c_mmu_ring *ring,
        ring->num_entries++;
 }
 
-static __inline__ void add_lru(struct sun4c_mmu_entry *entry)
+static inline void add_lru(struct sun4c_mmu_entry *entry)
 {
        struct sun4c_mmu_ring *ring = &sun4c_ulru_ring;
        struct sun4c_mmu_entry *head = &ring->ringhd;
@@ -746,7 +745,7 @@ static void add_ring_ordered(struct sun4c_mmu_ring *ring,
        add_lru(entry);
 }
 
-static __inline__ void remove_ring(struct sun4c_mmu_ring *ring,
+static inline void remove_ring(struct sun4c_mmu_ring *ring,
                                   struct sun4c_mmu_entry *entry)
 {
        struct sun4c_mmu_entry *next = entry->next;
@@ -1836,7 +1835,7 @@ static unsigned long sun4c_pte_to_pgoff(pte_t pte)
 }
 
 
-static __inline__ unsigned long sun4c_pmd_page_v(pmd_t pmd)
+static inline unsigned long sun4c_pmd_page_v(pmd_t pmd)
 {
        return (pmd_val(pmd) & PAGE_MASK);
 }
@@ -1922,7 +1921,7 @@ static void sun4c_free_pgd_fast(pgd_t *pgd)
 }
 
 
-static __inline__ pte_t *
+static inline pte_t *
 sun4c_pte_alloc_one_fast(struct mm_struct *mm, unsigned long address)
 {
        unsigned long *ret;
@@ -1956,7 +1955,7 @@ static struct page *sun4c_pte_alloc_one(struct mm_struct *mm, unsigned long addr
        return virt_to_page(pte);
 }
 
-static __inline__ void sun4c_free_pte_fast(pte_t *pte)
+static inline void sun4c_free_pte_fast(pte_t *pte)
 {
        *(unsigned long *)pte = (unsigned long) pte_quicklist;
        pte_quicklist = (unsigned long *) pte;
index 9ad84ff..1587a29 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * binfmt_elf32.c: Support 32-bit Sparc ELF binaries on Ultra.
  *
- * Copyright (C) 1995, 1996, 1997, 1998 David S. Miller        (davem@redhat.com)
+ * Copyright (C) 1995, 1996, 1997, 1998 David S. Miller        (davem@davemloft.net)
  * Copyright (C) 1995, 1996, 1997, 1998 Jakub Jelinek  (jj@ultra.linux.cz)
  */
 
@@ -133,7 +133,7 @@ struct elf_prpsinfo32
 
 #undef cputime_to_timeval
 #define cputime_to_timeval cputime_to_compat_timeval
-static __inline__ void
+static inline void
 cputime_to_compat_timeval(const cputime_t cputime, struct compat_timeval *value)
 {
        unsigned long jiffies = cputime_to_jiffies(cputime);
index 8230099..b61b8df 100644 (file)
@@ -1,7 +1,6 @@
-/* $Id: central.c,v 1.15 2001/12/19 00:29:51 davem Exp $
- * central.c: Central FHC driver for Sunfire/Starfire/Wildfire.
+/* central.c: Central FHC driver for Sunfire/Starfire/Wildfire.
  *
- * Copyright (C) 1997, 1999 David S. Miller (davem@redhat.com)
+ * Copyright (C) 1997, 1999 David S. Miller (davem@davemloft.net)
  */
 
 #include <linux/kernel.h>
@@ -385,7 +384,7 @@ void __init central_probe(void)
        init_all_fhc_hw();
 }
 
-static __inline__ void fhc_ledblink(struct linux_fhc *fhc, int on)
+static inline void fhc_ledblink(struct linux_fhc *fhc, int on)
 {
        u32 tmp;
 
@@ -402,7 +401,7 @@ static __inline__ void fhc_ledblink(struct linux_fhc *fhc, int on)
        upa_readl(fhc->fhc_regs.pregs + FHC_PREGS_CTRL);
 }
 
-static __inline__ void central_ledblink(struct linux_central *central, int on)
+static inline void central_ledblink(struct linux_central *central, int on)
 {
        u8 tmp;
 
index a809e63..9974a68 100644 (file)
@@ -1,5 +1,4 @@
-/* $Id: semaphore.c,v 1.9 2001/11/18 00:12:56 davem Exp $
- * semaphore.c: Sparc64 semaphore implementation.
+/* semaphore.c: Sparc64 semaphore implementation.
  *
  * This is basically the PPC semaphore scheme ported to use
  * the sparc64 atomic instructions, so see the PPC code for
@@ -19,7 +18,7 @@
  *     sem->count = tmp;
  *     return old_count;
  */
-static __inline__ int __sem_update_count(struct semaphore *sem, int incr)
+static inline int __sem_update_count(struct semaphore *sem, int incr)
 {
        int old_count, tmp;
 
index 407d74a..7cd8d94 100644 (file)
@@ -459,7 +459,7 @@ again:
        }
 }
 
-static __inline__ void spitfire_xcall_deliver(u64 data0, u64 data1, u64 data2, cpumask_t mask)
+static inline void spitfire_xcall_deliver(u64 data0, u64 data1, u64 data2, cpumask_t mask)
 {
        u64 pstate;
        int i;
@@ -906,7 +906,7 @@ extern atomic_t dcpage_flushes;
 extern atomic_t dcpage_flushes_xcall;
 #endif
 
-static __inline__ void __local_flush_dcache_page(struct page *page)
+static inline void __local_flush_dcache_page(struct page *page)
 {
 #ifdef DCACHE_ALIASING_POSSIBLE
        __flush_dcache_page(page_address(page),
index e9c7e4f..0499838 100644 (file)
@@ -1,7 +1,6 @@
-/* $Id: traps.c,v 1.85 2002/02/09 19:49:31 davem Exp $
- * arch/sparc64/kernel/traps.c
+/* arch/sparc64/kernel/traps.c
  *
- * Copyright (C) 1995,1997 David S. Miller (davem@caip.rutgers.edu)
+ * Copyright (C) 1995,1997 David S. Miller (davem@davemloft.net)
  * Copyright (C) 1997,1999,2000 Jakub Jelinek (jakub@redhat.com)
  */
 
@@ -765,7 +764,7 @@ static unsigned long cheetah_afsr_errors;
  */
 struct cheetah_err_info *cheetah_error_log;
 
-static __inline__ struct cheetah_err_info *cheetah_get_error_log(unsigned long afsr)
+static inline struct cheetah_err_info *cheetah_get_error_log(unsigned long afsr)
 {
        struct cheetah_err_info *p;
        int cpu = smp_processor_id();
@@ -1085,7 +1084,7 @@ static unsigned char cheetah_mtag_syntab[] = {
 };
 
 /* Return the highest priority error conditon mentioned. */
-static __inline__ unsigned long cheetah_get_hipri(unsigned long afsr)
+static inline unsigned long cheetah_get_hipri(unsigned long afsr)
 {
        unsigned long tmp = 0;
        int i;
index 100c445..e18ccf8 100644 (file)
@@ -201,7 +201,7 @@ inline void flush_dcache_page_impl(struct page *page)
 #define dcache_dirty_cpu(page) \
        (((page)->flags >> PG_dcache_cpu_shift) & PG_dcache_cpu_mask)
 
-static __inline__ void set_dcache_dirty(struct page *page, int this_cpu)
+static inline void set_dcache_dirty(struct page *page, int this_cpu)
 {
        unsigned long mask = this_cpu;
        unsigned long non_cpu_bits;
@@ -223,7 +223,7 @@ static __inline__ void set_dcache_dirty(struct page *page, int this_cpu)
                             : "g1", "g7");
 }
 
-static __inline__ void clear_dcache_dirty_cpu(struct page *page, unsigned long cpu)
+static inline void clear_dcache_dirty_cpu(struct page *page, unsigned long cpu)
 {
        unsigned long mask = (1UL << PG_dcache_dirty);
 
index 3fafa9a..e1c3fc8 100644 (file)
@@ -1,8 +1,7 @@
-/* $Id: console.c,v 1.9 1997/10/29 07:41:43 ecd Exp $
- * console.c: Routines that deal with sending and receiving IO
+/* console.c: Routines that deal with sending and receiving IO
  *            to/from the current console device using the PROM.
  *
- * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
+ * Copyright (C) 1995 David S. Miller (davem@davemloft.net)
  * Copyright (C) 1996,1997 Jakub Jelinek (jj@sunsite.mff.cuni.cz)
  */
 
@@ -19,7 +18,7 @@ extern int prom_stdin, prom_stdout;
 /* Non blocking get character from console input device, returns -1
  * if no input was taken.  This can be used for polling.
  */
-__inline__ int
+inline int
 prom_nbgetchar(void)
 {
        char inc;
@@ -35,7 +34,7 @@ prom_nbgetchar(void)
 /* Non blocking put character to console device, returns -1 if
  * unsuccessful.
  */
-__inline__ int
+inline int
 prom_nbputchar(char c)
 {
        char outc;
index b2c5b12..a99ccd7 100644 (file)
 /* Return the child of node 'node' or zero if no this node has no
  * direct descendent.
  */
-__inline__ int
-__prom_getchild(int node)
+inline int __prom_getchild(int node)
 {
        return p1275_cmd ("child", P1275_INOUT(1, 1), node);
 }
 
-__inline__ int
-prom_getchild(int node)
+inline int prom_getchild(int node)
 {
        int cnode;
 
@@ -35,8 +33,7 @@ prom_getchild(int node)
        return (int)cnode;
 }
 
-__inline__ int
-prom_getparent(int node)
+inline int prom_getparent(int node)
 {
        int cnode;
 
@@ -49,14 +46,12 @@ prom_getparent(int node)
 /* Return the next sibling of node 'node' or zero if no more siblings
  * at this level of depth in the tree.
  */
-__inline__ int
-__prom_getsibling(int node)
+inline int __prom_getsibling(int node)
 {
        return p1275_cmd(prom_peer_name, P1275_INOUT(1, 1), node);
 }
 
-__inline__ int
-prom_getsibling(int node)
+inline int prom_getsibling(int node)
 {
        int sibnode;
 
@@ -72,8 +67,7 @@ prom_getsibling(int node)
 /* Return the length in bytes of property 'prop' at node 'node'.
  * Return -1 on error.
  */
-__inline__ int
-prom_getproplen(int node, const char *prop)
+inline int prom_getproplen(int node, const char *prop)
 {
        if((!node) || (!prop)) return -1;
        return p1275_cmd ("getproplen", 
@@ -86,8 +80,8 @@ prom_getproplen(int node, const char *prop)
  * 'buffer' which has a size of 'bufsize'.  If the acquisition
  * was successful the length will be returned, else -1 is returned.
  */
-__inline__ int
-prom_getproperty(int node, const char *prop, char *buffer, int bufsize)
+inline int prom_getproperty(int node, const char *prop,
+                           char *buffer, int bufsize)
 {
        int plen;
 
@@ -107,8 +101,7 @@ prom_getproperty(int node, const char *prop, char *buffer, int bufsize)
 /* Acquire an integer property and return its value.  Returns -1
  * on failure.
  */
-__inline__ int
-prom_getint(int node, const char *prop)
+inline int prom_getint(int node, const char *prop)
 {
        int intprop;
 
@@ -122,8 +115,7 @@ prom_getint(int node, const char *prop)
  * integer.
  */
 
-int
-prom_getintdefault(int node, const char *property, int deflt)
+int prom_getintdefault(int node, const char *property, int deflt)
 {
        int retval;
 
@@ -134,8 +126,7 @@ prom_getintdefault(int node, const char *property, int deflt)
 }
 
 /* Acquire a boolean property, 1=TRUE 0=FALSE. */
-int
-prom_getbool(int node, const char *prop)
+int prom_getbool(int node, const char *prop)
 {
        int retval;
 
@@ -148,8 +139,7 @@ prom_getbool(int node, const char *prop)
  * string on error.  The char pointer is the user supplied string
  * buffer.
  */
-void
-prom_getstring(int node, const char *prop, char *user_buf, int ubuf_size)
+void prom_getstring(int node, const char *prop, char *user_buf, int ubuf_size)
 {
        int len;
 
@@ -163,8 +153,7 @@ prom_getstring(int node, const char *prop, char *user_buf, int ubuf_size)
 /* Does the device at node 'node' have name 'name'?
  * YES = 1   NO = 0
  */
-int
-prom_nodematch(int node, const char *name)
+int prom_nodematch(int node, const char *name)
 {
        char namebuf[128];
        prom_getproperty(node, "name", namebuf, sizeof(namebuf));
@@ -175,8 +164,7 @@ prom_nodematch(int node, const char *name)
 /* Search siblings at 'node_start' for a node with name
  * 'nodename'.  Return node if successful, zero if not.
  */
-int
-prom_searchsiblings(int node_start, const char *nodename)
+int prom_searchsiblings(int node_start, const char *nodename)
 {
 
        int thisnode, error;
@@ -197,8 +185,7 @@ prom_searchsiblings(int node_start, const char *nodename)
 /* Return the first property type for node 'node'.
  * buffer should be at least 32B in length
  */
-__inline__ char *
-prom_firstprop(int node, char *buffer)
+inline char *prom_firstprop(int node, char *buffer)
 {
        *buffer = 0;
        if(node == -1) return buffer;
@@ -212,8 +199,7 @@ prom_firstprop(int node, char *buffer)
  * at node 'node' .  Returns NULL string if no more
  * property types for this node.
  */
-__inline__ char *
-prom_nextprop(int node, const char *oprop, char *buffer)
+inline char *prom_nextprop(int node, const char *oprop, char *buffer)
 {
        char buf[32];
 
@@ -279,8 +265,7 @@ prom_setprop(int node, const char *pname, char *value, int size)
                                          node, pname, value, P1275_SIZE(size));
 }
 
-__inline__ int
-prom_inst2pkg(int inst)
+inline int prom_inst2pkg(int inst)
 {
        int node;
        
similarity index 100%
rename from arch/i386/Kconfig.cpu
rename to arch/x86/Kconfig.cpu
similarity index 65%
rename from arch/i386/Kconfig.debug
rename to arch/x86/Kconfig.debug
index f03531e..970b2de 100644 (file)
@@ -1,14 +1,14 @@
 menu "Kernel hacking"
 
 config TRACE_IRQFLAGS_SUPPORT
-       bool
-       default y
+       def_bool y
 
 source "lib/Kconfig.debug"
 
 config EARLY_PRINTK
        bool "Early printk" if EMBEDDED && DEBUG_KERNEL
        default y
+       depends on X86_32
        help
          Write kernel log output directly into the VGA buffer or to a serial
          port.
@@ -37,10 +37,12 @@ config DEBUG_STACK_USAGE
 
 comment "Page alloc debug is incompatible with Software Suspend on i386"
        depends on DEBUG_KERNEL && HIBERNATION
+       depends on X86_32
 
 config DEBUG_PAGEALLOC
        bool "Debug page memory allocations"
        depends on DEBUG_KERNEL && !HIBERNATION && !HUGETLBFS
+       depends on X86_32
        help
          Unmap pages from the kernel linear mapping after free_pages().
          This results in a large slowdown, but helps to find certain types
@@ -59,6 +61,7 @@ config DEBUG_RODATA
 config 4KSTACKS
        bool "Use 4Kb for kernel stacks instead of 8Kb"
        depends on DEBUG_KERNEL
+       depends on X86_32
        help
          If you say Y here the kernel will use a 4Kb stacksize for the
          kernel stack attached to each process/thread. This facilitates
@@ -67,22 +70,50 @@ config 4KSTACKS
          will also use IRQ stacks to compensate for the reduced stackspace.
 
 config X86_FIND_SMP_CONFIG
-       bool
+       def_bool y
        depends on X86_LOCAL_APIC || X86_VOYAGER
-       default y
+       depends on X86_32
 
 config X86_MPPARSE
-       bool
+       def_bool y
        depends on X86_LOCAL_APIC && !X86_VISWS
-       default y
+       depends on X86_32
 
 config DOUBLEFAULT
        default y
        bool "Enable doublefault exception handler" if EMBEDDED
+       depends on X86_32
+       help
+         This option allows trapping of rare doublefault exceptions that
+         would otherwise cause a system to silently reboot. Disabling this
+         option saves about 4k and might cause you much additional grey
+         hair.
+
+config IOMMU_DEBUG
+       bool "Enable IOMMU debugging"
+       depends on IOMMU && DEBUG_KERNEL
+       depends on X86_64
        help
-          This option allows trapping of rare doublefault exceptions that
-          would otherwise cause a system to silently reboot. Disabling this
-          option saves about 4k and might cause you much additional grey
-          hair.
+         Force the IOMMU to on even when you have less than 4GB of
+         memory and add debugging code. On overflow always panic. And
+         allow to enable IOMMU leak tracing. Can be disabled at boot
+         time with iommu=noforce. This will also enable scatter gather
+         list merging.  Currently not recommended for production
+         code. When you use it make sure you have a big enough
+         IOMMU/AGP aperture.  Most of the options enabled by this can
+         be set more finegrained using the iommu= command line
+         options. See Documentation/x86_64/boot-options.txt for more
+         details.
+
+config IOMMU_LEAK
+       bool "IOMMU leak tracing"
+       depends on DEBUG_KERNEL
+       depends on IOMMU_DEBUG
+       help
+         Add a simple leak tracer to the IOMMU code. This is useful when you
+         are debugging a buggy device driver that leaks IOMMU mappings.
+
+#config X86_REMOTE_DEBUG
+#      bool "kgdb debugging stub"
 
 endmenu
similarity index 99%
rename from arch/i386/Kconfig
rename to arch/x86/Kconfig.i386
index b4437ce..7331efe 100644 (file)
@@ -287,7 +287,7 @@ config ES7000_CLUSTERED_APIC
        default y
        depends on SMP && X86_ES7000 && MPENTIUMIII
 
-source "arch/i386/Kconfig.cpu"
+source "arch/x86/Kconfig.cpu"
 
 config HPET_TIMER
        bool "HPET Timer Support"
@@ -1272,7 +1272,7 @@ source "fs/Kconfig"
 
 source "kernel/Kconfig.instrumentation"
 
-source "arch/i386/Kconfig.debug"
+source "arch/x86/Kconfig.debug"
 
 source "security/Kconfig"
 
similarity index 99%
rename from arch/x86_64/Kconfig
rename to arch/x86/Kconfig.x86_64
index 308970a..e2542e5 100644 (file)
@@ -835,7 +835,7 @@ source fs/Kconfig
 
 source "kernel/Kconfig.instrumentation"
 
-source "arch/x86_64/Kconfig.debug"
+source "arch/x86/Kconfig.debug"
 
 source "security/Kconfig"
 
diff --git a/arch/x86/Makefile b/arch/x86/Makefile
new file mode 100644 (file)
index 0000000..3095973
--- /dev/null
@@ -0,0 +1,16 @@
+# Unified Makefile for i386 and x86_64
+
+# select defconfig based on actual architecture
+KBUILD_DEFCONFIG := $(ARCH)_defconfig
+
+# # No need to remake these files
+$(srctree)/arch/x86/Makefile%: ;
+
+ifeq ($(ARCH),i386)
+        include $(srctree)/arch/x86/Makefile_32
+else
+        include $(srctree)/arch/x86/Makefile_64
+endif
+
+
+
similarity index 98%
rename from arch/i386/Makefile
rename to arch/x86/Makefile_32
index f5b9a37..346ac07 100644 (file)
@@ -1,5 +1,5 @@
 #
-# i386/Makefile
+# i386 Makefile
 #
 # This file is included by the global makefile so that you can add your own
 # architecture-specific flags and dependencies. Remember to do have actions
@@ -17,9 +17,6 @@
 # 20050320  Kianusch Sayah Karadji <kianusch@sk-tech.net>
 #           Added support for GEODE CPU
 
-# Fill in SRCARCH
-SRCARCH        := x86
-
 # BITS is used as extension for files which are available in a 32 bit
 # and a 64 bit version to simplify shared Makefiles.
 # e.g.: obj-y += foo_$(BITS).o
@@ -46,7 +43,7 @@ KBUILD_CFLAGS += -pipe -msoft-float -mregparm=3 -freg-struct-return
 KBUILD_CFLAGS += $(call cc-option,-mpreferred-stack-boundary=2)
 
 # CPU-specific tuning. Anything which can be shared with UML should go here.
-include $(srctree)/arch/i386/Makefile.cpu
+include $(srctree)/arch/x86/Makefile_32.cpu
 
 # temporary until string.h is fixed
 cflags-y += -ffreestanding
similarity index 99%
rename from arch/x86_64/Makefile
rename to arch/x86/Makefile_64
index 20eb69b..57e714a 100644 (file)
@@ -1,5 +1,5 @@
 #
-# x86_64/Makefile
+# x86_64 Makefile
 #
 # This file is included by the global makefile so that you can add your own
 # architecture-specific flags and dependencies. Remember to do have actions
@@ -21,9 +21,6 @@
 #
 # $Id: Makefile,v 1.31 2002/03/22 15:56:07 ak Exp $
 
-# Fill in SRCARCH
-SRCARCH        := x86
-
 # BITS is used as extension for files which are available in a 32 bit
 # and a 64 bit version to simplify shared Makefiles.
 # e.g.: obj-y += foo_$(BITS).o
index 5f9a2e7..d2b5adf 100644 (file)
@@ -17,6 +17,8 @@
 #ifndef BOOT_BOOT_H
 #define BOOT_BOOT_H
 
+#define STACK_SIZE     512     /* Minimum number of bytes for stack */
+
 #ifndef __ASSEMBLY__
 
 #include <stdarg.h>
@@ -198,8 +200,6 @@ static inline int isdigit(int ch)
 }
 
 /* Heap -- available for dynamic lists. */
-#define STACK_SIZE     512     /* Minimum number of bytes for stack */
-
 extern char _end[];
 extern char *HEAP;
 extern char *heap_end;
@@ -216,9 +216,9 @@ static inline char *__get_heap(size_t s, size_t a, size_t n)
 #define GET_HEAP(type, n) \
        ((type *)__get_heap(sizeof(type),__alignof__(type),(n)))
 
-static inline int heap_free(void)
+static inline bool heap_free(size_t n)
 {
-       return heap_end-HEAP;
+       return (int)(heap_end-HEAP) >= (int)n;
 }
 
 /* copy.S */
index a0ae2e7..036e635 100644 (file)
        .globl startup_32
 
 startup_32:
-       /* check to see if KEEP_SEGMENTS flag is meaningful */
-       cmpw $0x207, BP_version(%esi)
-       jb 1f
-
+       cld
        /* test KEEP_SEGMENTS flag to see if the bootloader is asking
         * us to not reload segments */
        testb $(1<<6), BP_loadflags(%esi)
-       jnz 2f
+       jnz 1f
 
-1:     cli
+       cli
        movl $(__BOOT_DS),%eax
        movl %eax,%ds
        movl %eax,%es
        movl %eax,%fs
        movl %eax,%gs
        movl %eax,%ss
-
-2:     cld
+1:
 
 /* Calculate the delta between where we were compiled to run
  * at and where we were actually loaded at.  This can only be done
index 4946764..1ccb38a 100644 (file)
@@ -29,6 +29,7 @@
 #include <asm/pgtable.h>
 #include <asm/page.h>
 #include <asm/msr.h>
+#include <asm/asm-offsets.h>
 
 .section ".text.head"
        .code32
 
 startup_32:
        cld
+       /* test KEEP_SEGMENTS flag to see if the bootloader is asking
+        * us to not reload segments */
+       testb $(1<<6), BP_loadflags(%esi)
+       jnz 1f
+
        cli
        movl    $(__KERNEL_DS), %eax
        movl    %eax, %ds
        movl    %eax, %es
        movl    %eax, %ss
+1:
 
 /* Calculate the delta between where we were compiled to run
  * at and where we were actually loaded at.  This can only be done
index 8353c81..6ef5a06 100644 (file)
@@ -173,7 +173,8 @@ ramdisk_size:       .long   0               # its size in bytes
 bootsect_kludge:
                .long   0               # obsolete
 
-heap_end_ptr:  .word   _end+1024       # (Header version 0x0201 or later)
+heap_end_ptr:  .word   _end+STACK_SIZE-512
+                                       # (Header version 0x0201 or later)
                                        # space from here (exclusive) down to
                                        # end of setup code can be used by setup
                                        # for local heap purposes.
@@ -230,28 +231,53 @@ start_of_setup:
        int     $0x13
 #endif
 
-# We will have entered with %cs = %ds+0x20, normalize %cs so
-# it is on par with the other segments.
-       pushw   %ds
-       pushw   $setup2
-       lretw
-
-setup2:
 # Force %es = %ds
        movw    %ds, %ax
        movw    %ax, %es
        cld
 
-# Stack paranoia: align the stack and make sure it is good
-# for both 16- and 32-bit references.  In particular, if we
-# were meant to have been using the full 16-bit segment, the
-# caller might have set %sp to zero, which breaks %esp-based
-# references.
-       andw    $~3, %sp        # dword align (might as well...)
-       jnz     1f
-       movw    $0xfffc, %sp    # Make sure we're not zero
-1:     movzwl  %sp, %esp       # Clear upper half of %esp
-       sti
+# Apparently some ancient versions of LILO invoked the kernel
+# with %ss != %ds, which happened to work by accident for the
+# old code.  If the CAN_USE_HEAP flag is set in loadflags, or
+# %ss != %ds, then adjust the stack pointer.
+
+       # Smallest possible stack we can tolerate
+       movw    $(_end+STACK_SIZE), %cx
+
+       movw    heap_end_ptr, %dx
+       addw    $512, %dx
+       jnc     1f
+       xorw    %dx, %dx        # Wraparound - whole segment available
+1:     testb   $CAN_USE_HEAP, loadflags
+       jnz     2f
+
+       # No CAN_USE_HEAP
+       movw    %ss, %dx
+       cmpw    %ax, %dx        # %ds == %ss?
+       movw    %sp, %dx
+       # If so, assume %sp is reasonably set, otherwise use
+       # the smallest possible stack.
+       jne     4f              # -> Smallest possible stack...
+
+       # Make sure the stack is at least minimum size.  Take a value
+       # of zero to mean "full segment."
+2:
+       andw    $~3, %dx        # dword align (might as well...)
+       jnz     3f
+       movw    $0xfffc, %dx    # Make sure we're not zero
+3:     cmpw    %cx, %dx
+       jnb     5f
+4:     movw    %cx, %dx        # Minimum value we can possibly use
+5:     movw    %ax, %ss
+       movzwl  %dx, %esp       # Clear upper half of %esp
+       sti                     # Now we should have a working stack
+
+# We will have entered with %cs = %ds+0x20, normalize %cs so
+# it is on par with the other segments.
+       pushw   %ds
+       pushw   $6f
+       lretw
+6:
 
 # Check signature at end of setup
        cmpl    $0x5a5aaa55, setup_sig
index 68e65d9..ed0672a 100644 (file)
@@ -79,7 +79,7 @@ static int bios_probe(void)
        video_bios.modes = GET_HEAP(struct mode_info, 0);
 
        for (mode = 0x14; mode <= 0x7f; mode++) {
-               if (heap_free() < sizeof(struct mode_info))
+               if (!heap_free(sizeof(struct mode_info)))
                        break;
 
                if (mode_defined(VIDEO_FIRST_BIOS+mode))
index 1921907..4716b9a 100644 (file)
@@ -57,7 +57,7 @@ static int vesa_probe(void)
        while ((mode = rdfs16(mode_ptr)) != 0xffff) {
                mode_ptr += 2;
 
-               if (heap_free() < sizeof(struct mode_info))
+               if (!heap_free(sizeof(struct mode_info)))
                        break;  /* Heap full, can't save mode info */
 
                if (mode & ~0x1ff)
index e4ba897..ad9712f 100644 (file)
@@ -371,7 +371,7 @@ static void save_screen(void)
        saved.curx = boot_params.screen_info.orig_x;
        saved.cury = boot_params.screen_info.orig_y;
 
-       if (heap_free() < saved.x*saved.y*sizeof(u16)+512)
+       if (!heap_free(saved.x*saved.y*sizeof(u16)+512))
                return;         /* Not enough heap to save the screen */
 
        saved.data = GET_HEAP(u16, saved.x*saved.y);
index 2ed0a4c..f63e5ff 100644 (file)
@@ -62,8 +62,7 @@ static void init_intel_pdc(struct acpi_processor *pr, struct cpuinfo_x86 *c)
 /* Initialize _PDC data based on the CPU vendor */
 void arch_acpi_processor_init_pdc(struct acpi_processor *pr)
 {
-       unsigned int cpu = pr->id;
-       struct cpuinfo_x86 *c = &cpu_data(cpu);
+       struct cpuinfo_x86 *c = &cpu_data(pr->id);
 
        pr->pdc = NULL;
        if (c->x86_vendor == X86_VENDOR_INTEL)
index 7e50bda..d1b6ed9 100644 (file)
 #include <asm/segment.h>
 #include <asm/thread_info.h>
 #include <asm/ia32.h>
+#include <asm/bootparam.h>
 
 #define DEFINE(sym, val) \
         asm volatile("\n->" #sym " %0 " #val : : "i" (val))
 
 #define BLANK() asm volatile("\n->" : : )
 
+#define OFFSET(sym, str, mem) \
+       DEFINE(sym, offsetof(struct str, mem))
+
 #define __NO_STUBS 1
 #undef __SYSCALL
 #undef _ASM_X86_64_UNISTD_H_
@@ -109,5 +113,11 @@ int main(void)
        DEFINE(crypto_tfm_ctx_offset, offsetof(struct crypto_tfm, __crt_ctx));
        BLANK();
        DEFINE(__NR_syscall_max, sizeof(syscalls) - 1);
+
+       BLANK();
+       OFFSET(BP_scratch, boot_params, scratch);
+       OFFSET(BP_loadflags, boot_params, hdr.loadflags);
+       OFFSET(BP_hardware_subarch, boot_params, hdr.hardware_subarch);
+       OFFSET(BP_version, boot_params, hdr.version);
        return 0;
 }
index dc34acb..639e632 100644 (file)
@@ -35,12 +35,14 @@ static void __init via_bugs(void)
 }
 
 #ifdef CONFIG_ACPI
+#ifdef CONFIG_X86_IO_APIC
 
 static int __init nvidia_hpet_check(struct acpi_table_header *header)
 {
        return 0;
 }
-#endif
+#endif /* CONFIG_X86_IO_APIC */
+#endif /* CONFIG_ACPI */
 
 static void __init nvidia_bugs(void)
 {
index 0d8577f..aa3d2c8 100644 (file)
@@ -233,6 +233,8 @@ NORET_TYPE void machine_kexec(struct kimage *image)
 
 void arch_crash_save_vmcoreinfo(void)
 {
+       VMCOREINFO_SYMBOL(init_level4_pgt);
+
 #ifdef CONFIG_ARCH_DISCONTIGMEM_ENABLE
        VMCOREINFO_SYMBOL(node_data);
        VMCOREINFO_LENGTH(node_data, MAX_NUMNODES);
index f321153..fcaa026 100644 (file)
@@ -708,10 +708,4 @@ struct smp_ops smp_ops = {
        .smp_send_reschedule = native_smp_send_reschedule,
        .smp_call_function_mask = native_smp_call_function_mask,
 };
-
-int smp_call_function_mask(cpumask_t mask, void (*func) (void *info),
-                          void *info, int wait)
-{
-       return smp_ops.smp_call_function_mask(mask, func, info, wait);
-}
-EXPORT_SYMBOL(smp_call_function_mask);
+EXPORT_SYMBOL_GPL(smp_ops);
index 361ac51..6937143 100644 (file)
 #include <asm/arch_hooks.h>
 
 /* TLB state -- visible externally, indexed physically */
-DEFINE_PER_CPU(struct tlb_state, cpu_tlbstate) ____cacheline_aligned = { &init_mm, 0 };
+DEFINE_PER_CPU_SHARED_ALIGNED(struct tlb_state, cpu_tlbstate) = { &init_mm, 0 };
 
 /* CPU IRQ affinity -- set to all ones initially */
 static unsigned long cpu_irq_affinity[NR_CPUS] __cacheline_aligned = { [0 ... NR_CPUS-1]  = ~0UL };
 
 /* per CPU data structure (for /proc/cpuinfo et al), visible externally
  * indexed physically */
-DEFINE_PER_CPU(cpuinfo_x86, cpu_info) __cacheline_aligned;
+DEFINE_PER_CPU_SHARED_ALIGNED(struct cpuinfo_x86, cpu_info);
 EXPORT_PER_CPU_SYMBOL(cpu_info);
 
 /* physical ID of the CPU used to boot the system */
diff --git a/arch/x86_64/.gitignore b/arch/x86_64/.gitignore
deleted file mode 100644 (file)
index 36ef4c3..0000000
+++ /dev/null
@@ -1 +0,0 @@
-boot
diff --git a/arch/x86_64/Kconfig.debug b/arch/x86_64/Kconfig.debug
deleted file mode 100644 (file)
index 775d211..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-menu "Kernel hacking"
-
-config TRACE_IRQFLAGS_SUPPORT
-       bool
-       default y
-
-source "lib/Kconfig.debug"
-
-config DEBUG_RODATA
-       bool "Write protect kernel read-only data structures"
-       depends on DEBUG_KERNEL
-       help
-        Mark the kernel read-only data as write-protected in the pagetables,
-        in order to catch accidental (and incorrect) writes to such const data.
-        This option may have a slight performance impact because a portion
-        of the kernel code won't be covered by a 2MB TLB anymore.
-        If in doubt, say "N".
-
-config IOMMU_DEBUG
-       depends on IOMMU && DEBUG_KERNEL
-       bool "Enable IOMMU debugging"
-       help
-         Force the IOMMU to on even when you have less than 4GB of
-        memory and add debugging code. On overflow always panic. And
-        allow to enable IOMMU leak tracing. Can be disabled at boot
-        time with iommu=noforce. This will also enable scatter gather
-        list merging.  Currently not recommended for production
-        code. When you use it make sure you have a big enough
-        IOMMU/AGP aperture.  Most of the options enabled by this can
-        be set more finegrained using the iommu= command line
-        options. See Documentation/x86_64/boot-options.txt for more
-        details.
-
-config IOMMU_LEAK
-       bool "IOMMU leak tracing"
-       depends on DEBUG_KERNEL
-       depends on IOMMU_DEBUG
-       help
-         Add a simple leak tracer to the IOMMU code. This is useful when you
-        are debugging a buggy device driver that leaks IOMMU mappings.
-
-config DEBUG_STACKOVERFLOW
-        bool "Check for stack overflows"
-        depends on DEBUG_KERNEL
-        help
-         This option will cause messages to be printed if free stack space
-         drops below a certain limit.
-
-config DEBUG_STACK_USAGE
-        bool "Stack utilization instrumentation"
-        depends on DEBUG_KERNEL
-        help
-         Enables the display of the minimum amount of free stack which each
-         task has ever had available in the sysrq-T and sysrq-P debug output.
-
-         This option will slow down process creation somewhat.
-
-#config X86_REMOTE_DEBUG
-#       bool "kgdb debugging stub"
-
-endmenu
index c457bdb..24141fb 100644 (file)
@@ -572,9 +572,11 @@ static int test_hash_jiffies_digest(struct hash_desc *desc, char *p, int blen,
        int bcount;
        int ret;
 
+       sg_init_table(sg, 1);
+
        for (start = jiffies, end = start + sec * HZ, bcount = 0;
             time_before(jiffies, end); bcount++) {
-               sg_init_one(sg, p, blen);
+               sg_set_buf(sg, p, blen);
                ret = crypto_hash_digest(desc, sg, blen, out);
                if (ret)
                        return ret;
@@ -597,13 +599,15 @@ static int test_hash_jiffies(struct hash_desc *desc, char *p, int blen,
        if (plen == blen)
                return test_hash_jiffies_digest(desc, p, blen, out, sec);
 
+       sg_init_table(sg, 1);
+
        for (start = jiffies, end = start + sec * HZ, bcount = 0;
             time_before(jiffies, end); bcount++) {
                ret = crypto_hash_init(desc);
                if (ret)
                        return ret;
                for (pcount = 0; pcount < blen; pcount += plen) {
-                       sg_init_one(sg, p + pcount, plen);
+                       sg_set_buf(sg, p + pcount, plen);
                        ret = crypto_hash_update(desc, sg, plen);
                        if (ret)
                                return ret;
@@ -628,12 +632,14 @@ static int test_hash_cycles_digest(struct hash_desc *desc, char *p, int blen,
        int i;
        int ret;
 
+       sg_init_table(sg, 1);
+
        local_bh_disable();
        local_irq_disable();
 
        /* Warm-up run. */
        for (i = 0; i < 4; i++) {
-               sg_init_one(sg, p, blen);
+               sg_set_buf(sg, p, blen);
                ret = crypto_hash_digest(desc, sg, blen, out);
                if (ret)
                        goto out;
@@ -645,7 +651,7 @@ static int test_hash_cycles_digest(struct hash_desc *desc, char *p, int blen,
 
                start = get_cycles();
 
-               sg_init_one(sg, p, blen);
+               sg_set_buf(sg, p, blen);
                ret = crypto_hash_digest(desc, sg, blen, out);
                if (ret)
                        goto out;
@@ -679,6 +685,8 @@ static int test_hash_cycles(struct hash_desc *desc, char *p, int blen,
        if (plen == blen)
                return test_hash_cycles_digest(desc, p, blen, out);
 
+       sg_init_table(sg, 1);
+
        local_bh_disable();
        local_irq_disable();
 
@@ -688,7 +696,7 @@ static int test_hash_cycles(struct hash_desc *desc, char *p, int blen,
                if (ret)
                        goto out;
                for (pcount = 0; pcount < blen; pcount += plen) {
-                       sg_init_one(sg, p + pcount, plen);
+                       sg_set_buf(sg, p + pcount, plen);
                        ret = crypto_hash_update(desc, sg, plen);
                        if (ret)
                                goto out;
@@ -708,7 +716,7 @@ static int test_hash_cycles(struct hash_desc *desc, char *p, int blen,
                if (ret)
                        goto out;
                for (pcount = 0; pcount < blen; pcount += plen) {
-                       sg_init_one(sg, p + pcount, plen);
+                       sg_set_buf(sg, p + pcount, plen);
                        ret = crypto_hash_update(desc, sg, plen);
                        if (ret)
                                goto out;
index 4e8de16..c666b4e 100644 (file)
@@ -55,7 +55,7 @@ static void padlock_sha_bypass(struct crypto_tfm *tfm)
        if (ctx(tfm)->data && ctx(tfm)->used) {
                struct scatterlist sg;
 
-               sg_set_buf(&sg, ctx(tfm)->data, ctx(tfm)->used);
+               sg_init_one(&sg, ctx(tfm)->data, ctx(tfm)->used);
                crypto_hash_update(&ctx(tfm)->fallback, &sg, sg.length);
        }
 
@@ -79,7 +79,7 @@ static void padlock_sha_update(struct crypto_tfm *tfm,
 
        if (unlikely(ctx(tfm)->bypass)) {
                struct scatterlist sg;
-               sg_set_buf(&sg, (uint8_t *)data, length);
+               sg_init_one(&sg, (uint8_t *)data, length);
                crypto_hash_update(&ctx(tfm)->fallback, &sg, length);
                return;
        }
index 410a0d1..93f71fc 100644 (file)
@@ -316,13 +316,13 @@ static int icside_dma_end(ide_drive_t *drive)
 
        drive->waiting_for_dma = 0;
 
-       disable_dma(state->dev->dma);
+       disable_dma(ECARD_DEV(state->dev)->dma);
 
        /* Teardown mappings after DMA has completed. */
        dma_unmap_sg(state->dev, hwif->sg_table, hwif->sg_nents,
                     hwif->sg_dma_direction);
 
-       return get_dma_residue(state->dev->dma) != 0;
+       return get_dma_residue(ECARD_DEV(state->dev)->dma) != 0;
 }
 
 static void icside_dma_start(ide_drive_t *drive)
@@ -331,8 +331,8 @@ static void icside_dma_start(ide_drive_t *drive)
        struct icside_state *state = hwif->hwif_data;
 
        /* We can not enable DMA on both channels simultaneously. */
-       BUG_ON(dma_channel_active(state->dev->dma));
-       enable_dma(state->dev->dma);
+       BUG_ON(dma_channel_active(ECARD_DEV(state->dev)->dma));
+       enable_dma(ECARD_DEV(state->dev)->dma);
 }
 
 static int icside_dma_setup(ide_drive_t *drive)
@@ -350,7 +350,7 @@ static int icside_dma_setup(ide_drive_t *drive)
        /*
         * We can not enable DMA on both channels.
         */
-       BUG_ON(dma_channel_active(state->dev->dma));
+       BUG_ON(dma_channel_active(ECARD_DEV(state->dev)->dma));
 
        icside_build_sglist(drive, rq);
 
@@ -367,14 +367,14 @@ static int icside_dma_setup(ide_drive_t *drive)
        /*
         * Select the correct timing for this drive.
         */
-       set_dma_speed(state->dev->dma, drive->drive_data);
+       set_dma_speed(ECARD_DEV(state->dev)->dma, drive->drive_data);
 
        /*
         * Tell the DMA engine about the SG table and
         * data direction.
         */
-       set_dma_sg(state->dev->dma, hwif->sg_table, hwif->sg_nents);
-       set_dma_mode(state->dev->dma, dma_mode);
+       set_dma_sg(ECARD_DEV(state->dev)->dma, hwif->sg_table, hwif->sg_nents);
+       set_dma_mode(ECARD_DEV(state->dev)->dma, dma_mode);
 
        drive->waiting_for_dma = 1;
 
index 1c159ac..28c6ae0 100644 (file)
@@ -168,7 +168,7 @@ static int crypt_iv_essiv_ctr(struct crypt_config *cc, struct dm_target *ti,
                return -ENOMEM;
        }
 
-       sg_set_buf(&sg, cc->key, cc->key_size);
+       sg_init_one(&sg, cc->key, cc->key_size);
        desc.tfm = hash_tfm;
        desc.flags = CRYPTO_TFM_REQ_MAY_SLEEP;
        err = crypto_hash_digest(&desc, &sg, cc->key_size, salt);
index bf4bc6a..7471d49 100644 (file)
@@ -267,15 +267,26 @@ mmc_send_cxd_data(struct mmc_card *card, struct mmc_host *host,
 
 int mmc_send_csd(struct mmc_card *card, u32 *csd)
 {
+       int ret, i;
+
        if (!mmc_host_is_spi(card->host))
                return mmc_send_cxd_native(card->host, card->rca << 16,
                                csd, MMC_SEND_CSD);
 
-       return mmc_send_cxd_data(card, card->host, MMC_SEND_CSD, csd, 16);
+       ret = mmc_send_cxd_data(card, card->host, MMC_SEND_CSD, csd, 16);
+       if (ret)
+               return ret;
+
+       for (i = 0;i < 4;i++)
+               csd[i] = be32_to_cpu(csd[i]);
+
+       return 0;
 }
 
 int mmc_send_cid(struct mmc_host *host, u32 *cid)
 {
+       int ret, i;
+
        if (!mmc_host_is_spi(host)) {
                if (!host->card)
                        return -EINVAL;
@@ -283,7 +294,14 @@ int mmc_send_cid(struct mmc_host *host, u32 *cid)
                                cid, MMC_SEND_CID);
        }
 
-       return mmc_send_cxd_data(NULL, host, MMC_SEND_CID, cid, 16);
+       ret = mmc_send_cxd_data(NULL, host, MMC_SEND_CID, cid, 16);
+       if (ret)
+               return ret;
+
+       for (i = 0;i < 4;i++)
+               cid[i] = be32_to_cpu(cid[i]);
+
+       return 0;
 }
 
 int mmc_send_ext_csd(struct mmc_card *card, u8 *ext_csd)
index ee4029a..a6dafe6 100644 (file)
@@ -294,8 +294,8 @@ int mmc_app_send_scr(struct mmc_card *card, u32 *scr)
        if (data.error)
                return data.error;
 
-       scr[0] = ntohl(scr[0]);
-       scr[1] = ntohl(scr[1]);
+       scr[0] = be32_to_cpu(scr[0]);
+       scr[1] = be32_to_cpu(scr[1]);
 
        return 0;
 }
index c77fadc..c3926eb 100644 (file)
@@ -40,7 +40,7 @@
 #include <linux/mm.h>
 #include <linux/interrupt.h>
 #include <linux/dma-mapping.h>
-#include <scatterlist/scatterlist.h>
+#include <linux/scatterlist.h>
 
 #include <linux/mmc/host.h>
 #include <asm/io.h>
@@ -212,12 +212,12 @@ static int au1xmmc_send_command(struct au1xmmc_host *host, int wait,
        }
 
        if (data) {
-               if (flags & MMC_DATA_READ) {
+               if (data->flags & MMC_DATA_READ) {
                        if (data->blocks > 1)
                                mmccmd |= SD_CMD_CT_4;
                        else
                                mmccmd |= SD_CMD_CT_2;
-               } else if (flags & MMC_DATA_WRITE) {
+               } else if (data->flags & MMC_DATA_WRITE) {
                        if (data->blocks > 1)
                                mmccmd |= SD_CMD_CT_3;
                        else
index 12c2d80..a646921 100644 (file)
@@ -1165,6 +1165,23 @@ mmc_spi_detect_irq(int irq, void *mmc)
        return IRQ_HANDLED;
 }
 
+struct count_children {
+       unsigned        n;
+       struct bus_type *bus;
+};
+
+static int maybe_count_child(struct device *dev, void *c)
+{
+       struct count_children *ccp = c;
+
+       if (dev->bus == ccp->bus) {
+               if (ccp->n)
+                       return -EBUSY;
+               ccp->n++;
+       }
+       return 0;
+}
+
 static int mmc_spi_probe(struct spi_device *spi)
 {
        void                    *ones;
@@ -1188,33 +1205,30 @@ static int mmc_spi_probe(struct spi_device *spi)
                return status;
        }
 
-       /* We can use the bus safely iff nobody else will interfere with
-        * us.  That is, either we have the experimental exclusive access
-        * primitives ... or else there's nobody to share it with.
+       /* We can use the bus safely iff nobody else will interfere with us.
+        * Most commands consist of one SPI message to issue a command, then
+        * several more to collect its response, then possibly more for data
+        * transfer.  Clocking access to other devices during that period will
+        * corrupt the command execution.
+        *
+        * Until we have software primitives which guarantee non-interference,
+        * we'll aim for a hardware-level guarantee.
+        *
+        * REVISIT we can't guarantee another device won't be added later...
         */
        if (spi->master->num_chipselect > 1) {
-               struct device   *parent = spi->dev.parent;
+               struct count_children cc;
 
-               /* If there are multiple devices on this bus, we
-                * can't proceed.
-                */
-               spin_lock(&parent->klist_children.k_lock);
-               if (parent->klist_children.k_list.next
-                               != parent->klist_children.k_list.prev)
-                       status = -EMLINK;
-               else
-                       status = 0;
-               spin_unlock(&parent->klist_children.k_lock);
+               cc.n = 0;
+               cc.bus = spi->dev.bus;
+               status = device_for_each_child(spi->dev.parent, &cc,
+                               maybe_count_child);
                if (status < 0) {
                        dev_err(&spi->dev, "can't share SPI bus\n");
                        return status;
                }
 
-               /* REVISIT we can't guarantee another device won't
-                * be added later.  It's uncommon though ... for now,
-                * work as if this is safe.
-                */
-               dev_warn(&spi->dev, "ASSUMING unshared SPI bus!\n");
+               dev_warn(&spi->dev, "ASSUMING SPI bus stays unshared!\n");
        }
 
        /* We need a supply of ones to transmit.  This is the only time
index 662b8d1..45f30a2 100644 (file)
@@ -284,7 +284,7 @@ static __net_exit void loopback_net_exit(struct net *net)
        unregister_netdev(dev);
 }
 
-static struct pernet_operations __net_initdata loopback_net_ops = {
+static struct pernet_operations loopback_net_ops = {
        .init = loopback_net_init,
        .exit = loopback_net_exit,
 };
index bcb0885..b35d794 100644 (file)
@@ -68,7 +68,7 @@ MODULE_VERSION("1.0.2");
 static unsigned int
 setup_sg(struct scatterlist *sg, const void *address, unsigned int length)
 {
-       sg_init_one(sg, address, length);
+       sg_set_buf(sg, address, length);
        return length;
 }
 
@@ -140,6 +140,8 @@ static void get_new_key_from_sha(struct ppp_mppe_state * state)
        struct scatterlist sg[4];
        unsigned int nbytes;
 
+       sg_init_table(sg, 4);
+
        nbytes = setup_sg(&sg[0], state->master_key, state->keylen);
        nbytes += setup_sg(&sg[1], sha_pad->sha_pad1,
                           sizeof(sha_pad->sha_pad1));
@@ -166,6 +168,8 @@ static void mppe_rekey(struct ppp_mppe_state * state, int initial_key)
        if (!initial_key) {
                crypto_blkcipher_setkey(state->arc4, state->sha1_digest,
                                        state->keylen);
+               sg_init_table(sg_in, 1);
+               sg_init_table(sg_out, 1);
                setup_sg(sg_in, state->sha1_digest, state->keylen);
                setup_sg(sg_out, state->session_key, state->keylen);
                if (crypto_blkcipher_encrypt(&desc, sg_out, sg_in,
@@ -421,6 +425,8 @@ mppe_compress(void *arg, unsigned char *ibuf, unsigned char *obuf,
        isize -= 2;
 
        /* Encrypt packet */
+       sg_init_table(sg_in, 1);
+       sg_init_table(sg_out, 1);
        setup_sg(sg_in, ibuf, isize);
        setup_sg(sg_out, obuf, osize);
        if (crypto_blkcipher_encrypt(&desc, sg_out, sg_in, isize) != 0) {
@@ -608,6 +614,8 @@ mppe_decompress(void *arg, unsigned char *ibuf, int isize, unsigned char *obuf,
         * Decrypt the first byte in order to check if it is
         * a compressed or uncompressed protocol field.
         */
+       sg_init_table(sg_in, 1);
+       sg_init_table(sg_out, 1);
        setup_sg(sg_in, ibuf, 1);
        setup_sg(sg_out, obuf, 1);
        if (crypto_blkcipher_decrypt(&desc, sg_out, sg_in, 1) != 0) {
index 097a136..4bcf916 100644 (file)
@@ -674,9 +674,8 @@ partial_sg_digest_update(struct hash_desc *desc, struct scatterlist *sg,
 {
        struct scatterlist temp;
 
-       memcpy(&temp, sg, sizeof(struct scatterlist));
-       temp.offset = offset;
-       temp.length = length;
+       sg_init_table(&temp, 1);
+       sg_set_page(&temp, sg_page(sg), length, offset);
        crypto_hash_update(desc, &temp, length);
 }
 
index f99cb77..f7e2d5a 100644 (file)
@@ -2509,8 +2509,7 @@ static int cirrusfb_zorro_register(struct zorro_dev *z,
        cinfo = info->par;
        cinfo->btype = btype;
 
-       assert(z > 0);
-       assert(z2 >= 0);
+       assert(z);
        assert(btype != BT_NONE);
 
        cinfo->zdev = z;
index 7a472b1..9d70289 100644 (file)
@@ -279,6 +279,8 @@ int virt_to_scatterlist(const void *addr, int size, struct scatterlist *sg,
        int offset;
        int remainder_of_page;
 
+       sg_init_table(sg, sg_size);
+
        while (size > 0 && i < sg_size) {
                pg = virt_to_page(addr);
                offset = offset_in_page(addr);
index 9728614..77fc583 100644 (file)
@@ -372,7 +372,7 @@ int jffs2_init_acl_post(struct inode *inode)
                        return rc;
        }
 
-       return rc;
+       return 0;
 }
 
 void jffs2_clear_acl(struct jffs2_inode_info *f)
index 4edaad0..749def0 100644 (file)
@@ -185,7 +185,7 @@ static __net_exit void proc_net_ns_exit(struct net *net)
        kfree(net->proc_net_root);
 }
 
-static struct pernet_operations __net_initdata proc_net_ns_ops = {
+static struct pernet_operations proc_net_ns_ops = {
        .init = proc_net_ns_init,
        .exit = proc_net_ns_exit,
 };
index bdca541..3328950 100644 (file)
@@ -1,6 +1,6 @@
 /* atomic.h: These still suck, but the I-cache hit rate is higher.
  *
- * Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu)
+ * Copyright (C) 1996 David S. Miller (davem@davemloft.net)
  * Copyright (C) 2000 Anton Blanchard (anton@linuxcare.com.au)
  * Copyright (C) 2007 Kyle McMartin (kyle@parisc-linux.org)
  *
@@ -33,7 +33,7 @@ extern void __cmpxchg_called_with_bad_pointer(void);
 extern unsigned long __cmpxchg_u32(volatile u32 *m, u32 old, u32 new_);
 
 /* don't worry...optimizer will get rid of most of this */
-static __inline__ unsigned long
+static inline unsigned long
 __cmpxchg(volatile void *ptr, unsigned long old, unsigned long new_, int size)
 {
        switch(size) {
index 407b361..959d6c8 100644 (file)
@@ -1,7 +1,6 @@
-/* $Id: dma.h,v 1.35 1999/12/27 06:37:09 anton Exp $
- * include/asm-sparc/dma.h
+/* include/asm-sparc/dma.h
  *
- * Copyright 1995 (C) David S. Miller (davem@caip.rutgers.edu)
+ * Copyright 1995 (C) David S. Miller (davem@davemloft.net)
  */
 
 #ifndef _ASM_SPARC_DMA_H
 struct page;
 extern spinlock_t  dma_spin_lock;
 
-static __inline__ unsigned long claim_dma_lock(void)
+static inline unsigned long claim_dma_lock(void)
 {
        unsigned long flags;
        spin_lock_irqsave(&dma_spin_lock, flags);
        return flags;
 }
 
-static __inline__ void release_dma_lock(unsigned long flags)
+static inline void release_dma_lock(unsigned long flags)
 {
        spin_unlock_irqrestore(&dma_spin_lock, flags);
 }
index 5da1eef..dbe7a58 100644 (file)
@@ -1,6 +1,6 @@
 /* asm-sparc/floppy.h: Sparc specific parts of the Floppy driver.
  *
- * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
+ * Copyright (C) 1995 David S. Miller (davem@davemloft.net)
  */
 
 #ifndef __ASM_SPARC_FLOPPY_H
@@ -232,12 +232,12 @@ extern char *pdma_base;
 extern unsigned long pdma_areasize;
 
 /* Common routines to all controller types on the Sparc. */
-static __inline__ void virtual_dma_init(void)
+static inline void virtual_dma_init(void)
 {
        /* nothing... */
 }
 
-static __inline__ void sun_fd_disable_dma(void)
+static inline void sun_fd_disable_dma(void)
 {
        doing_pdma = 0;
        if (pdma_base) {
@@ -246,7 +246,7 @@ static __inline__ void sun_fd_disable_dma(void)
        }
 }
 
-static __inline__ void sun_fd_set_dma_mode(int mode)
+static inline void sun_fd_set_dma_mode(int mode)
 {
        switch(mode) {
        case DMA_MODE_READ:
@@ -261,17 +261,17 @@ static __inline__ void sun_fd_set_dma_mode(int mode)
        }
 }
 
-static __inline__ void sun_fd_set_dma_addr(char *buffer)
+static inline void sun_fd_set_dma_addr(char *buffer)
 {
        pdma_vaddr = buffer;
 }
 
-static __inline__ void sun_fd_set_dma_count(int length)
+static inline void sun_fd_set_dma_count(int length)
 {
        pdma_size = length;
 }
 
-static __inline__ void sun_fd_enable_dma(void)
+static inline void sun_fd_enable_dma(void)
 {
        pdma_vaddr = mmu_lockarea(pdma_vaddr, pdma_size);
        pdma_base = pdma_vaddr;
index 4040227..4076cb5 100644 (file)
@@ -1,7 +1,6 @@
-/* $Id: ide.h,v 1.7 2002/01/16 20:58:40 davem Exp $
- * ide.h: SPARC PCI specific IDE glue.
+/* ide.h: SPARC PCI specific IDE glue.
  *
- * Copyright (C) 1997  David S. Miller (davem@caip.rutgers.edu)
+ * Copyright (C) 1997  David S. Miller (davem@davemloft.net)
  * Copyright (C) 1998  Eddie C. Dost   (ecd@skynet.be)
  * Adaptation from sparc64 version to sparc by Pete Zaitcev.
  */
@@ -31,7 +30,7 @@
 #define __ide_mm_outsw __ide_outsw
 #define __ide_mm_outsl __ide_outsl
 
-static __inline__ void __ide_insw(unsigned long port,
+static inline void __ide_insw(unsigned long port,
                                  void *dst,
                                  unsigned long count)
 {
@@ -62,7 +61,7 @@ static __inline__ void __ide_insw(unsigned long port,
        /* __flush_dcache_range((unsigned long)dst, end); */ /* P3 see hme */
 }
 
-static __inline__ void __ide_outsw(unsigned long port,
+static inline void __ide_outsw(unsigned long port,
                                   const void *src,
                                   unsigned long count)
 {
index 9ef1b3d..62c8fa7 100644 (file)
@@ -49,7 +49,7 @@ typedef struct {
 #if defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2)
 
 #undef __FD_SET
-static __inline__ void __FD_SET(unsigned long fd, __kernel_fd_set *fdsetp)
+static inline void __FD_SET(unsigned long fd, __kernel_fd_set *fdsetp)
 {
        unsigned long _tmp = fd / __NFDBITS;
        unsigned long _rem = fd % __NFDBITS;
@@ -57,7 +57,7 @@ static __inline__ void __FD_SET(unsigned long fd, __kernel_fd_set *fdsetp)
 }
 
 #undef __FD_CLR
-static __inline__ void __FD_CLR(unsigned long fd, __kernel_fd_set *fdsetp)
+static inline void __FD_CLR(unsigned long fd, __kernel_fd_set *fdsetp)
 {
        unsigned long _tmp = fd / __NFDBITS;
        unsigned long _rem = fd % __NFDBITS;
@@ -65,7 +65,7 @@ static __inline__ void __FD_CLR(unsigned long fd, __kernel_fd_set *fdsetp)
 }
 
 #undef __FD_ISSET
-static __inline__ int __FD_ISSET(unsigned long fd, __const__ __kernel_fd_set *p)
+static inline int __FD_ISSET(unsigned long fd, __const__ __kernel_fd_set *p)
 { 
        unsigned long _tmp = fd / __NFDBITS;
        unsigned long _rem = fd % __NFDBITS;
@@ -77,7 +77,7 @@ static __inline__ int __FD_ISSET(unsigned long fd, __const__ __kernel_fd_set *p)
  * for 256 and 1024-bit fd_sets respectively)
  */
 #undef __FD_ZERO
-static __inline__ void __FD_ZERO(__kernel_fd_set *p)
+static inline void __FD_ZERO(__kernel_fd_set *p)
 {
        unsigned long *tmp = p->fds_bits;
        int i;
index 8c259de..2655d14 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id: system.h,v 1.86 2001/10/30 04:57:10 davem Exp $ */
-
 #ifndef __SPARC_SYSTEM_H
 #define __SPARC_SYSTEM_H
 
@@ -56,7 +54,7 @@ extern void sun_do_break(void);
 extern int serial_console;
 extern int stop_a_enabled;
 
-static __inline__ int con_is_present(void)
+static inline int con_is_present(void)
 {
        return serial_console ? 0 : 1;
 }
@@ -217,7 +215,7 @@ static inline unsigned long xchg_u32(__volatile__ unsigned long *m, unsigned lon
 
 extern void __xchg_called_with_bad_pointer(void);
 
-static __inline__ unsigned long __xchg(unsigned long x, __volatile__ void * ptr, int size)
+static inline unsigned long __xchg(unsigned long x, __volatile__ void * ptr, int size)
 {
        switch (size) {
        case 4:
index 3fb4e1f..2c71ec4 100644 (file)
@@ -1,5 +1,4 @@
-/* $Id: atomic.h,v 1.22 2001/07/11 23:56:07 davem Exp $
- * atomic.h: Thankfully the V9 is at least reasonable for this
+/* atomic.h: Thankfully the V9 is at least reasonable for this
  *           stuff.
  *
  * Copyright (C) 1996, 1997, 2000 David S. Miller (davem@redhat.com)
@@ -74,7 +73,7 @@ extern int atomic64_sub_ret(int, atomic64_t *);
 #define atomic_cmpxchg(v, o, n) (cmpxchg(&((v)->counter), (o), (n)))
 #define atomic_xchg(v, new) (xchg(&((v)->counter), new))
 
-static __inline__ int atomic_add_unless(atomic_t *v, int a, int u)
+static inline int atomic_add_unless(atomic_t *v, int a, int u)
 {
        int c, old;
        c = atomic_read(v);
@@ -95,7 +94,7 @@ static __inline__ int atomic_add_unless(atomic_t *v, int a, int u)
        ((__typeof__((v)->counter))cmpxchg(&((v)->counter), (o), (n)))
 #define atomic64_xchg(v, new) (xchg(&((v)->counter), new))
 
-static __inline__ int atomic64_add_unless(atomic64_t *v, long a, long u)
+static inline int atomic64_add_unless(atomic64_t *v, long a, long u)
 {
        long c, old;
        c = atomic64_read(v);
index 0e32f8b..dadd6c3 100644 (file)
@@ -21,7 +21,9 @@
 #else
 
 #define BACKOFF_SETUP(reg)
-#define BACKOFF_SPIN(reg, tmp, label)
+#define BACKOFF_SPIN(reg, tmp, label) \
+       ba,pt   %xcc, label; \
+        nop;
 
 #endif
 
index c69b08a..3943022 100644 (file)
@@ -1,4 +1,3 @@
-/* $Id: byteorder.h,v 1.8 1997/12/18 02:44:14 ecd Exp $ */
 #ifndef _SPARC64_BYTEORDER_H
 #define _SPARC64_BYTEORDER_H
 
@@ -7,7 +6,7 @@
 
 #ifdef __GNUC__
 
-static __inline__ __u16 ___arch__swab16p(const __u16 *addr)
+static inline __u16 ___arch__swab16p(const __u16 *addr)
 {
        __u16 ret;
 
@@ -17,7 +16,7 @@ static __inline__ __u16 ___arch__swab16p(const __u16 *addr)
        return ret;
 }
 
-static __inline__ __u32 ___arch__swab32p(const __u32 *addr)
+static inline __u32 ___arch__swab32p(const __u32 *addr)
 {
        __u32 ret;
 
@@ -27,7 +26,7 @@ static __inline__ __u32 ___arch__swab32p(const __u32 *addr)
        return ret;
 }
 
-static __inline__ __u64 ___arch__swab64p(const __u64 *addr)
+static inline __u64 ___arch__swab64p(const __u64 *addr)
 {
        __u64 ret;
 
index d583e5e..cc463fe 100644 (file)
@@ -16,7 +16,7 @@ struct fpustate {
 
 #define FPUSTATE (struct fpustate *)(current_thread_info()->fpregs)
 
-static __inline__ unsigned long fprs_read(void)
+static inline unsigned long fprs_read(void)
 {
        unsigned long retval;
 
@@ -25,7 +25,7 @@ static __inline__ unsigned long fprs_read(void)
        return retval;
 }
 
-static __inline__ void fprs_write(unsigned long val)
+static inline void fprs_write(unsigned long val)
 {
        __asm__ __volatile__("wr %0, 0x0, %%fprs" : : "r" (val));
 }
index cd7ef30..c299b85 100644 (file)
@@ -1,4 +1,3 @@
-/* $Id: io.h,v 1.47 2001/12/13 10:36:02 davem Exp $ */
 #ifndef __SPARC64_IO_H
 #define __SPARC64_IO_H
 
@@ -19,7 +18,7 @@ extern unsigned long kern_base, kern_size;
 #define page_to_phys(page)     (page_to_pfn(page) << PAGE_SHIFT)
 #define BIO_VMERGE_BOUNDARY    8192
 
-static __inline__ u8 _inb(unsigned long addr)
+static inline u8 _inb(unsigned long addr)
 {
        u8 ret;
 
@@ -30,7 +29,7 @@ static __inline__ u8 _inb(unsigned long addr)
        return ret;
 }
 
-static __inline__ u16 _inw(unsigned long addr)
+static inline u16 _inw(unsigned long addr)
 {
        u16 ret;
 
@@ -41,7 +40,7 @@ static __inline__ u16 _inw(unsigned long addr)
        return ret;
 }
 
-static __inline__ u32 _inl(unsigned long addr)
+static inline u32 _inl(unsigned long addr)
 {
        u32 ret;
 
@@ -52,21 +51,21 @@ static __inline__ u32 _inl(unsigned long addr)
        return ret;
 }
 
-static __inline__ void _outb(u8 b, unsigned long addr)
+static inline void _outb(u8 b, unsigned long addr)
 {
        __asm__ __volatile__("stba\t%r0, [%1] %2\t/* pci_outb */"
                             : /* no outputs */
                             : "Jr" (b), "r" (addr), "i" (ASI_PHYS_BYPASS_EC_E_L));
 }
 
-static __inline__ void _outw(u16 w, unsigned long addr)
+static inline void _outw(u16 w, unsigned long addr)
 {
        __asm__ __volatile__("stha\t%r0, [%1] %2\t/* pci_outw */"
                             : /* no outputs */
                             : "Jr" (w), "r" (addr), "i" (ASI_PHYS_BYPASS_EC_E_L));
 }
 
-static __inline__ void _outl(u32 l, unsigned long addr)
+static inline void _outl(u32 l, unsigned long addr)
 {
        __asm__ __volatile__("stwa\t%r0, [%1] %2\t/* pci_outl */"
                             : /* no outputs */
@@ -205,7 +204,7 @@ static inline void _writeq(u64 q, volatile void __iomem *addr)
 #define writeq(__q, __addr)    _writeq(__q, __addr)
 
 /* Now versions without byte-swapping. */
-static __inline__ u8 _raw_readb(unsigned long addr)
+static inline u8 _raw_readb(unsigned long addr)
 {
        u8 ret;
 
@@ -216,7 +215,7 @@ static __inline__ u8 _raw_readb(unsigned long addr)
        return ret;
 }
 
-static __inline__ u16 _raw_readw(unsigned long addr)
+static inline u16 _raw_readw(unsigned long addr)
 {
        u16 ret;
 
@@ -227,7 +226,7 @@ static __inline__ u16 _raw_readw(unsigned long addr)
        return ret;
 }
 
-static __inline__ u32 _raw_readl(unsigned long addr)
+static inline u32 _raw_readl(unsigned long addr)
 {
        u32 ret;
 
@@ -238,7 +237,7 @@ static __inline__ u32 _raw_readl(unsigned long addr)
        return ret;
 }
 
-static __inline__ u64 _raw_readq(unsigned long addr)
+static inline u64 _raw_readq(unsigned long addr)
 {
        u64 ret;
 
@@ -249,28 +248,28 @@ static __inline__ u64 _raw_readq(unsigned long addr)
        return ret;
 }
 
-static __inline__ void _raw_writeb(u8 b, unsigned long addr)
+static inline void _raw_writeb(u8 b, unsigned long addr)
 {
        __asm__ __volatile__("stba\t%r0, [%1] %2\t/* pci_raw_writeb */"
                             : /* no outputs */
                             : "Jr" (b), "r" (addr), "i" (ASI_PHYS_BYPASS_EC_E));
 }
 
-static __inline__ void _raw_writew(u16 w, unsigned long addr)
+static inline void _raw_writew(u16 w, unsigned long addr)
 {
        __asm__ __volatile__("stha\t%r0, [%1] %2\t/* pci_raw_writew */"
                             : /* no outputs */
                             : "Jr" (w), "r" (addr), "i" (ASI_PHYS_BYPASS_EC_E));
 }
 
-static __inline__ void _raw_writel(u32 l, unsigned long addr)
+static inline void _raw_writel(u32 l, unsigned long addr)
 {
        __asm__ __volatile__("stwa\t%r0, [%1] %2\t/* pci_raw_writel */"
                             : /* no outputs */
                             : "Jr" (l), "r" (addr), "i" (ASI_PHYS_BYPASS_EC_E));
 }
 
-static __inline__ void _raw_writeq(u64 q, unsigned long addr)
+static inline void _raw_writeq(u64 q, unsigned long addr)
 {
        __asm__ __volatile__("stxa\t%r0, [%1] %2\t/* pci_raw_writeq */"
                             : /* no outputs */
index 182dba0..30cb76b 100644 (file)
@@ -1,7 +1,6 @@
-/* $Id: irq.h,v 1.21 2002/01/23 11:27:36 davem Exp $
- * irq.h: IRQ registers on the 64-bit Sparc.
+/* irq.h: IRQ registers on the 64-bit Sparc.
  *
- * Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu)
+ * Copyright (C) 1996 David S. Miller (davem@davemloft.net)
  * Copyright (C) 1998 Jakub Jelinek (jj@ultra.linux.cz)
  */
 
@@ -67,21 +66,21 @@ extern void virt_irq_free(unsigned int virt_irq);
 
 extern void fixup_irqs(void);
 
-static __inline__ void set_softint(unsigned long bits)
+static inline void set_softint(unsigned long bits)
 {
        __asm__ __volatile__("wr        %0, 0x0, %%set_softint"
                             : /* No outputs */
                             : "r" (bits));
 }
 
-static __inline__ void clear_softint(unsigned long bits)
+static inline void clear_softint(unsigned long bits)
 {
        __asm__ __volatile__("wr        %0, 0x0, %%clear_softint"
                             : /* No outputs */
                             : "r" (bits));
 }
 
-static __inline__ unsigned long get_softint(void)
+static inline unsigned long get_softint(void)
 {
        unsigned long retval;
 
index d14dd89..c5652de 100644 (file)
@@ -1,7 +1,6 @@
-/* $Id: mostek.h,v 1.4 2001/01/11 15:07:09 davem Exp $
- * mostek.h:  Describes the various Mostek time of day clock registers.
+/* mostek.h:  Describes the various Mostek time of day clock registers.
  *
- * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
+ * Copyright (C) 1995 David S. Miller (davem@davemloft.net)
  * Copyright (C) 1996 Thomas K. Dyas (tdyas@eden.rutgers.edu)
  */
 
@@ -38,7 +37,7 @@
  *
  * We now deal with physical addresses for I/O to the chip. -DaveM
  */
-static __inline__ u8 mostek_read(void __iomem *addr)
+static inline u8 mostek_read(void __iomem *addr)
 {
        u8 ret;
 
@@ -48,7 +47,7 @@ static __inline__ u8 mostek_read(void __iomem *addr)
        return ret;
 }
 
-static __inline__ void mostek_write(void __iomem *addr, u8 val)
+static inline void mostek_write(void __iomem *addr, u8 val)
 {
        __asm__ __volatile__("stba      %0, [%1] %2"
                             : /* no outputs */
index 6d58fdf..686defe 100644 (file)
@@ -1,5 +1,4 @@
-/* $Id: ns87303.h,v 1.3 2000/01/09 15:16:34 ecd Exp $
- * ns87303.h: Configuration Register Description for the
+/* ns87303.h: Configuration Register Description for the
  *            National Semiconductor PC87303 (SuperIO).
  *
  * Copyright (C) 1997  Eddie C. Dost  (ecd@skynet.be)
@@ -85,7 +84,7 @@
 
 extern spinlock_t ns87303_lock;
 
-static __inline__ int ns87303_modify(unsigned long port, unsigned int index,
+static inline int ns87303_modify(unsigned long port, unsigned int index,
                                     unsigned char clr, unsigned char set)
 {
        static unsigned char reserved[] = {
index 8116e8f..e9555b2 100644 (file)
@@ -1,5 +1,4 @@
-/* $Id: parport.h,v 1.11 2001/05/11 07:54:24 davem Exp $
- * parport.h: sparc64 specific parport initialization and dma.
+/* parport.h: sparc64 specific parport initialization and dma.
  *
  * Copyright (C) 1999  Eddie C. Dost  (ecd@skynet.be)
  */
@@ -42,7 +41,7 @@ static struct sparc_ebus_info {
 
 static DECLARE_BITMAP(dma_slot_map, PARPORT_PC_MAX_PORTS);
 
-static __inline__ int request_dma(unsigned int dmanr, const char *device_id)
+static inline int request_dma(unsigned int dmanr, const char *device_id)
 {
        if (dmanr >= PARPORT_PC_MAX_PORTS)
                return -EINVAL;
@@ -51,7 +50,7 @@ static __inline__ int request_dma(unsigned int dmanr, const char *device_id)
        return 0;
 }
 
-static __inline__ void free_dma(unsigned int dmanr)
+static inline void free_dma(unsigned int dmanr)
 {
        if (dmanr >= PARPORT_PC_MAX_PORTS) {
                printk(KERN_WARNING "Trying to free DMA%d\n", dmanr);
@@ -63,7 +62,7 @@ static __inline__ void free_dma(unsigned int dmanr)
        }       
 }
 
-static __inline__ void enable_dma(unsigned int dmanr)
+static inline void enable_dma(unsigned int dmanr)
 {
        ebus_dma_enable(&sparc_ebus_dmas[dmanr].info, 1);
 
@@ -73,32 +72,32 @@ static __inline__ void enable_dma(unsigned int dmanr)
                BUG();
 }
 
-static __inline__ void disable_dma(unsigned int dmanr)
+static inline void disable_dma(unsigned int dmanr)
 {
        ebus_dma_enable(&sparc_ebus_dmas[dmanr].info, 0);
 }
 
-static __inline__ void clear_dma_ff(unsigned int dmanr)
+static inline void clear_dma_ff(unsigned int dmanr)
 {
        /* nothing */
 }
 
-static __inline__ void set_dma_mode(unsigned int dmanr, char mode)
+static inline void set_dma_mode(unsigned int dmanr, char mode)
 {
        ebus_dma_prepare(&sparc_ebus_dmas[dmanr].info, (mode != DMA_MODE_WRITE));
 }
 
-static __inline__ void set_dma_addr(unsigned int dmanr, unsigned int addr)
+static inline void set_dma_addr(unsigned int dmanr, unsigned int addr)
 {
        sparc_ebus_dmas[dmanr].addr = addr;
 }
 
-static __inline__ void set_dma_count(unsigned int dmanr, unsigned int count)
+static inline void set_dma_count(unsigned int dmanr, unsigned int count)
 {
        sparc_ebus_dmas[dmanr].count = count;
 }
 
-static __inline__ unsigned int get_dma_residue(unsigned int dmanr)
+static inline unsigned int get_dma_residue(unsigned int dmanr)
 {
        return ebus_dma_residue(&sparc_ebus_dmas[dmanr].info);
 }
index c86b945..3426a65 100644 (file)
@@ -53,7 +53,7 @@ typedef struct {
 #if defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2)
 
 #undef __FD_SET
-static __inline__ void __FD_SET(unsigned long fd, __kernel_fd_set *fdsetp)
+static inline void __FD_SET(unsigned long fd, __kernel_fd_set *fdsetp)
 {
        unsigned long _tmp = fd / __NFDBITS;
        unsigned long _rem = fd % __NFDBITS;
@@ -61,7 +61,7 @@ static __inline__ void __FD_SET(unsigned long fd, __kernel_fd_set *fdsetp)
 }
 
 #undef __FD_CLR
-static __inline__ void __FD_CLR(unsigned long fd, __kernel_fd_set *fdsetp)
+static inline void __FD_CLR(unsigned long fd, __kernel_fd_set *fdsetp)
 {
        unsigned long _tmp = fd / __NFDBITS;
        unsigned long _rem = fd % __NFDBITS;
@@ -69,7 +69,7 @@ static __inline__ void __FD_CLR(unsigned long fd, __kernel_fd_set *fdsetp)
 }
 
 #undef __FD_ISSET
-static __inline__ int __FD_ISSET(unsigned long fd, __const__ __kernel_fd_set *p)
+static inline int __FD_ISSET(unsigned long fd, __const__ __kernel_fd_set *p)
 { 
        unsigned long _tmp = fd / __NFDBITS;
        unsigned long _rem = fd % __NFDBITS;
@@ -81,7 +81,7 @@ static __inline__ int __FD_ISSET(unsigned long fd, __const__ __kernel_fd_set *p)
  * for 256 and 1024-bit fd_sets respectively)
  */
 #undef __FD_ZERO
-static __inline__ void __FD_ZERO(__kernel_fd_set *p)
+static inline void __FD_ZERO(__kernel_fd_set *p)
 {
        unsigned long *tmp = p->fds_bits;
        int i;
index 0151cad..24a04a5 100644 (file)
  * numbers + offsets, and vice versa.
  */
 
-static __inline__ unsigned long sbus_devaddr(int slotnum, unsigned long offset)
+static inline unsigned long sbus_devaddr(int slotnum, unsigned long offset)
 {
   return (unsigned long) (SUN_SBUS_BVADDR+((slotnum)<<28)+(offset));
 }
 
-static __inline__ int sbus_dev_slot(unsigned long dev_addr)
+static inline int sbus_dev_slot(unsigned long dev_addr)
 {
   return (int) (((dev_addr)-SUN_SBUS_BVADDR)>>28);
 }
index cf78078..63b7040 100644 (file)
@@ -1,7 +1,6 @@
-/* $Id: spitfire.h,v 1.18 2001/11/29 16:42:10 kanoj Exp $
- * spitfire.h: SpitFire/BlackBird/Cheetah inline MMU operations.
+/* spitfire.h: SpitFire/BlackBird/Cheetah inline MMU operations.
  *
- * Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu)
+ * Copyright (C) 1996 David S. Miller (davem@davemloft.net)
  */
 
 #ifndef _SPARC64_SPITFIRE_H
@@ -67,7 +66,7 @@ extern void cheetah_enable_pcache(void);
 /* The data cache is write through, so this just invalidates the
  * specified line.
  */
-static __inline__ void spitfire_put_dcache_tag(unsigned long addr, unsigned long tag)
+static inline void spitfire_put_dcache_tag(unsigned long addr, unsigned long tag)
 {
        __asm__ __volatile__("stxa      %0, [%1] %2\n\t"
                             "membar    #Sync"
@@ -81,7 +80,7 @@ static __inline__ void spitfire_put_dcache_tag(unsigned long addr, unsigned long
  * a flush instruction (to any address) is sufficient to handle
  * this issue after the line is invalidated.
  */
-static __inline__ void spitfire_put_icache_tag(unsigned long addr, unsigned long tag)
+static inline void spitfire_put_icache_tag(unsigned long addr, unsigned long tag)
 {
        __asm__ __volatile__("stxa      %0, [%1] %2\n\t"
                             "membar    #Sync"
@@ -89,7 +88,7 @@ static __inline__ void spitfire_put_icache_tag(unsigned long addr, unsigned long
                             : "r" (tag), "r" (addr), "i" (ASI_IC_TAG));
 }
 
-static __inline__ unsigned long spitfire_get_dtlb_data(int entry)
+static inline unsigned long spitfire_get_dtlb_data(int entry)
 {
        unsigned long data;
 
@@ -103,7 +102,7 @@ static __inline__ unsigned long spitfire_get_dtlb_data(int entry)
        return data;
 }
 
-static __inline__ unsigned long spitfire_get_dtlb_tag(int entry)
+static inline unsigned long spitfire_get_dtlb_tag(int entry)
 {
        unsigned long tag;
 
@@ -113,7 +112,7 @@ static __inline__ unsigned long spitfire_get_dtlb_tag(int entry)
        return tag;
 }
 
-static __inline__ void spitfire_put_dtlb_data(int entry, unsigned long data)
+static inline void spitfire_put_dtlb_data(int entry, unsigned long data)
 {
        __asm__ __volatile__("stxa      %0, [%1] %2\n\t"
                             "membar    #Sync"
@@ -122,7 +121,7 @@ static __inline__ void spitfire_put_dtlb_data(int entry, unsigned long data)
                               "i" (ASI_DTLB_DATA_ACCESS));
 }
 
-static __inline__ unsigned long spitfire_get_itlb_data(int entry)
+static inline unsigned long spitfire_get_itlb_data(int entry)
 {
        unsigned long data;
 
@@ -136,7 +135,7 @@ static __inline__ unsigned long spitfire_get_itlb_data(int entry)
        return data;
 }
 
-static __inline__ unsigned long spitfire_get_itlb_tag(int entry)
+static inline unsigned long spitfire_get_itlb_tag(int entry)
 {
        unsigned long tag;
 
@@ -146,7 +145,7 @@ static __inline__ unsigned long spitfire_get_itlb_tag(int entry)
        return tag;
 }
 
-static __inline__ void spitfire_put_itlb_data(int entry, unsigned long data)
+static inline void spitfire_put_itlb_data(int entry, unsigned long data)
 {
        __asm__ __volatile__("stxa      %0, [%1] %2\n\t"
                             "membar    #Sync"
@@ -155,7 +154,7 @@ static __inline__ void spitfire_put_itlb_data(int entry, unsigned long data)
                               "i" (ASI_ITLB_DATA_ACCESS));
 }
 
-static __inline__ void spitfire_flush_dtlb_nucleus_page(unsigned long page)
+static inline void spitfire_flush_dtlb_nucleus_page(unsigned long page)
 {
        __asm__ __volatile__("stxa      %%g0, [%0] %1\n\t"
                             "membar    #Sync"
@@ -163,7 +162,7 @@ static __inline__ void spitfire_flush_dtlb_nucleus_page(unsigned long page)
                             : "r" (page | 0x20), "i" (ASI_DMMU_DEMAP));
 }
 
-static __inline__ void spitfire_flush_itlb_nucleus_page(unsigned long page)
+static inline void spitfire_flush_itlb_nucleus_page(unsigned long page)
 {
        __asm__ __volatile__("stxa      %%g0, [%0] %1\n\t"
                             "membar    #Sync"
@@ -172,7 +171,7 @@ static __inline__ void spitfire_flush_itlb_nucleus_page(unsigned long page)
 }
 
 /* Cheetah has "all non-locked" tlb flushes. */
-static __inline__ void cheetah_flush_dtlb_all(void)
+static inline void cheetah_flush_dtlb_all(void)
 {
        __asm__ __volatile__("stxa      %%g0, [%0] %1\n\t"
                             "membar    #Sync"
@@ -180,7 +179,7 @@ static __inline__ void cheetah_flush_dtlb_all(void)
                             : "r" (0x80), "i" (ASI_DMMU_DEMAP));
 }
 
-static __inline__ void cheetah_flush_itlb_all(void)
+static inline void cheetah_flush_itlb_all(void)
 {
        __asm__ __volatile__("stxa      %%g0, [%0] %1\n\t"
                             "membar    #Sync"
@@ -202,7 +201,7 @@ static __inline__ void cheetah_flush_itlb_all(void)
  * ASI_{D,I}TLB_DATA_ACCESS loads, doing the load twice fixes
  * the problem for me. -DaveM
  */
-static __inline__ unsigned long cheetah_get_ldtlb_data(int entry)
+static inline unsigned long cheetah_get_ldtlb_data(int entry)
 {
        unsigned long data;
 
@@ -215,7 +214,7 @@ static __inline__ unsigned long cheetah_get_ldtlb_data(int entry)
        return data;
 }
 
-static __inline__ unsigned long cheetah_get_litlb_data(int entry)
+static inline unsigned long cheetah_get_litlb_data(int entry)
 {
        unsigned long data;
 
@@ -228,7 +227,7 @@ static __inline__ unsigned long cheetah_get_litlb_data(int entry)
        return data;
 }
 
-static __inline__ unsigned long cheetah_get_ldtlb_tag(int entry)
+static inline unsigned long cheetah_get_ldtlb_tag(int entry)
 {
        unsigned long tag;
 
@@ -240,7 +239,7 @@ static __inline__ unsigned long cheetah_get_ldtlb_tag(int entry)
        return tag;
 }
 
-static __inline__ unsigned long cheetah_get_litlb_tag(int entry)
+static inline unsigned long cheetah_get_litlb_tag(int entry)
 {
        unsigned long tag;
 
@@ -252,7 +251,7 @@ static __inline__ unsigned long cheetah_get_litlb_tag(int entry)
        return tag;
 }
 
-static __inline__ void cheetah_put_ldtlb_data(int entry, unsigned long data)
+static inline void cheetah_put_ldtlb_data(int entry, unsigned long data)
 {
        __asm__ __volatile__("stxa      %0, [%1] %2\n\t"
                             "membar    #Sync"
@@ -262,7 +261,7 @@ static __inline__ void cheetah_put_ldtlb_data(int entry, unsigned long data)
                               "i" (ASI_DTLB_DATA_ACCESS));
 }
 
-static __inline__ void cheetah_put_litlb_data(int entry, unsigned long data)
+static inline void cheetah_put_litlb_data(int entry, unsigned long data)
 {
        __asm__ __volatile__("stxa      %0, [%1] %2\n\t"
                             "membar    #Sync"
@@ -272,7 +271,7 @@ static __inline__ void cheetah_put_litlb_data(int entry, unsigned long data)
                               "i" (ASI_ITLB_DATA_ACCESS));
 }
 
-static __inline__ unsigned long cheetah_get_dtlb_data(int entry, int tlb)
+static inline unsigned long cheetah_get_dtlb_data(int entry, int tlb)
 {
        unsigned long data;
 
@@ -284,7 +283,7 @@ static __inline__ unsigned long cheetah_get_dtlb_data(int entry, int tlb)
        return data;
 }
 
-static __inline__ unsigned long cheetah_get_dtlb_tag(int entry, int tlb)
+static inline unsigned long cheetah_get_dtlb_tag(int entry, int tlb)
 {
        unsigned long tag;
 
@@ -294,7 +293,7 @@ static __inline__ unsigned long cheetah_get_dtlb_tag(int entry, int tlb)
        return tag;
 }
 
-static __inline__ void cheetah_put_dtlb_data(int entry, unsigned long data, int tlb)
+static inline void cheetah_put_dtlb_data(int entry, unsigned long data, int tlb)
 {
        __asm__ __volatile__("stxa      %0, [%1] %2\n\t"
                             "membar    #Sync"
@@ -304,7 +303,7 @@ static __inline__ void cheetah_put_dtlb_data(int entry, unsigned long data, int
                               "i" (ASI_DTLB_DATA_ACCESS));
 }
 
-static __inline__ unsigned long cheetah_get_itlb_data(int entry)
+static inline unsigned long cheetah_get_itlb_data(int entry)
 {
        unsigned long data;
 
@@ -317,7 +316,7 @@ static __inline__ unsigned long cheetah_get_itlb_data(int entry)
        return data;
 }
 
-static __inline__ unsigned long cheetah_get_itlb_tag(int entry)
+static inline unsigned long cheetah_get_itlb_tag(int entry)
 {
        unsigned long tag;
 
@@ -327,7 +326,7 @@ static __inline__ unsigned long cheetah_get_itlb_tag(int entry)
        return tag;
 }
 
-static __inline__ void cheetah_put_itlb_data(int entry, unsigned long data)
+static inline void cheetah_put_itlb_data(int entry, unsigned long data)
 {
        __asm__ __volatile__("stxa      %0, [%1] %2\n\t"
                             "membar    #Sync"
index 3f175fa..159e62b 100644 (file)
@@ -1,4 +1,3 @@
-/* $Id: system.h,v 1.69 2002/02/09 19:49:31 davem Exp $ */
 #ifndef __SPARC64_SYSTEM_H
 #define __SPARC64_SYSTEM_H
 
@@ -240,7 +239,7 @@ static inline unsigned long xchg64(__volatile__ unsigned long *m, unsigned long
 
 extern void __xchg_called_with_bad_pointer(void);
 
-static __inline__ unsigned long __xchg(unsigned long x, __volatile__ void * ptr,
+static inline unsigned long __xchg(unsigned long x, __volatile__ void * ptr,
                                       int size)
 {
        switch (size) {
@@ -263,7 +262,7 @@ extern void die_if_kernel(char *str, struct pt_regs *regs) __attribute__ ((noret
 
 #define __HAVE_ARCH_CMPXCHG 1
 
-static __inline__ unsigned long
+static inline unsigned long
 __cmpxchg_u32(volatile int *m, int old, int new)
 {
        __asm__ __volatile__("membar #StoreLoad | #LoadLoad\n"
@@ -276,7 +275,7 @@ __cmpxchg_u32(volatile int *m, int old, int new)
        return new;
 }
 
-static __inline__ unsigned long
+static inline unsigned long
 __cmpxchg_u64(volatile long *m, unsigned long old, unsigned long new)
 {
        __asm__ __volatile__("membar #StoreLoad | #LoadLoad\n"
@@ -293,7 +292,7 @@ __cmpxchg_u64(volatile long *m, unsigned long old, unsigned long new)
    if something tries to do an invalid cmpxchg().  */
 extern void __cmpxchg_called_with_bad_pointer(void);
 
-static __inline__ unsigned long
+static inline unsigned long
 __cmpxchg(volatile void *ptr, unsigned long old, unsigned long new, int size)
 {
        switch (size) {
index 7ae09a2..5b16332 100644 (file)
@@ -1,4 +1,3 @@
-/* $Id: upa.h,v 1.3 1999/09/21 14:39:47 davem Exp $ */
 #ifndef _SPARC64_UPA_H
 #define _SPARC64_UPA_H
 
@@ -25,7 +24,7 @@
 
 /* UPA I/O space accessors */
 #if defined(__KERNEL__) && !defined(__ASSEMBLY__)
-static __inline__ unsigned char _upa_readb(unsigned long addr)
+static inline unsigned char _upa_readb(unsigned long addr)
 {
        unsigned char ret;
 
@@ -36,7 +35,7 @@ static __inline__ unsigned char _upa_readb(unsigned long addr)
        return ret;
 }
 
-static __inline__ unsigned short _upa_readw(unsigned long addr)
+static inline unsigned short _upa_readw(unsigned long addr)
 {
        unsigned short ret;
 
@@ -47,7 +46,7 @@ static __inline__ unsigned short _upa_readw(unsigned long addr)
        return ret;
 }
 
-static __inline__ unsigned int _upa_readl(unsigned long addr)
+static inline unsigned int _upa_readl(unsigned long addr)
 {
        unsigned int ret;
 
@@ -58,7 +57,7 @@ static __inline__ unsigned int _upa_readl(unsigned long addr)
        return ret;
 }
 
-static __inline__ unsigned long _upa_readq(unsigned long addr)
+static inline unsigned long _upa_readq(unsigned long addr)
 {
        unsigned long ret;
 
@@ -69,28 +68,28 @@ static __inline__ unsigned long _upa_readq(unsigned long addr)
        return ret;
 }
 
-static __inline__ void _upa_writeb(unsigned char b, unsigned long addr)
+static inline void _upa_writeb(unsigned char b, unsigned long addr)
 {
        __asm__ __volatile__("stba\t%0, [%1] %2\t/* upa_writeb */"
                             : /* no outputs */
                             : "r" (b), "r" (addr), "i" (ASI_PHYS_BYPASS_EC_E));
 }
 
-static __inline__ void _upa_writew(unsigned short w, unsigned long addr)
+static inline void _upa_writew(unsigned short w, unsigned long addr)
 {
        __asm__ __volatile__("stha\t%0, [%1] %2\t/* upa_writew */"
                             : /* no outputs */
                             : "r" (w), "r" (addr), "i" (ASI_PHYS_BYPASS_EC_E));
 }
 
-static __inline__ void _upa_writel(unsigned int l, unsigned long addr)
+static inline void _upa_writel(unsigned int l, unsigned long addr)
 {
        __asm__ __volatile__("stwa\t%0, [%1] %2\t/* upa_writel */"
                             : /* no outputs */
                             : "r" (l), "r" (addr), "i" (ASI_PHYS_BYPASS_EC_E));
 }
 
-static __inline__ void _upa_writeq(unsigned long q, unsigned long addr)
+static inline void _upa_writeq(unsigned long q, unsigned long addr)
 {
        __asm__ __volatile__("stxa\t%0, [%1] %2\t/* upa_writeq */"
                             : /* no outputs */
index a740785..34f2ec6 100644 (file)
@@ -1,4 +1,3 @@
-/* $Id: visasm.h,v 1.5 2001/04/24 01:09:12 davem Exp $ */
 #ifndef _SPARC64_VISASM_H
 #define _SPARC64_VISASM_H
 
@@ -44,7 +43,7 @@
        wr              %o5, 0, %fprs;
 
 #ifndef __ASSEMBLY__   
-static __inline__ void save_and_clear_fpu(void) {
+static inline void save_and_clear_fpu(void) {
        __asm__ __volatile__ (
 "              rd %%fprs, %%o5\n"
 "              andcc %%o5, %0, %%g0\n"
index 7056d86..e10b7af 100644 (file)
@@ -94,9 +94,12 @@ static inline void smp_send_reschedule(int cpu)
 {
        smp_ops.smp_send_reschedule(cpu);
 }
-extern int smp_call_function_mask(cpumask_t mask,
-                                 void (*func) (void *info), void *info,
-                                 int wait);
+static inline int smp_call_function_mask(cpumask_t mask,
+                                        void (*func) (void *info), void *info,
+                                        int wait)
+{
+       return smp_ops.smp_call_function_mask(mask, func, info, wait);
+}
 
 void native_smp_prepare_boot_cpu(void);
 void native_smp_prepare_cpus(unsigned int max_cpus);
index 3f27239..8df230a 100644 (file)
@@ -8,6 +8,9 @@
 #define MV643XX_ETH_NAME               "mv643xx_eth"
 #define MV643XX_ETH_SHARED_REGS                0x2000
 #define MV643XX_ETH_SHARED_REGS_SIZE   0x2000
+#define MV643XX_ETH_BAR_4      0x220
+#define MV643XX_ETH_SIZE_REG_4 0x224
+#define MV643XX_ETH_BASE_ADDR_ENABLE_REG       0x0290
 
 struct mv643xx_eth_platform_data {
        int             port_number;
index 93aa87d..5279466 100644 (file)
@@ -102,11 +102,9 @@ static inline void release_net(struct net *net)
 #ifdef CONFIG_NET_NS
 #define __net_init
 #define __net_exit
-#define __net_initdata
 #else
 #define __net_init     __init
 #define __net_exit     __exit_refok
-#define __net_initdata __initdata
 #endif
 
 struct pernet_operations {
index ddfef3b..853c8b5 100644 (file)
@@ -2668,7 +2668,7 @@ static void __net_exit dev_proc_net_exit(struct net *net)
        proc_net_remove(net, "dev");
 }
 
-static struct pernet_operations __net_initdata dev_proc_ops = {
+static struct pernet_operations dev_proc_ops = {
        .init = dev_proc_net_init,
        .exit = dev_proc_net_exit,
 };
@@ -4328,7 +4328,7 @@ static void __net_exit netdev_exit(struct net *net)
        kfree(net->dev_index_head);
 }
 
-static struct pernet_operations __net_initdata netdev_net_ops = {
+static struct pernet_operations  netdev_net_ops = {
        .init = netdev_init,
        .exit = netdev_exit,
 };
@@ -4359,7 +4359,7 @@ static void __net_exit default_device_exit(struct net *net)
        rtnl_unlock();
 }
 
-static struct pernet_operations __net_initdata default_device_ops = {
+static struct pernet_operations  default_device_ops = {
        .exit = default_device_exit,
 };
 
index 15241cf..ae35405 100644 (file)
@@ -285,7 +285,7 @@ static void __net_exit dev_mc_net_exit(struct net *net)
        proc_net_remove(net, "dev_mcast");
 }
 
-static struct pernet_operations __net_initdata dev_mc_net_ops = {
+static struct pernet_operations dev_mc_net_ops = {
        .init = dev_mc_net_init,
        .exit = dev_mc_net_exit,
 };
index 4a2640d..e1ba26f 100644 (file)
@@ -742,7 +742,7 @@ static struct net *get_net_ns_by_pid(pid_t pid)
        /* Lookup the network namespace */
        net = ERR_PTR(-ESRCH);
        rcu_read_lock();
-       tsk = find_task_by_pid(pid);
+       tsk = find_task_by_vpid(pid);
        if (tsk) {
                struct nsproxy *nsproxy;
                nsproxy = task_nsproxy(tsk);
index ba98401..cad4278 100644 (file)
@@ -3,7 +3,7 @@
 #include <net/ip.h>
 #include <net/xfrm.h>
 #include <net/esp.h>
-#include <asm/scatterlist.h>
+#include <linux/scatterlist.h>
 #include <linux/crypto.h>
 #include <linux/kernel.h>
 #include <linux/pfkeyv2.h>
@@ -111,7 +111,9 @@ static int esp_output(struct xfrm_state *x, struct sk_buff *skb)
                                goto unlock;
                }
                sg_init_table(sg, nfrags);
-               skb_to_sgvec(skb, sg, esph->enc_data+esp->conf.ivlen-skb->data, clen);
+               sg_mark_end(sg, skb_to_sgvec(skb, sg, esph->enc_data +
+                                                     esp->conf.ivlen -
+                                                     skb->data, clen));
                err = crypto_blkcipher_encrypt(&desc, sg, sg, clen);
                if (unlikely(sg != &esp->sgbuf[0]))
                        kfree(sg);
@@ -203,7 +205,8 @@ static int esp_input(struct xfrm_state *x, struct sk_buff *skb)
                        goto out;
        }
        sg_init_table(sg, nfrags);
-       skb_to_sgvec(skb, sg, sizeof(*esph) + esp->conf.ivlen, elen);
+       sg_mark_end(sg, skb_to_sgvec(skb, sg, sizeof(*esph) + esp->conf.ivlen,
+                                    elen));
        err = crypto_blkcipher_decrypt(&desc, sg, sg, elen);
        if (unlikely(sg != &esp->sgbuf[0]))
                kfree(sg);
index f67d51a..ab17b5e 100644 (file)
@@ -29,7 +29,7 @@
 #include <net/ip.h>
 #include <net/xfrm.h>
 #include <net/esp.h>
-#include <asm/scatterlist.h>
+#include <linux/scatterlist.h>
 #include <linux/crypto.h>
 #include <linux/kernel.h>
 #include <linux/pfkeyv2.h>
@@ -110,7 +110,9 @@ static int esp6_output(struct xfrm_state *x, struct sk_buff *skb)
                                goto unlock;
                }
                sg_init_table(sg, nfrags);
-               skb_to_sgvec(skb, sg, esph->enc_data+esp->conf.ivlen-skb->data, clen);
+               sg_mark_end(sg, skb_to_sgvec(skb, sg, esph->enc_data +
+                                                     esp->conf.ivlen -
+                                                     skb->data, clen));
                err = crypto_blkcipher_encrypt(&desc, sg, sg, clen);
                if (unlikely(sg != &esp->sgbuf[0]))
                        kfree(sg);
@@ -207,7 +209,9 @@ static int esp6_input(struct xfrm_state *x, struct sk_buff *skb)
                        }
                }
                sg_init_table(sg, nfrags);
-               skb_to_sgvec(skb, sg, sizeof(*esph) + esp->conf.ivlen, elen);
+               sg_mark_end(sg, skb_to_sgvec(skb, sg,
+                                            sizeof(*esph) + esp->conf.ivlen,
+                                            elen));
                ret = crypto_blkcipher_decrypt(&desc, sg, sg, elen);
                if (unlikely(sg != &esp->sgbuf[0]))
                        kfree(sg);
index 06fa4ba..8520802 100644 (file)
@@ -59,6 +59,7 @@
 #include <net/snmp.h>
 #include <net/dsfield.h>
 #include <net/timewait_sock.h>
+#include <net/netdma.h>
 
 #include <asm/uaccess.h>
 
index 3252729..4f994c0 100644 (file)
@@ -1888,7 +1888,7 @@ static void __net_exit netlink_net_exit(struct net *net)
 #endif
 }
 
-static struct pernet_operations __net_initdata netlink_net_ops = {
+static struct pernet_operations netlink_net_ops = {
        .init = netlink_net_init,
        .exit = netlink_net_exit,
 };
index ac3cabd..eebefb6 100644 (file)
@@ -135,9 +135,8 @@ static void rxkad_prime_packet_security(struct rxrpc_connection *conn)
        tmpbuf.x[2] = 0;
        tmpbuf.x[3] = htonl(conn->security_ix);
 
-       memset(sg, 0, sizeof(sg));
-       sg_set_buf(&sg[0], &tmpbuf, sizeof(tmpbuf));
-       sg_set_buf(&sg[1], &tmpbuf, sizeof(tmpbuf));
+       sg_init_one(&sg[0], &tmpbuf, sizeof(tmpbuf));
+       sg_init_one(&sg[1], &tmpbuf, sizeof(tmpbuf));
        crypto_blkcipher_encrypt_iv(&desc, &sg[0], &sg[1], sizeof(tmpbuf));
 
        memcpy(&conn->csum_iv, &tmpbuf.x[2], sizeof(conn->csum_iv));
@@ -180,9 +179,8 @@ static int rxkad_secure_packet_auth(const struct rxrpc_call *call,
        desc.info = iv.x;
        desc.flags = 0;
 
-       memset(sg, 0, sizeof(sg));
-       sg_set_buf(&sg[0], &tmpbuf, sizeof(tmpbuf));
-       sg_set_buf(&sg[1], &tmpbuf, sizeof(tmpbuf));
+       sg_init_one(&sg[0], &tmpbuf, sizeof(tmpbuf));
+       sg_init_one(&sg[1], &tmpbuf, sizeof(tmpbuf));
        crypto_blkcipher_encrypt_iv(&desc, &sg[0], &sg[1], sizeof(tmpbuf));
 
        memcpy(sechdr, &tmpbuf, sizeof(tmpbuf));
@@ -227,9 +225,8 @@ static int rxkad_secure_packet_encrypt(const struct rxrpc_call *call,
        desc.info = iv.x;
        desc.flags = 0;
 
-       memset(sg, 0, sizeof(sg[0]) * 2);
-       sg_set_buf(&sg[0], sechdr, sizeof(rxkhdr));
-       sg_set_buf(&sg[1], &rxkhdr, sizeof(rxkhdr));
+       sg_init_one(&sg[0], sechdr, sizeof(rxkhdr));
+       sg_init_one(&sg[1], &rxkhdr, sizeof(rxkhdr));
        crypto_blkcipher_encrypt_iv(&desc, &sg[0], &sg[1], sizeof(rxkhdr));
 
        /* we want to encrypt the skbuff in-place */
@@ -240,7 +237,7 @@ static int rxkad_secure_packet_encrypt(const struct rxrpc_call *call,
        len = data_size + call->conn->size_align - 1;
        len &= ~(call->conn->size_align - 1);
 
-       skb_to_sgvec(skb, sg, 0, len);
+       sg_init_table(sg, skb_to_sgvec(skb, sg, 0, len));
        crypto_blkcipher_encrypt_iv(&desc, sg, sg, len);
 
        _leave(" = 0");
@@ -290,9 +287,8 @@ static int rxkad_secure_packet(const struct rxrpc_call *call,
        tmpbuf.x[0] = sp->hdr.callNumber;
        tmpbuf.x[1] = x;
 
-       memset(&sg, 0, sizeof(sg));
-       sg_set_buf(&sg[0], &tmpbuf, sizeof(tmpbuf));
-       sg_set_buf(&sg[1], &tmpbuf, sizeof(tmpbuf));
+       sg_init_one(&sg[0], &tmpbuf, sizeof(tmpbuf));
+       sg_init_one(&sg[1], &tmpbuf, sizeof(tmpbuf));
        crypto_blkcipher_encrypt_iv(&desc, &sg[0], &sg[1], sizeof(tmpbuf));
 
        x = ntohl(tmpbuf.x[1]);
@@ -332,20 +328,23 @@ static int rxkad_verify_packet_auth(const struct rxrpc_call *call,
        struct rxrpc_skb_priv *sp;
        struct blkcipher_desc desc;
        struct rxrpc_crypt iv;
-       struct scatterlist sg[2];
+       struct scatterlist sg[16];
        struct sk_buff *trailer;
        u32 data_size, buf;
        u16 check;
+       int nsg;
 
        _enter("");
 
        sp = rxrpc_skb(skb);
 
        /* we want to decrypt the skbuff in-place */
-       if (skb_cow_data(skb, 0, &trailer) < 0)
+       nsg = skb_cow_data(skb, 0, &trailer);
+       if (nsg < 0 || nsg > 16)
                goto nomem;
 
-       skb_to_sgvec(skb, sg, 0, 8);
+       sg_init_table(sg, nsg);
+       sg_mark_end(sg, skb_to_sgvec(skb, sg, 0, 8));
 
        /* start the decryption afresh */
        memset(&iv, 0, sizeof(iv));
@@ -426,7 +425,8 @@ static int rxkad_verify_packet_encrypt(const struct rxrpc_call *call,
                        goto nomem;
        }
 
-       skb_to_sgvec(skb, sg, 0, skb->len);
+       sg_init_table(sg, nsg);
+       sg_mark_end(sg, skb_to_sgvec(skb, sg, 0, skb->len));
 
        /* decrypt from the session key */
        payload = call->conn->key->payload.data;
@@ -521,9 +521,8 @@ static int rxkad_verify_packet(const struct rxrpc_call *call,
        tmpbuf.x[0] = call->call_id;
        tmpbuf.x[1] = x;
 
-       memset(&sg, 0, sizeof(sg));
-       sg_set_buf(&sg[0], &tmpbuf, sizeof(tmpbuf));
-       sg_set_buf(&sg[1], &tmpbuf, sizeof(tmpbuf));
+       sg_init_one(&sg[0], &tmpbuf, sizeof(tmpbuf));
+       sg_init_one(&sg[1], &tmpbuf, sizeof(tmpbuf));
        crypto_blkcipher_encrypt_iv(&desc, &sg[0], &sg[1], sizeof(tmpbuf));
 
        x = ntohl(tmpbuf.x[1]);
@@ -690,16 +689,20 @@ static void rxkad_calc_response_checksum(struct rxkad_response *response)
 static void rxkad_sg_set_buf2(struct scatterlist sg[2],
                              void *buf, size_t buflen)
 {
+       int nsg = 1;
 
-       memset(sg, 0, sizeof(sg));
+       sg_init_table(sg, 2);
 
        sg_set_buf(&sg[0], buf, buflen);
        if (sg[0].offset + buflen > PAGE_SIZE) {
                /* the buffer was split over two pages */
                sg[0].length = PAGE_SIZE - sg[0].offset;
                sg_set_buf(&sg[1], buf + sg[0].length, buflen - sg[0].length);
+               nsg++;
        }
 
+       sg_mark_end(sg, nsg);
+
        ASSERTCMP(sg[0].length + sg[1].length, ==, buflen);
 }
 
@@ -712,7 +715,7 @@ static void rxkad_encrypt_response(struct rxrpc_connection *conn,
 {
        struct blkcipher_desc desc;
        struct rxrpc_crypt iv;
-       struct scatterlist ssg[2], dsg[2];
+       struct scatterlist sg[2];
 
        /* continue encrypting from where we left off */
        memcpy(&iv, s2->session_key, sizeof(iv));
@@ -720,9 +723,8 @@ static void rxkad_encrypt_response(struct rxrpc_connection *conn,
        desc.info = iv.x;
        desc.flags = 0;
 
-       rxkad_sg_set_buf2(ssg, &resp->encrypted, sizeof(resp->encrypted));
-       memcpy(dsg, ssg, sizeof(dsg));
-       crypto_blkcipher_encrypt_iv(&desc, dsg, ssg, sizeof(resp->encrypted));
+       rxkad_sg_set_buf2(sg, &resp->encrypted, sizeof(resp->encrypted));
+       crypto_blkcipher_encrypt_iv(&desc, sg, sg, sizeof(resp->encrypted));
 }
 
 /*
@@ -817,7 +819,7 @@ static int rxkad_decrypt_ticket(struct rxrpc_connection *conn,
 {
        struct blkcipher_desc desc;
        struct rxrpc_crypt iv, key;
-       struct scatterlist ssg[1], dsg[1];
+       struct scatterlist sg[1];
        struct in_addr addr;
        unsigned life;
        time_t issue, now;
@@ -850,9 +852,8 @@ static int rxkad_decrypt_ticket(struct rxrpc_connection *conn,
        desc.info = iv.x;
        desc.flags = 0;
 
-       sg_init_one(&ssg[0], ticket, ticket_len);
-       memcpy(dsg, ssg, sizeof(dsg));
-       crypto_blkcipher_decrypt_iv(&desc, dsg, ssg, ticket_len);
+       sg_init_one(&sg[0], ticket, ticket_len);
+       crypto_blkcipher_decrypt_iv(&desc, sg, sg, ticket_len);
 
        p = ticket;
        end = p + ticket_len;
@@ -961,7 +962,7 @@ static void rxkad_decrypt_response(struct rxrpc_connection *conn,
                                   const struct rxrpc_crypt *session_key)
 {
        struct blkcipher_desc desc;
-       struct scatterlist ssg[2], dsg[2];
+       struct scatterlist sg[2];
        struct rxrpc_crypt iv;
 
        _enter(",,%08x%08x",
@@ -979,9 +980,8 @@ static void rxkad_decrypt_response(struct rxrpc_connection *conn,
        desc.info = iv.x;
        desc.flags = 0;
 
-       rxkad_sg_set_buf2(ssg, &resp->encrypted, sizeof(resp->encrypted));
-       memcpy(dsg, ssg, sizeof(dsg));
-       crypto_blkcipher_decrypt_iv(&desc, dsg, ssg, sizeof(resp->encrypted));
+       rxkad_sg_set_buf2(sg, &resp->encrypted, sizeof(resp->encrypted));
+       crypto_blkcipher_decrypt_iv(&desc, sg, sg, sizeof(resp->encrypted));
        mutex_unlock(&rxkad_ci_mutex);
 
        _leave("");
index c9dbc3a..8af1004 100644 (file)
@@ -726,8 +726,7 @@ void sctp_auth_calculate_hmac(const struct sctp_association *asoc,
 
        /* set up scatter list */
        end = skb_tail_pointer(skb);
-       sg_init_table(&sg, 1);
-       sg_set_buf(&sg, auth, end - (unsigned char *)auth);
+       sg_init_one(&sg, auth, end - (unsigned char *)auth);
 
        desc.tfm = asoc->ep->auth_hmacs[hmac_id];
        desc.flags = 0;
index c055212..c377e4e 100644 (file)
@@ -1513,8 +1513,7 @@ static sctp_cookie_param_t *sctp_pack_cookie(const struct sctp_endpoint *ep,
                struct hash_desc desc;
 
                /* Sign the message.  */
-               sg_init_table(&sg, 1);
-               sg_set_buf(&sg, &cookie->c, bodysize);
+               sg_init_one(&sg, &cookie->c, bodysize);
                keylen = SCTP_SECRET_SIZE;
                key = (char *)ep->secret_key[ep->current_key];
                desc.tfm = sctp_sk(ep->base.sk)->hmac;
@@ -1584,8 +1583,7 @@ struct sctp_association *sctp_unpack_cookie(
 
        /* Check the signature.  */
        keylen = SCTP_SECRET_SIZE;
-       sg_init_table(&sg, 1);
-       sg_set_buf(&sg, bear_cookie, bodysize);
+       sg_init_one(&sg, bear_cookie, bodysize);
        key = (char *)ep->secret_key[ep->current_key];
        desc.tfm = sctp_sk(ep->base.sk)->hmac;
        desc.flags = 0;
index 24711be..91cd8f0 100644 (file)
@@ -75,7 +75,7 @@ krb5_encrypt(
                memcpy(local_iv, iv, crypto_blkcipher_ivsize(tfm));
 
        memcpy(out, in, length);
-       sg_set_buf(sg, out, length);
+       sg_init_one(sg, out, length);
 
        ret = crypto_blkcipher_encrypt_iv(&desc, sg, sg, length);
 out:
@@ -110,7 +110,7 @@ krb5_decrypt(
                memcpy(local_iv,iv, crypto_blkcipher_ivsize(tfm));
 
        memcpy(out, in, length);
-       sg_set_buf(sg, out, length);
+       sg_init_one(sg, out, length);
 
        ret = crypto_blkcipher_decrypt_iv(&desc, sg, sg, length);
 out:
@@ -146,7 +146,7 @@ make_checksum(char *cksumname, char *header, int hdrlen, struct xdr_buf *body,
        err = crypto_hash_init(&desc);
        if (err)
                goto out;
-       sg_set_buf(sg, header, hdrlen);
+       sg_init_one(sg, header, hdrlen);
        err = crypto_hash_update(&desc, sg, hdrlen);
        if (err)
                goto out;
@@ -188,8 +188,6 @@ encryptor(struct scatterlist *sg, void *data)
        /* Worst case is 4 fragments: head, end of page 1, start
         * of page 2, tail.  Anything more is a bug. */
        BUG_ON(desc->fragno > 3);
-       desc->infrags[desc->fragno] = *sg;
-       desc->outfrags[desc->fragno] = *sg;
 
        page_pos = desc->pos - outbuf->head[0].iov_len;
        if (page_pos >= 0 && page_pos < outbuf->page_len) {
@@ -199,7 +197,10 @@ encryptor(struct scatterlist *sg, void *data)
        } else {
                in_page = sg_page(sg);
        }
-       sg_assign_page(&desc->infrags[desc->fragno], in_page);
+       sg_set_page(&desc->infrags[desc->fragno], in_page, sg->length,
+                   sg->offset);
+       sg_set_page(&desc->outfrags[desc->fragno], sg_page(sg), sg->length,
+                   sg->offset);
        desc->fragno++;
        desc->fraglen += sg->length;
        desc->pos += sg->length;
@@ -210,10 +211,17 @@ encryptor(struct scatterlist *sg, void *data)
        if (thislen == 0)
                return 0;
 
+       sg_mark_end(desc->infrags, desc->fragno);
+       sg_mark_end(desc->outfrags, desc->fragno);
+
        ret = crypto_blkcipher_encrypt_iv(&desc->desc, desc->outfrags,
                                          desc->infrags, thislen);
        if (ret)
                return ret;
+
+       sg_init_table(desc->infrags, 4);
+       sg_init_table(desc->outfrags, 4);
+
        if (fraglen) {
                sg_set_page(&desc->outfrags[0], sg_page(sg), fraglen,
                                sg->offset + sg->length - fraglen);
@@ -247,6 +255,9 @@ gss_encrypt_xdr_buf(struct crypto_blkcipher *tfm, struct xdr_buf *buf,
        desc.fragno = 0;
        desc.fraglen = 0;
 
+       sg_init_table(desc.infrags, 4);
+       sg_init_table(desc.outfrags, 4);
+
        ret = xdr_process_buf(buf, offset, buf->len - offset, encryptor, &desc);
        return ret;
 }
@@ -271,7 +282,8 @@ decryptor(struct scatterlist *sg, void *data)
        /* Worst case is 4 fragments: head, end of page 1, start
         * of page 2, tail.  Anything more is a bug. */
        BUG_ON(desc->fragno > 3);
-       desc->frags[desc->fragno] = *sg;
+       sg_set_page(&desc->frags[desc->fragno], sg_page(sg), sg->length,
+                   sg->offset);
        desc->fragno++;
        desc->fraglen += sg->length;
 
@@ -281,10 +293,15 @@ decryptor(struct scatterlist *sg, void *data)
        if (thislen == 0)
                return 0;
 
+       sg_mark_end(desc->frags, desc->fragno);
+
        ret = crypto_blkcipher_decrypt_iv(&desc->desc, desc->frags,
                                          desc->frags, thislen);
        if (ret)
                return ret;
+
+       sg_init_table(desc->frags, 4);
+
        if (fraglen) {
                sg_set_page(&desc->frags[0], sg_page(sg), fraglen,
                                sg->offset + sg->length - fraglen);
@@ -312,6 +329,9 @@ gss_decrypt_xdr_buf(struct crypto_blkcipher *tfm, struct xdr_buf *buf,
        desc.desc.flags = 0;
        desc.fragno = 0;
        desc.fraglen = 0;
+
+       sg_init_table(desc.frags, 4);
+
        return xdr_process_buf(buf, offset, buf->len - offset, decryptor, &desc);
 }
 
index d158635..abf17ce 100644 (file)
@@ -173,7 +173,7 @@ make_spkm3_checksum(s32 cksumtype, struct xdr_netobj *key, char *header,
        if (err)
                goto out;
 
-       sg_set_buf(sg, header, hdrlen);
+       sg_init_one(sg, header, hdrlen);
        crypto_hash_update(&desc, sg, sg->length);
 
        xdr_process_buf(body, body_offset, body->len - body_offset,
index f38dac3..fdc5e6d 100644 (file)
@@ -1030,6 +1030,8 @@ xdr_process_buf(struct xdr_buf *buf, unsigned int offset, unsigned int len,
        unsigned page_len, thislen, page_offset;
        struct scatterlist      sg[1];
 
+       sg_init_table(sg, 1);
+
        if (offset >= buf->head[0].iov_len) {
                offset -= buf->head[0].iov_len;
        } else {
index 83c5e76..5959412 100644 (file)
@@ -4,23 +4,30 @@
 
 PHONY += oldconfig xconfig gconfig menuconfig config silentoldconfig update-po-config
 
+# If a arch/$(SRCARCH)/Kconfig.$(ARCH) file exist use it
+ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/Kconfig.$(ARCH)),)
+        Kconfig := arch/$(SRCARCH)/Kconfig.$(ARCH)
+else
+        Kconfig := arch/$(SRCARCH)/Kconfig
+endif
+
 xconfig: $(obj)/qconf
-       $< arch/$(ARCH)/Kconfig
+       $< $(Kconfig)
 
 gconfig: $(obj)/gconf
-       $< arch/$(ARCH)/Kconfig
+       $< $(Kconfig)
 
 menuconfig: $(obj)/mconf
-       $< arch/$(ARCH)/Kconfig
+       $< $(Kconfig)
 
 config: $(obj)/conf
-       $< arch/$(ARCH)/Kconfig
+       $< $(Kconfig)
 
 oldconfig: $(obj)/conf
-       $< -o arch/$(ARCH)/Kconfig
+       $< -o $(Kconfig)
 
 silentoldconfig: $(obj)/conf
-       $< -s arch/$(ARCH)/Kconfig
+       $< -s $(Kconfig)
 
 # Create new linux.po file
 # Adjust charset to UTF-8 in .po file to accept UTF-8 in Kconfig files
@@ -45,27 +52,27 @@ update-po-config: $(obj)/kxgettext
 PHONY += randconfig allyesconfig allnoconfig allmodconfig defconfig
 
 randconfig: $(obj)/conf
-       $< -r arch/$(ARCH)/Kconfig
+       $< -r $(Kconfig)
 
 allyesconfig: $(obj)/conf
-       $< -y arch/$(ARCH)/Kconfig
+       $< -y $(Kconfig)
 
 allnoconfig: $(obj)/conf
-       $< -n arch/$(ARCH)/Kconfig
+       $< -n $(Kconfig)
 
 allmodconfig: $(obj)/conf
-       $< -m arch/$(ARCH)/Kconfig
+       $< -m $(Kconfig)
 
 defconfig: $(obj)/conf
 ifeq ($(KBUILD_DEFCONFIG),)
-       $< -d arch/$(ARCH)/Kconfig
+       $< -d $(Kconfig)
 else
-       @echo *** Default configuration is based on '$(KBUILD_DEFCONFIG)'
-       $(Q)$< -D arch/$(ARCH)/configs/$(KBUILD_DEFCONFIG) arch/$(ARCH)/Kconfig
+       @echo "*** Default configuration is based on '$(KBUILD_DEFCONFIG)'"
+       $(Q)$< -D arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG) $(Kconfig)
 endif
 
 %_defconfig: $(obj)/conf
-       $(Q)$< -D arch/$(ARCH)/configs/$@ arch/$(ARCH)/Kconfig
+       $(Q)$< -D arch/$(SRCARCH)/configs/$@ $(Kconfig)
 
 # Help text used by make help
 help:
index d9f78c8..1c50278 100644 (file)
@@ -9299,7 +9299,6 @@ static struct alc_config_preset alc268_presets[] = {
                .num_channel_mode = ARRAY_SIZE(alc268_modes),
                .channel_mode = alc268_modes,
                .input_mux = &alc268_capture_source,
-               .input_mux = &alc268_capture_source,
                .unsol_event = alc268_toshiba_unsol_event,
                .init_hook = alc268_toshiba_automute,
        },