summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@home.osdl.org>2004-01-19 05:38:09 -0800
committerLinus Torvalds <torvalds@home.osdl.org>2004-01-19 05:38:09 -0800
commite5392b30af6b2827478e6f7202f6cf7fc267ccc2 (patch)
tree3f7deb99642cebab67d8c5956ac05475ebb6a409 /include
parent7dba52a904e088a08107dfd629c01f2358b2021b (diff)
parent56660d5ebdfecc4d070d5eeb22ba512436c81808 (diff)
Merge bk://kernel.bkbits.net/gregkh/linux/i2c-2.6
into home.osdl.org:/home/torvalds/v2.5/linux
Diffstat (limited to 'include')
-rw-r--r--include/asm-alpha/processor.h11
-rw-r--r--include/asm-alpha/topology.h3
-rw-r--r--include/asm-arm/arch-ebsa285/io.h6
-rw-r--r--include/asm-arm/arch-nexuspci/io.h3
-rw-r--r--include/asm-i386/genapic.h2
-rw-r--r--include/asm-i386/hpet.h4
-rw-r--r--include/asm-i386/mach-bigsmp/mach_apic.h5
-rw-r--r--include/asm-i386/mach-default/mach_apic.h5
-rw-r--r--include/asm-i386/mach-es7000/mach_apic.h5
-rw-r--r--include/asm-i386/mach-generic/mach_apic.h1
-rw-r--r--include/asm-i386/mach-numaq/mach_apic.h6
-rw-r--r--include/asm-i386/mach-summit/mach_apic.h11
-rw-r--r--include/asm-i386/mach-visws/mach_apic.h6
-rw-r--r--include/asm-mips/dma-mapping.h12
-rw-r--r--include/asm-mips/pci.h3
-rw-r--r--include/asm-parisc/mmu_context.h5
-rw-r--r--include/asm-parisc/tlbflush.h2
-rw-r--r--include/asm-ppc/highmem.h9
-rw-r--r--include/asm-ppc/pci.h9
-rw-r--r--include/asm-ppc64/pci.h6
-rw-r--r--include/asm-ppc64/topology.h3
-rw-r--r--include/asm-s390/idals.h6
-rw-r--r--include/asm-sh/spinlock.h3
-rw-r--r--include/asm-sparc64/floppy.h5
-rw-r--r--include/asm-sparc64/tlbflush.h3
-rw-r--r--include/asm-x86_64/pgalloc.h9
-rw-r--r--include/asm-x86_64/spinlock.h18
-rw-r--r--include/linux/bio.h3
-rw-r--r--include/linux/bitmap.h140
-rw-r--r--include/linux/blkdev.h4
-rw-r--r--include/linux/buffer_head.h3
-rw-r--r--include/linux/dcache.h3
-rw-r--r--include/linux/device.h10
-rw-r--r--include/linux/efi.h16
-rw-r--r--include/linux/ext2_fs_sb.h1
-rw-r--r--include/linux/ext3_fs_sb.h1
-rw-r--r--include/linux/ext3_jbd.h17
-rw-r--r--include/linux/fs.h7
-rw-r--r--include/linux/highmem.h3
-rw-r--r--include/linux/input.h3
-rw-r--r--include/linux/kobject.h1
-rw-r--r--include/linux/miscdevice.h3
-rw-r--r--include/linux/mm.h62
-rw-r--r--include/linux/mmzone.h22
-rw-r--r--include/linux/module.h3
-rw-r--r--include/linux/moduleparam.h1
-rw-r--r--include/linux/netdevice.h4
-rw-r--r--include/linux/nfs_fs.h3
-rw-r--r--include/linux/pci_ids.h1
-rw-r--r--include/linux/quotaops.h6
-rw-r--r--include/linux/sched.h2
-rw-r--r--include/linux/smp_lock.h3
-rw-r--r--include/net/sock.h4
-rw-r--r--include/net/tcp.h2
-rw-r--r--include/rxrpc/call.h3
-rw-r--r--include/rxrpc/connection.h3
-rw-r--r--include/rxrpc/message.h3
-rw-r--r--include/rxrpc/peer.h3
-rw-r--r--include/rxrpc/transport.h3
-rw-r--r--include/sound/core.h1
60 files changed, 252 insertions, 253 deletions
diff --git a/include/asm-alpha/processor.h b/include/asm-alpha/processor.h
index fe03e7309686..3c750a362c44 100644
--- a/include/asm-alpha/processor.h
+++ b/include/asm-alpha/processor.h
@@ -78,6 +78,11 @@ unsigned long get_wchan(struct task_struct *p);
#define ARCH_HAS_PREFETCHW
#define ARCH_HAS_SPINLOCK_PREFETCH
+#ifndef CONFIG_SMP
+/* Nothing to prefetch. */
+#define spin_lock_prefetch(lock) do { } while (0)
+#endif
+
#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)
extern inline void prefetch(const void *ptr)
{
@@ -89,10 +94,13 @@ extern inline void prefetchw(const void *ptr)
__builtin_prefetch(ptr, 1, 3);
}
+#ifdef CONFIG_SMP
extern inline void spin_lock_prefetch(const void *ptr)
{
__builtin_prefetch(ptr, 1, 3);
}
+#endif
+
#else
extern inline void prefetch(const void *ptr)
{
@@ -104,10 +112,13 @@ extern inline void prefetchw(const void *ptr)
__asm__ ("ldq $31,%0" : : "m"(*(char *)ptr));
}
+#ifdef CONFIG_SMP
extern inline void spin_lock_prefetch(const void *ptr)
{
__asm__ ("ldq $31,%0" : : "m"(*(char *)ptr));
}
+#endif
+
#endif /* GCC 3.1 */
#endif /* __ASM_ALPHA_PROCESSOR_H */
diff --git a/include/asm-alpha/topology.h b/include/asm-alpha/topology.h
index 742b68802fd0..dbdb0d4f90e1 100644
--- a/include/asm-alpha/topology.h
+++ b/include/asm-alpha/topology.h
@@ -16,8 +16,7 @@ static inline int cpu_to_node(int cpu)
node = alpha_mv.cpuid_to_nid(cpu);
#ifdef DEBUG_NUMA
- if (node < 0)
- BUG();
+ BUG_ON(node < 0);
#endif
return node;
diff --git a/include/asm-arm/arch-ebsa285/io.h b/include/asm-arm/arch-ebsa285/io.h
index aac50402bc1b..8511b2ce534f 100644
--- a/include/asm-arm/arch-ebsa285/io.h
+++ b/include/asm-arm/arch-ebsa285/io.h
@@ -27,15 +27,13 @@
static inline unsigned long ___mem_pci(unsigned long a)
{
- if (a <= 0xc0000000 || a >= 0xe0000000)
- BUG();
+ BUG_ON(a <= 0xc0000000 || a >= 0xe0000000);
return a;
}
static inline unsigned long ___mem_isa(unsigned long a)
{
- if (a >= 16*1048576)
- BUG();
+ BUG_ON(a >= 16*1048576);
return PCIMEM_BASE + a;
}
#define __mem_pci(a) ___mem_pci((unsigned long)(a))
diff --git a/include/asm-arm/arch-nexuspci/io.h b/include/asm-arm/arch-nexuspci/io.h
index 8afa61e6acba..181bdb5988df 100644
--- a/include/asm-arm/arch-nexuspci/io.h
+++ b/include/asm-arm/arch-nexuspci/io.h
@@ -28,8 +28,7 @@ static inline unsigned long ___mem_pci(unsigned long a)
static inline unsigned long ___mem_isa(unsigned long a)
{
- if (a >= 16*1048576)
- BUG();
+ BUG_ON(a >= 16*1048576);
return PCIMEM_BASE + a;
}
#define __mem_pci(a) ___mem_pci((unsigned long)(a))
diff --git a/include/asm-i386/genapic.h b/include/asm-i386/genapic.h
index 76465ccbbdf8..7a165f27c880 100644
--- a/include/asm-i386/genapic.h
+++ b/include/asm-i386/genapic.h
@@ -45,6 +45,7 @@ struct genapic {
void (*setup_portio_remap)(void);
int (*check_phys_apicid_present)(int boot_cpu_physical_apicid);
void (*enable_apic_mode)(void);
+ u32 (*phys_pkg_id)(u32 cpuid_apic, int index_msb);
/* mpparse */
void (*mpc_oem_bus_info)(struct mpc_config_bus *, char *,
@@ -105,6 +106,7 @@ struct genapic {
APICFUNC(send_IPI_allbutself), \
APICFUNC(send_IPI_all), \
APICFUNC(enable_apic_mode), \
+ APICFUNC(phys_pkg_id), \
}
extern struct genapic *genapic;
diff --git a/include/asm-i386/hpet.h b/include/asm-i386/hpet.h
index ffc472ff5418..9382e160c46d 100644
--- a/include/asm-i386/hpet.h
+++ b/include/asm-i386/hpet.h
@@ -54,14 +54,10 @@
#define HPET_T2_CMP 0x148
#define HPET_T2_ROUTE 0x150
-#define HPET_ID_VENDOR 0xffff0000
#define HPET_ID_LEGSUP 0x00008000
#define HPET_ID_NUMBER 0x00001f00
#define HPET_ID_REV 0x000000ff
-#define HPET_ID_VENDOR_SHIFT 16
-#define HPET_ID_VENDOR_8086 0x8086
-
#define HPET_CFG_ENABLE 0x001
#define HPET_CFG_LEGACY 0x002
diff --git a/include/asm-i386/mach-bigsmp/mach_apic.h b/include/asm-i386/mach-bigsmp/mach_apic.h
index 0e9855144660..12980e389c65 100644
--- a/include/asm-i386/mach-bigsmp/mach_apic.h
+++ b/include/asm-i386/mach-bigsmp/mach_apic.h
@@ -173,4 +173,9 @@ static inline unsigned int cpu_mask_to_apicid(cpumask_const_t cpumask)
return apicid;
}
+static inline u32 phys_pkg_id(u32 cpuid_apic, int index_msb)
+{
+ return cpuid_apic >> index_msb;
+}
+
#endif /* __ASM_MACH_APIC_H */
diff --git a/include/asm-i386/mach-default/mach_apic.h b/include/asm-i386/mach-default/mach_apic.h
index 1d427aadfa41..5111b015f710 100644
--- a/include/asm-i386/mach-default/mach_apic.h
+++ b/include/asm-i386/mach-default/mach_apic.h
@@ -127,4 +127,9 @@ static inline void enable_apic_mode(void)
{
}
+static inline u32 phys_pkg_id(u32 cpuid_apic, int index_msb)
+{
+ return cpuid_apic >> index_msb;
+}
+
#endif /* __ASM_MACH_APIC_H */
diff --git a/include/asm-i386/mach-es7000/mach_apic.h b/include/asm-i386/mach-es7000/mach_apic.h
index e15b73c7e113..72e87d081af6 100644
--- a/include/asm-i386/mach-es7000/mach_apic.h
+++ b/include/asm-i386/mach-es7000/mach_apic.h
@@ -192,4 +192,9 @@ static inline unsigned int cpu_mask_to_apicid(cpumask_const_t cpumask)
return apicid;
}
+static inline u32 phys_pkg_id(u32 cpuid_apic, int index_msb)
+{
+ return cpuid_apic >> index_msb;
+}
+
#endif /* __ASM_MACH_APIC_H */
diff --git a/include/asm-i386/mach-generic/mach_apic.h b/include/asm-i386/mach-generic/mach_apic.h
index 21f0e75f1b25..ed349c793beb 100644
--- a/include/asm-i386/mach-generic/mach_apic.h
+++ b/include/asm-i386/mach-generic/mach_apic.h
@@ -27,5 +27,6 @@
#define check_apicid_used (genapic->check_apicid_used)
#define cpu_mask_to_apicid (genapic->cpu_mask_to_apicid)
#define enable_apic_mode (genapic->enable_apic_mode)
+#define phys_pkg_id (genapic->phys_pkg_id)
#endif /* __ASM_MACH_APIC_H */
diff --git a/include/asm-i386/mach-numaq/mach_apic.h b/include/asm-i386/mach-numaq/mach_apic.h
index 814ee9aa2521..743bb69aa275 100644
--- a/include/asm-i386/mach-numaq/mach_apic.h
+++ b/include/asm-i386/mach-numaq/mach_apic.h
@@ -141,4 +141,10 @@ static inline unsigned int cpu_mask_to_apicid(cpumask_const_t cpumask)
return (int) 0xF;
}
+/* No NUMA-Q box has a HT CPU, but it can't hurt to use the default code. */
+static inline u32 phys_pkg_id(u32 cpuid_apic, int index_msb)
+{
+ return cpuid_apic >> index_msb;
+}
+
#endif /* __ASM_MACH_APIC_H */
diff --git a/include/asm-i386/mach-summit/mach_apic.h b/include/asm-i386/mach-summit/mach_apic.h
index a10b4591737e..accca8fcc970 100644
--- a/include/asm-i386/mach-summit/mach_apic.h
+++ b/include/asm-i386/mach-summit/mach_apic.h
@@ -173,4 +173,15 @@ static inline unsigned int cpu_mask_to_apicid(cpumask_const_t cpumask)
return apicid;
}
+/* cpuid returns the value latched in the HW at reset, not the APIC ID
+ * register's value. For any box whose BIOS changes APIC IDs, like
+ * clustered APIC systems, we must use hard_smp_processor_id.
+ *
+ * See Intel's IA-32 SW Dev's Manual Vol2 under CPUID.
+ */
+static inline u32 phys_pkg_id(u32 cpuid_apic, int index_msb)
+{
+ return hard_smp_processor_id() >> index_msb;
+}
+
#endif /* __ASM_MACH_APIC_H */
diff --git a/include/asm-i386/mach-visws/mach_apic.h b/include/asm-i386/mach-visws/mach_apic.h
index 9a0208496458..3ec402a3a96a 100644
--- a/include/asm-i386/mach-visws/mach_apic.h
+++ b/include/asm-i386/mach-visws/mach_apic.h
@@ -88,4 +88,10 @@ static inline unsigned int cpu_mask_to_apicid(cpumask_const_t cpumask)
{
return cpus_coerce_const(cpumask);
}
+
+static inline u32 phys_pkg_id(u32 cpuid_apic, int index_msb)
+{
+ return cpuid_apic >> index_msb;
+}
+
#endif /* __ASM_MACH_APIC_H */
diff --git a/include/asm-mips/dma-mapping.h b/include/asm-mips/dma-mapping.h
index 7b6254324cc9..d72e991e4a2b 100644
--- a/include/asm-mips/dma-mapping.h
+++ b/include/asm-mips/dma-mapping.h
@@ -124,8 +124,7 @@ dma_unmap_sg(struct device *dev, struct scatterlist *sg, int nhwentries,
for (i = 0; i < nhwentries; i++, sg++) {
unsigned long addr;
- if (!sg->page)
- BUG();
+ BUG_ON(!sg->page);
addr = (unsigned long) page_address(sg->page);
if (addr)
@@ -139,8 +138,7 @@ dma_sync_single(struct device *dev, dma_addr_t dma_handle, size_t size,
{
unsigned long addr;
- if (direction == DMA_NONE)
- BUG();
+ BUG_ON(direction == DMA_NONE);
addr = baddr_to_bus(hwdev->bus, dma_handle) + PAGE_OFFSET;
dma_cache_wback_inv(addr, size);
@@ -153,8 +151,7 @@ dma_sync_single_range(struct device *dev, dma_addr_t dma_handle,
{
unsigned long addr;
- if (direction == DMA_NONE)
- BUG();
+ BUG_ON(direction == DMA_NONE);
addr = baddr_to_bus(hwdev->bus, dma_handle) + PAGE_OFFSET;
dma_cache_wback_inv(addr, size);
@@ -168,8 +165,7 @@ dma_sync_sg(struct device *dev, struct scatterlist *sg, int nelems,
int i;
#endif
- if (direction == DMA_NONE)
- BUG();
+ BUG_ON(direction == DMA_NONE);
/* Make sure that gcc doesn't leave the empty loop body. */
#ifdef CONFIG_NONCOHERENT_IO
diff --git a/include/asm-mips/pci.h b/include/asm-mips/pci.h
index 56e01db6f45d..cd96c958408f 100644
--- a/include/asm-mips/pci.h
+++ b/include/asm-mips/pci.h
@@ -113,8 +113,7 @@ static inline void pci_dac_dma_sync_single(struct pci_dev *pdev,
{
unsigned long addr;
- if (direction == PCI_DMA_NONE)
- BUG();
+ BUG_ON(direction == PCI_DMA_NONE);
addr = baddr_to_bus(pdev->bus, dma_addr) + PAGE_OFFSET;
dma_cache_wback_inv(addr, len);
diff --git a/include/asm-parisc/mmu_context.h b/include/asm-parisc/mmu_context.h
index 6327156282f2..9c05836239a2 100644
--- a/include/asm-parisc/mmu_context.h
+++ b/include/asm-parisc/mmu_context.h
@@ -19,8 +19,7 @@ extern void free_sid(unsigned long);
static inline int
init_new_context(struct task_struct *tsk, struct mm_struct *mm)
{
- if (atomic_read(&mm->mm_users) != 1)
- BUG();
+ BUG_ON(atomic_read(&mm->mm_users) != 1);
mm->context = alloc_sid();
return 0;
@@ -64,7 +63,7 @@ static inline void activate_mm(struct mm_struct *prev, struct mm_struct *next)
* already, so we should be OK.
*/
- if (next == &init_mm) BUG(); /* Should never happen */
+ BUG_ON(next == &init_mm); /* Should never happen */
if (next->context == 0)
next->context = alloc_sid();
diff --git a/include/asm-parisc/tlbflush.h b/include/asm-parisc/tlbflush.h
index a5b731f654cb..86ba2c7ec6f3 100644
--- a/include/asm-parisc/tlbflush.h
+++ b/include/asm-parisc/tlbflush.h
@@ -27,7 +27,7 @@ extern void flush_tlb_all(void);
static inline void flush_tlb_mm(struct mm_struct *mm)
{
- if (mm == &init_mm) BUG(); /* Should never happen */
+ BUG_ON(mm == &init_mm); /* Should never happen */
#ifdef CONFIG_SMP
flush_tlb_all();
diff --git a/include/asm-ppc/highmem.h b/include/asm-ppc/highmem.h
index c13b4e495519..ca057b43a2ee 100644
--- a/include/asm-ppc/highmem.h
+++ b/include/asm-ppc/highmem.h
@@ -63,8 +63,7 @@ static inline void *kmap(struct page *page)
static inline void kunmap(struct page *page)
{
- if (in_interrupt())
- BUG();
+ BUG_ON(in_interrupt());
if (page < highmem_start_page)
return;
kunmap_high(page);
@@ -89,8 +88,7 @@ static inline void *kmap_atomic(struct page *page, enum km_type type)
idx = type + KM_TYPE_NR*smp_processor_id();
vaddr = KMAP_FIX_BEGIN + idx * PAGE_SIZE;
#if HIGHMEM_DEBUG
- if (!pte_none(*(kmap_pte+idx)))
- BUG();
+ BUG_ON(!pte_none(*(kmap_pte+idx)));
#endif
set_pte(kmap_pte+idx, mk_pte(page, kmap_prot));
flush_tlb_page(0, vaddr);
@@ -110,8 +108,7 @@ static inline void kunmap_atomic(void *kvaddr, enum km_type type)
return;
}
- if (vaddr != KMAP_FIX_BEGIN + idx * PAGE_SIZE)
- BUG();
+ BUG_ON(vaddr != KMAP_FIX_BEGIN + idx * PAGE_SIZE);
/*
* force other mappings to Oops if they'll try to access
diff --git a/include/asm-ppc/pci.h b/include/asm-ppc/pci.h
index 763765257bfc..5dad69a5ee61 100644
--- a/include/asm-ppc/pci.h
+++ b/include/asm-ppc/pci.h
@@ -105,8 +105,7 @@ static inline dma_addr_t pci_map_single(struct pci_dev *hwdev, void *ptr,
static inline void pci_unmap_single(struct pci_dev *hwdev, dma_addr_t dma_addr,
size_t size, int direction)
{
- if (direction == PCI_DMA_NONE)
- BUG();
+ BUG_ON(direction == PCI_DMA_NONE);
/* nothing to do */
}
@@ -134,8 +133,7 @@ static inline dma_addr_t pci_map_page(struct pci_dev *hwdev, struct page *page,
static inline void pci_unmap_page(struct pci_dev *hwdev, dma_addr_t dma_address,
size_t size, int direction)
{
- if (direction == PCI_DMA_NONE)
- BUG();
+ BUG_ON(direction == PCI_DMA_NONE);
/* Nothing to do */
}
@@ -159,8 +157,7 @@ static inline int pci_map_sg(struct pci_dev *hwdev, struct scatterlist *sg,
{
int i;
- if (direction == PCI_DMA_NONE)
- BUG();
+ BUG_ON(direction == PCI_DMA_NONE);
/*
* temporary 2.4 hack
diff --git a/include/asm-ppc64/pci.h b/include/asm-ppc64/pci.h
index 5c3515a500a9..305ca8cd8235 100644
--- a/include/asm-ppc64/pci.h
+++ b/include/asm-ppc64/pci.h
@@ -65,8 +65,7 @@ static inline void pci_dma_sync_single(struct pci_dev *hwdev,
dma_addr_t dma_handle,
size_t size, int direction)
{
- if (direction == PCI_DMA_NONE)
- BUG();
+ BUG_ON(direction == PCI_DMA_NONE);
/* nothing to do */
}
@@ -74,8 +73,7 @@ static inline void pci_dma_sync_sg(struct pci_dev *hwdev,
struct scatterlist *sg,
int nelems, int direction)
{
- if (direction == PCI_DMA_NONE)
- BUG();
+ BUG_ON(direction == PCI_DMA_NONE);
/* nothing to do */
}
diff --git a/include/asm-ppc64/topology.h b/include/asm-ppc64/topology.h
index 9be503f666f9..a41ca6cba882 100644
--- a/include/asm-ppc64/topology.h
+++ b/include/asm-ppc64/topology.h
@@ -13,8 +13,7 @@ static inline int cpu_to_node(int cpu)
node = numa_cpu_lookup_table[cpu];
#ifdef DEBUG_NUMA
- if (node == -1)
- BUG();
+ BUG_ON(node == -1);
#endif
return node;
diff --git a/include/asm-s390/idals.h b/include/asm-s390/idals.h
index 64c783f9b7f2..890bc145f9dd 100644
--- a/include/asm-s390/idals.h
+++ b/include/asm-s390/idals.h
@@ -223,8 +223,7 @@ idal_buffer_to_user(struct idal_buffer *ib, void *to, size_t count)
size_t left;
int i;
- if (count > ib->size)
- BUG();
+ BUG_ON(count > ib->size);
for (i = 0; count > IDA_BLOCK_SIZE; i++) {
left = copy_to_user(to, ib->data[i], IDA_BLOCK_SIZE);
if (left)
@@ -244,8 +243,7 @@ idal_buffer_from_user(struct idal_buffer *ib, const void *from, size_t count)
size_t left;
int i;
- if (count > ib->size)
- BUG();
+ BUG_ON(count > ib->size);
for (i = 0; count > IDA_BLOCK_SIZE; i++) {
left = copy_from_user(ib->data[i], from, IDA_BLOCK_SIZE);
if (left)
diff --git a/include/asm-sh/spinlock.h b/include/asm-sh/spinlock.h
index c0adea380ac7..9930f93b1f14 100644
--- a/include/asm-sh/spinlock.h
+++ b/include/asm-sh/spinlock.h
@@ -48,8 +48,7 @@ static inline void _raw_spin_lock(spinlock_t *lock)
static inline void _raw_spin_unlock(spinlock_t *lock)
{
#ifdef CONFIG_DEBUG_SPINLOCK
- if (!spin_is_locked(lock))
- BUG();
+ BUG_ON(!spin_is_locked(lock));
#endif
lock->lock = 0;
diff --git a/include/asm-sparc64/floppy.h b/include/asm-sparc64/floppy.h
index 8beed5df56b3..1bc43aaa49eb 100644
--- a/include/asm-sparc64/floppy.h
+++ b/include/asm-sparc64/floppy.h
@@ -320,10 +320,9 @@ static void sun_pci_fd_lde_broken_outb(unsigned char val, unsigned long port)
static void sun_pci_fd_enable_dma(void)
{
- if ((NULL == sun_pci_dma_pending.buf) ||
+ BUG_ON((NULL == sun_pci_dma_pending.buf) ||
(0 == sun_pci_dma_pending.len) ||
- (0 == sun_pci_dma_pending.direction))
- BUG();
+ (0 == sun_pci_dma_pending.direction));
sun_pci_dma_current.buf = sun_pci_dma_pending.buf;
sun_pci_dma_current.len = sun_pci_dma_pending.len;
diff --git a/include/asm-sparc64/tlbflush.h b/include/asm-sparc64/tlbflush.h
index 982829f3dc16..8c70fdd037b6 100644
--- a/include/asm-sparc64/tlbflush.h
+++ b/include/asm-sparc64/tlbflush.h
@@ -90,10 +90,9 @@ static __inline__ void flush_tlb_pgtables(struct mm_struct *mm, unsigned long st
{
/* Note the signed type. */
long s = start, e = end, vpte_base;
- if (s > e)
/* Nobody should call us with start below VM hole and end above.
See if it is really true. */
- BUG();
+ BUG_ON(s > e);
#if 0
/* Currently free_pgtables guarantees this. */
s &= PMD_MASK;
diff --git a/include/asm-x86_64/pgalloc.h b/include/asm-x86_64/pgalloc.h
index e15895c99a4e..bebcaab3375c 100644
--- a/include/asm-x86_64/pgalloc.h
+++ b/include/asm-x86_64/pgalloc.h
@@ -24,8 +24,7 @@ extern __inline__ pmd_t *get_pmd(void)
extern __inline__ void pmd_free(pmd_t *pmd)
{
- if ((unsigned long)pmd & (PAGE_SIZE-1))
- BUG();
+ BUG_ON((unsigned long)pmd & (PAGE_SIZE-1));
free_page((unsigned long)pmd);
}
@@ -41,8 +40,7 @@ static inline pgd_t *pgd_alloc (struct mm_struct *mm)
static inline void pgd_free (pgd_t *pgd)
{
- if ((unsigned long)pgd & (PAGE_SIZE-1))
- BUG();
+ BUG_ON((unsigned long)pgd & (PAGE_SIZE-1));
free_page((unsigned long)pgd);
}
@@ -64,8 +62,7 @@ static inline struct page *pte_alloc_one(struct mm_struct *mm, unsigned long add
extern __inline__ void pte_free_kernel(pte_t *pte)
{
- if ((unsigned long)pte & (PAGE_SIZE-1))
- BUG();
+ BUG_ON((unsigned long)pte & (PAGE_SIZE-1));
free_page((unsigned long)pte);
}
diff --git a/include/asm-x86_64/spinlock.h b/include/asm-x86_64/spinlock.h
index ae3615feecdb..c341097c7106 100644
--- a/include/asm-x86_64/spinlock.h
+++ b/include/asm-x86_64/spinlock.h
@@ -70,10 +70,8 @@ typedef struct {
static inline void _raw_spin_unlock(spinlock_t *lock)
{
#ifdef CONFIG_DEBUG_SPINLOCK
- if (lock->magic != SPINLOCK_MAGIC)
- BUG();
- if (!spin_is_locked(lock))
- BUG();
+ BUG_ON(lock->magic != SPINLOCK_MAGIC);
+ BUG_ON(!spin_is_locked(lock));
#endif
__asm__ __volatile__(
spin_unlock_string
@@ -91,10 +89,8 @@ static inline void _raw_spin_unlock(spinlock_t *lock)
{
char oldval = 1;
#ifdef CONFIG_DEBUG_SPINLOCK
- if (lock->magic != SPINLOCK_MAGIC)
- BUG();
- if (!spin_is_locked(lock))
- BUG();
+ BUG_ON(lock->magic != SPINLOCK_MAGIC);
+ BUG_ON(!spin_is_locked(lock));
#endif
__asm__ __volatile__(
spin_unlock_string
@@ -174,8 +170,7 @@ typedef struct {
static inline void _raw_read_lock(rwlock_t *rw)
{
#ifdef CONFIG_DEBUG_SPINLOCK
- if (rw->magic != RWLOCK_MAGIC)
- BUG();
+ BUG_ON(rw->magic != RWLOCK_MAGIC);
#endif
__build_read_lock(rw, "__read_lock_failed");
}
@@ -183,8 +178,7 @@ static inline void _raw_read_lock(rwlock_t *rw)
static inline void _raw_write_lock(rwlock_t *rw)
{
#ifdef CONFIG_DEBUG_SPINLOCK
- if (rw->magic != RWLOCK_MAGIC)
- BUG();
+ BUG_ON(rw->magic != RWLOCK_MAGIC);
#endif
__build_write_lock(rw, "__write_lock_failed");
}
diff --git a/include/linux/bio.h b/include/linux/bio.h
index 4f090059372e..d3b4e9ed4052 100644
--- a/include/linux/bio.h
+++ b/include/linux/bio.h
@@ -266,8 +266,7 @@ extern inline char *bvec_kmap_irq(struct bio_vec *bvec, unsigned long *flags)
local_irq_save(*flags);
addr = (unsigned long) kmap_atomic(bvec->bv_page, KM_BIO_SRC_IRQ);
- if (addr & ~PAGE_MASK)
- BUG();
+ BUG_ON(addr & ~PAGE_MASK);
return (char *) addr + bvec->bv_offset;
}
diff --git a/include/linux/bitmap.h b/include/linux/bitmap.h
index 74b89ea0aae5..b84caaebed87 100644
--- a/include/linux/bitmap.h
+++ b/include/linux/bitmap.h
@@ -10,57 +10,11 @@
#include <linux/bitops.h>
#include <linux/string.h>
-static inline int bitmap_empty(const unsigned long *bitmap, int bits)
-{
- int k, lim = bits/BITS_PER_LONG;
- for (k = 0; k < lim; ++k)
- if (bitmap[k])
- return 0;
-
- if (bits % BITS_PER_LONG)
- if (bitmap[k] & ((1UL << (bits % BITS_PER_LONG)) - 1))
- return 0;
-
- return 1;
-}
-
-static inline int bitmap_full(const unsigned long *bitmap, int bits)
-{
- int k, lim = bits/BITS_PER_LONG;
- for (k = 0; k < lim; ++k)
- if (~bitmap[k])
- return 0;
-
- if (bits % BITS_PER_LONG)
- if (~bitmap[k] & ((1UL << (bits % BITS_PER_LONG)) - 1))
- return 0;
-
- return 1;
-}
-
-static inline int bitmap_equal(const unsigned long *bitmap1,
- unsigned long *bitmap2, int bits)
-{
- int k, lim = bits/BITS_PER_LONG;;
- for (k = 0; k < lim; ++k)
- if (bitmap1[k] != bitmap2[k])
- return 0;
-
- if (bits % BITS_PER_LONG)
- if ((bitmap1[k] ^ bitmap2[k]) &
- ((1UL << (bits % BITS_PER_LONG)) - 1))
- return 0;
-
- return 1;
-}
-
-static inline void bitmap_complement(unsigned long *bitmap, int bits)
-{
- int k;
-
- for (k = 0; k < BITS_TO_LONGS(bits); ++k)
- bitmap[k] = ~bitmap[k];
-}
+int bitmap_empty(const unsigned long *bitmap, int bits);
+int bitmap_full(const unsigned long *bitmap, int bits);
+int bitmap_equal(const unsigned long *bitmap1,
+ unsigned long *bitmap2, int bits);
+void bitmap_complement(unsigned long *bitmap, int bits);
static inline void bitmap_clear(unsigned long *bitmap, int bits)
{
@@ -78,81 +32,15 @@ static inline void bitmap_copy(unsigned long *dst,
memcpy(dst, src, BITS_TO_LONGS(bits)*sizeof(unsigned long));
}
-static inline void bitmap_shift_right(unsigned long *dst,
- const unsigned long *src, int shift, int bits)
-{
- int k;
- DECLARE_BITMAP(__shr_tmp, bits);
-
- bitmap_clear(__shr_tmp, bits);
- for (k = 0; k < bits - shift; ++k)
- if (test_bit(k + shift, src))
- set_bit(k, __shr_tmp);
- bitmap_copy(dst, __shr_tmp, bits);
-}
-
-static inline void bitmap_shift_left(unsigned long *dst,
- const unsigned long *src, int shift, int bits)
-{
- int k;
- DECLARE_BITMAP(__shl_tmp, bits);
-
- bitmap_clear(__shl_tmp, bits);
- for (k = bits; k >= shift; --k)
- if (test_bit(k - shift, src))
- set_bit(k, __shl_tmp);
- bitmap_copy(dst, __shl_tmp, bits);
-}
-
-static inline void bitmap_and(unsigned long *dst, const unsigned long *bitmap1,
- const unsigned long *bitmap2, int bits)
-{
- int k;
- int nr = BITS_TO_LONGS(bits);
-
- for (k = 0; k < nr; k++)
- dst[k] = bitmap1[k] & bitmap2[k];
-}
-
-static inline void bitmap_or(unsigned long *dst, const unsigned long *bitmap1,
- const unsigned long *bitmap2, int bits)
-{
- int k;
- int nr = BITS_TO_LONGS(bits);
-
- for (k = 0; k < nr; k++)
- dst[k] = bitmap1[k] | bitmap2[k];
-}
-
-#if BITS_PER_LONG == 32
-static inline int bitmap_weight(const unsigned long *bitmap, int bits)
-{
- int k, w = 0, lim = bits/BITS_PER_LONG;
-
- for (k = 0; k < lim; k++)
- w += hweight32(bitmap[k]);
-
- if (bits % BITS_PER_LONG)
- w += hweight32(bitmap[k] &
- ((1UL << (bits % BITS_PER_LONG)) - 1));
-
- return w;
-}
-#else
-static inline int bitmap_weight(const unsigned long *bitmap, int bits)
-{
- int k, w = 0, lim = bits/BITS_PER_LONG;
-
- for (k = 0; k < lim; k++)
- w += hweight64(bitmap[k]);
-
- if (bits % BITS_PER_LONG)
- w += hweight64(bitmap[k] &
- ((1UL << (bits % BITS_PER_LONG)) - 1));
-
- return w;
-}
-#endif
+void bitmap_shift_right(unsigned long *dst,
+ const unsigned long *src, int shift, int bits);
+void bitmap_shift_left(unsigned long *dst,
+ const unsigned long *src, int shift, int bits);
+void bitmap_and(unsigned long *dst, const unsigned long *bitmap1,
+ const unsigned long *bitmap2, int bits);
+void bitmap_or(unsigned long *dst, const unsigned long *bitmap1,
+ const unsigned long *bitmap2, int bits);
+int bitmap_weight(const unsigned long *bitmap, int bits);
#endif /* __ASSEMBLY__ */
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index a1c5cd076331..80b4c47842b8 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -483,9 +483,9 @@ static inline void blk_queue_bounce(request_queue_t *q, struct bio **bio)
}
#endif /* CONFIG_MMU */
-#define rq_for_each_bio(bio, rq) \
+#define rq_for_each_bio(_bio, rq) \
if ((rq->bio)) \
- for (bio = (rq)->bio; bio; bio = bio->bi_next)
+ for (_bio = (rq)->bio; _bio; _bio = bio->bi_next)
struct sec_size {
unsigned block_size;
diff --git a/include/linux/buffer_head.h b/include/linux/buffer_head.h
index 5f4b675a7bb4..110584f07883 100644
--- a/include/linux/buffer_head.h
+++ b/include/linux/buffer_head.h
@@ -125,8 +125,7 @@ BUFFER_FNS(Write_EIO,write_io_error)
/* If we *know* page->private refers to buffer_heads */
#define page_buffers(page) \
({ \
- if (!PagePrivate(page)) \
- BUG(); \
+ BUG_ON(!PagePrivate(page)); \
((struct buffer_head *)(page)->private); \
})
#define page_has_buffers(page) PagePrivate(page)
diff --git a/include/linux/dcache.h b/include/linux/dcache.h
index 6bd0570d3a1c..6b2ea8fecf06 100644
--- a/include/linux/dcache.h
+++ b/include/linux/dcache.h
@@ -270,8 +270,7 @@ extern char * d_path(struct dentry *, struct vfsmount *, char *, int);
static inline struct dentry *dget(struct dentry *dentry)
{
if (dentry) {
- if (!atomic_read(&dentry->d_count))
- BUG();
+ BUG_ON(!atomic_read(&dentry->d_count));
atomic_inc(&dentry->d_count);
}
return dentry;
diff --git a/include/linux/device.h b/include/linux/device.h
index 8f008e19b83f..367b21888ad4 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -46,6 +46,7 @@ struct device;
struct device_driver;
struct class;
struct class_device;
+struct class_simple;
struct bus_type {
char * name;
@@ -155,6 +156,7 @@ struct class {
int num_envp, char *buffer, int buffer_size);
void (*release)(struct class_device *dev);
+ void (*class_release)(struct class *class);
};
extern int class_register(struct class *);
@@ -246,6 +248,13 @@ struct class_interface {
extern int class_interface_register(struct class_interface *);
extern void class_interface_unregister(struct class_interface *);
+/* interface for class simple stuff */
+extern struct class_simple *class_simple_create(struct module *owner, char *name);
+extern void class_simple_destroy(struct class_simple *cs);
+extern struct class_device *class_simple_device_add(struct class_simple *cs, dev_t dev, struct device *device, const char *fmt, ...)
+ __attribute__((format(printf,4,5)));
+extern void class_simple_device_remove(dev_t dev);
+
struct device {
struct list_head node; /* node in sibling list */
@@ -354,6 +363,7 @@ extern int (*platform_notify_remove)(struct device * dev);
*/
extern struct device * get_device(struct device * dev);
extern void put_device(struct device * dev);
+extern struct device *device_find(const char *name, struct bus_type *bus);
/* drivers/base/platform.c */
diff --git a/include/linux/efi.h b/include/linux/efi.h
index 86e9d2ebb5eb..a1764b1fb106 100644
--- a/include/linux/efi.h
+++ b/include/linux/efi.h
@@ -297,14 +297,22 @@ extern u64 efi_mem_attributes (unsigned long phys_addr);
extern void efi_initialize_iomem_resources(struct resource *code_resource,
struct resource *data_resource);
extern efi_status_t phys_efi_get_time(efi_time_t *tm, efi_time_cap_t *tc);
-extern unsigned long inline __init efi_get_time(void);
-extern int inline __init efi_set_rtc_mmss(unsigned long nowtime);
+extern inline unsigned long __init efi_get_time(void);
+extern inline int __init efi_set_rtc_mmss(unsigned long nowtime);
extern struct efi_memory_map memmap;
+/*
+ * We play games with efi_enabled so that the compiler will, if possible, remove
+ * EFI-related code altogether.
+ */
#ifdef CONFIG_EFI
-extern int efi_enabled;
+# ifdef CONFIG_X86
+ extern int efi_enabled;
+# else
+# define efi_enabled 1
+# endif
#else
-#define efi_enabled 0
+# define efi_enabled 0
#endif
/*
diff --git a/include/linux/ext2_fs_sb.h b/include/linux/ext2_fs_sb.h
index 13178c16c7ea..4eda0ed76a48 100644
--- a/include/linux/ext2_fs_sb.h
+++ b/include/linux/ext2_fs_sb.h
@@ -45,6 +45,7 @@ struct ext2_sb_info {
int s_desc_per_block_bits;
int s_inode_size;
int s_first_ino;
+ spinlock_t s_next_gen_lock;
u32 s_next_generation;
unsigned long s_dir_count;
u8 *s_debts;
diff --git a/include/linux/ext3_fs_sb.h b/include/linux/ext3_fs_sb.h
index e9b4012cc776..590fd69ec045 100644
--- a/include/linux/ext3_fs_sb.h
+++ b/include/linux/ext3_fs_sb.h
@@ -49,6 +49,7 @@ struct ext3_sb_info {
int s_desc_per_block_bits;
int s_inode_size;
int s_first_ino;
+ spinlock_t s_next_gen_lock;
u32 s_next_generation;
u32 s_hash_seed[4];
int s_def_hash_version;
diff --git a/include/linux/ext3_jbd.h b/include/linux/ext3_jbd.h
index 50caf6875ba4..a3555b48cccb 100644
--- a/include/linux/ext3_jbd.h
+++ b/include/linux/ext3_jbd.h
@@ -221,13 +221,24 @@ static inline int ext3_should_journal_data(struct inode *inode)
static inline int ext3_should_order_data(struct inode *inode)
{
- return (test_opt(inode->i_sb, DATA_FLAGS) == EXT3_MOUNT_ORDERED_DATA);
+ if (!S_ISREG(inode->i_mode))
+ return 0;
+ if (EXT3_I(inode)->i_flags & EXT3_JOURNAL_DATA_FL)
+ return 0;
+ if (test_opt(inode->i_sb, DATA_FLAGS) == EXT3_MOUNT_ORDERED_DATA)
+ return 1;
+ return 0;
}
static inline int ext3_should_writeback_data(struct inode *inode)
{
- return !ext3_should_journal_data(inode) &&
- !ext3_should_order_data(inode);
+ if (!S_ISREG(inode->i_mode))
+ return 0;
+ if (EXT3_I(inode)->i_flags & EXT3_JOURNAL_DATA_FL)
+ return 0;
+ if (test_opt(inode->i_sb, DATA_FLAGS) == EXT3_MOUNT_WRITEBACK_DATA)
+ return 1;
+ return 0;
}
#endif /* _LINUX_EXT3_JBD_H */
diff --git a/include/linux/fs.h b/include/linux/fs.h
index fd3c87c86d6f..7d9154665d9b 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -353,6 +353,13 @@ struct block_device {
int bd_invalidated;
struct gendisk * bd_disk;
struct list_head bd_list;
+ /*
+ * Private data. You must have bd_claim'ed the block_device
+ * to use this. NOTE: bd_claim allows an owner to claim
+ * the same device multiple times, the owner must take special
+ * care to not mess up bd_private for that case.
+ */
+ unsigned long bd_private;
};
/*
diff --git a/include/linux/highmem.h b/include/linux/highmem.h
index 2c9139a94f8f..232d8fdb557c 100644
--- a/include/linux/highmem.h
+++ b/include/linux/highmem.h
@@ -56,8 +56,7 @@ static inline void memclear_highpage_flush(struct page *page, unsigned int offse
{
void *kaddr;
- if (offset + size > PAGE_SIZE)
- BUG();
+ BUG_ON(offset + size > PAGE_SIZE);
kaddr = kmap_atomic(page, KM_USER0);
memset((char *)kaddr + offset, 0, size);
diff --git a/include/linux/input.h b/include/linux/input.h
index eff36f445c25..4cb08d4fbd5e 100644
--- a/include/linux/input.h
+++ b/include/linux/input.h
@@ -809,6 +809,7 @@ struct input_dev {
int (*erase_effect)(struct input_dev *dev, int effect_id);
struct input_handle *grab;
+ struct device *dev;
struct list_head h_list;
struct list_head node;
@@ -921,7 +922,7 @@ void input_event(struct input_dev *dev, unsigned int type, unsigned int code, in
#define input_regs(a,b) do { (a)->regs = (b); } while (0)
#define input_sync(a) do { input_event(a, EV_SYN, SYN_REPORT, 0); (a)->regs = NULL; } while (0)
-extern struct class input_class;
+extern struct class_simple *input_class;
#endif
#endif
diff --git a/include/linux/kobject.h b/include/linux/kobject.h
index 42174b623637..2b127488d33e 100644
--- a/include/linux/kobject.h
+++ b/include/linux/kobject.h
@@ -56,6 +56,7 @@ extern void kobject_unregister(struct kobject *);
extern struct kobject * kobject_get(struct kobject *);
extern void kobject_put(struct kobject *);
+extern void kobject_hotplug(const char *action, struct kobject *);
struct kobj_type {
void (*release)(struct kobject *);
diff --git a/include/linux/miscdevice.h b/include/linux/miscdevice.h
index 6b7f9c1fa5cd..98f61665d4c2 100644
--- a/include/linux/miscdevice.h
+++ b/include/linux/miscdevice.h
@@ -36,12 +36,15 @@
#define TUN_MINOR 200
+struct device;
+
struct miscdevice
{
int minor;
const char *name;
struct file_operations *fops;
struct list_head list;
+ struct device *dev;
char devfs_name[64];
};
diff --git a/include/linux/mm.h b/include/linux/mm.h
index 881091514f01..3ecd3d633c5f 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -223,7 +223,6 @@ struct page {
atomic_dec_and_test(&(p)->count); \
})
-#define page_count(p) atomic_read(&(p)->count)
#define set_page_count(p,v) atomic_set(&(p)->count, v)
#define __put_page(p) atomic_dec(&(p)->count)
@@ -231,6 +230,13 @@ extern void FASTCALL(__page_cache_release(struct page *));
#ifdef CONFIG_HUGETLB_PAGE
+static inline int page_count(struct page *p)
+{
+ if (PageCompound(p))
+ p = (struct page *)p->lru.next;
+ return atomic_read(&(p)->count);
+}
+
static inline void get_page(struct page *page)
{
if (PageCompound(page))
@@ -257,6 +263,8 @@ static inline void put_page(struct page *page)
#else /* CONFIG_HUGETLB_PAGE */
+#define page_count(p) atomic_read(&(p)->count)
+
static inline void get_page(struct page *page)
{
atomic_inc(&page->count);
@@ -322,23 +330,33 @@ static inline void put_page(struct page *page)
/*
* The zone field is never updated after free_area_init_core()
* sets it, so none of the operations on it need to be atomic.
- * We'll have up to log2(MAX_NUMNODES * MAX_NR_ZONES) zones
- * total, so we use NODES_SHIFT here to get enough bits.
+ * We'll have up to (MAX_NUMNODES * MAX_NR_ZONES) zones total,
+ * so we use (MAX_NODES_SHIFT + MAX_ZONES_SHIFT) here to get enough bits.
*/
-#define ZONE_SHIFT (BITS_PER_LONG - NODES_SHIFT - MAX_NR_ZONES_SHIFT)
+#define NODEZONE_SHIFT (BITS_PER_LONG - MAX_NODES_SHIFT - MAX_ZONES_SHIFT)
+#define NODEZONE(node, zone) ((node << ZONES_SHIFT) | zone)
+
+static inline unsigned long page_zonenum(struct page *page)
+{
+ return (page->flags >> NODEZONE_SHIFT) & (~(~0UL << ZONES_SHIFT));
+}
+static inline unsigned long page_nodenum(struct page *page)
+{
+ return (page->flags >> (NODEZONE_SHIFT + ZONES_SHIFT));
+}
struct zone;
extern struct zone *zone_table[];
static inline struct zone *page_zone(struct page *page)
{
- return zone_table[page->flags >> ZONE_SHIFT];
+ return zone_table[page->flags >> NODEZONE_SHIFT];
}
-static inline void set_page_zone(struct page *page, unsigned long zone_num)
+static inline void set_page_zone(struct page *page, unsigned long nodezone_num)
{
- page->flags &= ~(~0UL << ZONE_SHIFT);
- page->flags |= zone_num << ZONE_SHIFT;
+ page->flags &= ~(~0UL << NODEZONE_SHIFT);
+ page->flags |= nodezone_num << NODEZONE_SHIFT;
}
#ifndef CONFIG_DISCONTIGMEM
@@ -624,5 +642,33 @@ kernel_map_pages(struct page *page, int numpages, int enable)
}
#endif
+#ifndef CONFIG_ARCH_GATE_AREA
+#ifdef AT_SYSINFO_EHDR
+static inline int in_gate_area(struct task_struct *task, unsigned long addr)
+{
+ if ((addr >= FIXADDR_USER_START) && (addr < FIXADDR_USER_END))
+ return 1;
+ else
+ return 0;
+}
+
+extern struct vm_area_struct gate_vma;
+static inline struct vm_area_struct *get_gate_vma(struct task_struct *tsk)
+{
+ return &gate_vma;
+}
+#else
+static inline int in_gate_area(struct task_struct *task, unsigned long addr)
+{
+ return 0;
+}
+
+static inline struct vm_area_struct *get_gate_vma(struct task_struct *tsk)
+{
+ return NULL;
+}
+#endif
+#endif
+
#endif /* __KERNEL__ */
#endif /* _LINUX_MM_H */
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
index a089e01dad03..66cbaa36d878 100644
--- a/include/linux/mmzone.h
+++ b/include/linux/mmzone.h
@@ -160,12 +160,19 @@ struct zone {
#define ZONE_NORMAL 1
#define ZONE_HIGHMEM 2
-#define MAX_NR_ZONES 3 /* Sync this with MAX_NR_ZONES_SHIFT */
-#define MAX_NR_ZONES_SHIFT 2 /* ceil(log2(MAX_NR_ZONES)) */
+#define MAX_NR_ZONES 3 /* Sync this with ZONES_SHIFT */
+#define ZONES_SHIFT 2 /* ceil(log2(MAX_NR_ZONES)) */
#define GFP_ZONEMASK 0x03
/*
+ * The "priority" of VM scanning is how much of the queues we will scan in one
+ * go. A value of 12 for DEF_PRIORITY implies that we will scan 1/4096th of the
+ * queues ("queue_length >> 12") during an aging round.
+ */
+#define DEF_PRIORITY 12
+
+/*
* One allocation request operates on a zonelist. A zonelist
* is a list of zones, the first one is the 'goal' of the
* allocation, the other zones are fallback zones, in decreasing
@@ -303,7 +310,7 @@ int min_free_kbytes_sysctl_handler(struct ctl_table *, int, struct file *,
extern struct pglist_data contig_page_data;
#define NODE_DATA(nid) (&contig_page_data)
#define NODE_MEM_MAP(nid) mem_map
-#define MAX_NODES_SHIFT 0
+#define MAX_NODES_SHIFT 1
#else /* CONFIG_DISCONTIGMEM */
@@ -311,7 +318,7 @@ extern struct pglist_data contig_page_data;
#if BITS_PER_LONG == 32
/*
- * with 32 bit flags field, page->zone is currently 8 bits.
+ * with 32 bit page->flags field, we reserve 8 bits for node/zone info.
* there are 3 zones (2 bits) and this leaves 8-2=6 bits for nodes.
*/
#define MAX_NODES_SHIFT 6
@@ -328,6 +335,13 @@ extern struct pglist_data contig_page_data;
#error NODES_SHIFT > MAX_NODES_SHIFT
#endif
+/* There are currently 3 zones: DMA, Normal & Highmem, thus we need 2 bits */
+#define MAX_ZONES_SHIFT 2
+
+#if ZONES_SHIFT > MAX_ZONES_SHIFT
+#error ZONES_SHIFT > MAX_ZONES_SHIFT
+#endif
+
extern DECLARE_BITMAP(node_online_map, MAX_NUMNODES);
extern DECLARE_BITMAP(memblk_online_map, MAX_NR_MEMBLKS);
diff --git a/include/linux/module.h b/include/linux/module.h
index 13ff244afdbf..c0418e47a296 100644
--- a/include/linux/module.h
+++ b/include/linux/module.h
@@ -60,6 +60,7 @@ search_extable(const struct exception_table_entry *first,
#define __module_cat(a,b) ___module_cat(a,b)
#define __MODULE_INFO(tag, name, info) \
static const char __module_cat(name,__LINE__)[] \
+ __attribute_used__ \
__attribute__((section(".modinfo"),unused)) = __stringify(tag) "=" info
#define MODULE_GENERIC_TABLE(gtype,name) \
@@ -142,6 +143,7 @@ void *__symbol_get_gpl(const char *symbol);
#define __CRC_SYMBOL(sym, sec) \
extern void *__crc_##sym __attribute__((weak)); \
static const unsigned long __kcrctab_##sym \
+ __attribute_used__ \
__attribute__((section("__kcrctab" sec), unused)) \
= (unsigned long) &__crc_##sym;
#else
@@ -155,6 +157,7 @@ void *__symbol_get_gpl(const char *symbol);
__attribute__((section("__ksymtab_strings"))) \
= MODULE_SYMBOL_PREFIX #sym; \
static const struct kernel_symbol __ksymtab_##sym \
+ __attribute_used__ \
__attribute__((section("__ksymtab" sec), unused)) \
= { (unsigned long)&sym, __kstrtab_##sym }
diff --git a/include/linux/moduleparam.h b/include/linux/moduleparam.h
index 0a5becbed774..cbca00722b5c 100644
--- a/include/linux/moduleparam.h
+++ b/include/linux/moduleparam.h
@@ -52,6 +52,7 @@ struct kparam_array
#define __module_param_call(prefix, name, set, get, arg, perm) \
static char __param_str_##name[] __initdata = prefix #name; \
static struct kernel_param const __param_##name \
+ __attribute_used__ \
__attribute__ ((unused,__section__ ("__param"),aligned(sizeof(void *)))) \
= { __param_str_##name, perm, set, get, arg }
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 666d89f875f5..cfdeaaad2b7e 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -831,7 +831,7 @@ static inline void netif_rx_complete(struct net_device *dev)
unsigned long flags;
local_irq_save(flags);
- if (!test_bit(__LINK_STATE_RX_SCHED, &dev->state)) BUG();
+ BUG_ON(!test_bit(__LINK_STATE_RX_SCHED, &dev->state));
list_del(&dev->poll_list);
smp_mb__before_clear_bit();
clear_bit(__LINK_STATE_RX_SCHED, &dev->state);
@@ -857,7 +857,7 @@ static inline void netif_poll_enable(struct net_device *dev)
*/
static inline void __netif_rx_complete(struct net_device *dev)
{
- if (!test_bit(__LINK_STATE_RX_SCHED, &dev->state)) BUG();
+ BUG_ON(!test_bit(__LINK_STATE_RX_SCHED, &dev->state));
list_del(&dev->poll_list);
smp_mb__before_clear_bit();
clear_bit(__LINK_STATE_RX_SCHED, &dev->state);
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h
index 93edc5a5ad98..5ae592b26d63 100644
--- a/include/linux/nfs_fs.h
+++ b/include/linux/nfs_fs.h
@@ -255,8 +255,7 @@ nfs_file_cred(struct file *file)
if (file)
cred = (struct rpc_cred *)file->private_data;
#ifdef RPC_DEBUG
- if (cred && cred->cr_magic != RPCAUTH_CRED_MAGIC)
- BUG();
+ BUG_ON(cred && cred->cr_magic != RPCAUTH_CRED_MAGIC);
#endif
return cred;
}
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index 86d2bbccd9ea..4dba6ec06e3a 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -291,6 +291,7 @@
#define PCI_DEVICE_ID_ATI_RADEON_Ig 0x4967
/* Radeon RV280 (9200) */
#define PCI_DEVICE_ID_ATI_RADEON_Y_ 0x5960
+#define PCI_DEVICE_ID_ATI_RADEON_Yd 0x5964
/* Radeon R300 (9500) */
#define PCI_DEVICE_ID_ATI_RADEON_AD 0x4144
/* Radeon R300 (9700) */
diff --git a/include/linux/quotaops.h b/include/linux/quotaops.h
index ad88acfd7b70..155c9a2af016 100644
--- a/include/linux/quotaops.h
+++ b/include/linux/quotaops.h
@@ -44,8 +44,7 @@ extern struct quotactl_ops vfs_quotactl_ops;
static __inline__ void DQUOT_INIT(struct inode *inode)
{
- if (!inode->i_sb)
- BUG();
+ BUG_ON(!inode->i_sb);
if (sb_any_quota_enabled(inode->i_sb) && !IS_NOQUOTA(inode))
inode->i_sb->dq_op->initialize(inode, -1);
}
@@ -53,8 +52,7 @@ static __inline__ void DQUOT_INIT(struct inode *inode)
static __inline__ void DQUOT_DROP(struct inode *inode)
{
if (IS_QUOTAINIT(inode)) {
- if (!inode->i_sb)
- BUG();
+ BUG_ON(!inode->i_sb);
inode->i_sb->dq_op->drop(inode); /* Ops must be set when there's any quota... */
}
}
diff --git a/include/linux/sched.h b/include/linux/sched.h
index dba09fa98441..f5f84aedbaec 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -50,7 +50,7 @@ struct exec_domain;
#define CLONE_SETTLS 0x00080000 /* create a new TLS for the child */
#define CLONE_PARENT_SETTID 0x00100000 /* set the TID in the parent */
#define CLONE_CHILD_CLEARTID 0x00200000 /* clear the TID in the child */
-#define CLONE_DETACHED 0x00400000 /* Not used - CLONE_THREAD implies detached uniquely */
+#define CLONE_DETACHED 0x00400000 /* Unused, ignored */
#define CLONE_UNTRACED 0x00800000 /* set if the tracing process can't force CLONE_PTRACE on this clone */
#define CLONE_CHILD_SETTID 0x01000000 /* set the TID in the child */
#define CLONE_STOPPED 0x02000000 /* Start in stopped state */
diff --git a/include/linux/smp_lock.h b/include/linux/smp_lock.h
index 80fbd56eb3e4..9a20995c531a 100644
--- a/include/linux/smp_lock.h
+++ b/include/linux/smp_lock.h
@@ -49,8 +49,7 @@ static inline void lock_kernel(void)
static inline void unlock_kernel(void)
{
- if (unlikely(current->lock_depth < 0))
- BUG();
+ BUG_ON(current->lock_depth < 0);
if (likely(--current->lock_depth < 0))
put_kernel_lock();
}
diff --git a/include/net/sock.h b/include/net/sock.h
index 16e129f90426..115ace226a2a 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -473,8 +473,8 @@ static __inline__ void sk_set_owner(struct sock *sk, struct module *owner)
* change the ownership of this struct sock, with one not needed
* transient sk_set_owner call.
*/
- if (unlikely(sk->sk_owner != NULL))
- BUG();
+ BUG_ON(sk->sk_owner != NULL);
+
sk->sk_owner = owner;
__module_get(owner);
}
diff --git a/include/net/tcp.h b/include/net/tcp.h
index aeea9b268f80..4ef3b80fe541 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -1457,7 +1457,7 @@ static __inline__ int tcp_prequeue(struct sock *sk, struct sk_buff *skb)
if (tp->ucopy.memory > sk->sk_rcvbuf) {
struct sk_buff *skb1;
- if (sock_owned_by_user(sk)) BUG();
+ BUG_ON(sock_owned_by_user(sk));
while ((skb1 = __skb_dequeue(&tp->ucopy.prequeue)) != NULL) {
sk->sk_backlog_rcv(sk, skb1);
diff --git a/include/rxrpc/call.h b/include/rxrpc/call.h
index 6ac1df7012e9..9f0ce416a13e 100644
--- a/include/rxrpc/call.h
+++ b/include/rxrpc/call.h
@@ -187,8 +187,7 @@ extern int rxrpc_incoming_call(struct rxrpc_connection *conn,
static inline void rxrpc_get_call(struct rxrpc_call *call)
{
- if (atomic_read(&call->usage)<=0)
- BUG();
+ BUG_ON(atomic_read(&call->usage)<=0);
atomic_inc(&call->usage);
/*printk("rxrpc_get_call(%p{u=%d})\n",(C),atomic_read(&(C)->usage));*/
}
diff --git a/include/rxrpc/connection.h b/include/rxrpc/connection.h
index 14de354724f9..f22e71097952 100644
--- a/include/rxrpc/connection.h
+++ b/include/rxrpc/connection.h
@@ -67,8 +67,7 @@ extern int rxrpc_connection_lookup(struct rxrpc_peer *peer,
static inline void rxrpc_get_connection(struct rxrpc_connection *conn)
{
- if (atomic_read(&conn->usage)<0)
- BUG();
+ BUG_ON(atomic_read(&conn->usage)<0);
atomic_inc(&conn->usage);
//printk("rxrpc_get_conn(%p{u=%d})\n",conn,atomic_read(&conn->usage));
}
diff --git a/include/rxrpc/message.h b/include/rxrpc/message.h
index 9be208ab079e..d5755c6db3a8 100644
--- a/include/rxrpc/message.h
+++ b/include/rxrpc/message.h
@@ -53,8 +53,7 @@ struct rxrpc_message
extern void __rxrpc_put_message(struct rxrpc_message *msg);
static inline void rxrpc_put_message(struct rxrpc_message *msg)
{
- if (atomic_read(&msg->usage)<=0)
- BUG();
+ BUG_ON(atomic_read(&msg->usage)<=0);
if (atomic_dec_and_test(&msg->usage))
__rxrpc_put_message(msg);
}
diff --git a/include/rxrpc/peer.h b/include/rxrpc/peer.h
index 07e3a51b60b6..da4832fccd6a 100644
--- a/include/rxrpc/peer.h
+++ b/include/rxrpc/peer.h
@@ -72,8 +72,7 @@ extern int rxrpc_peer_lookup(struct rxrpc_transport *trans,
static inline void rxrpc_get_peer(struct rxrpc_peer *peer)
{
- if (atomic_read(&peer->usage)<0)
- BUG();
+ BUG_ON(atomic_read(&peer->usage)<0);
atomic_inc(&peer->usage);
//printk("rxrpc_get_peer(%p{u=%d})\n",peer,atomic_read(&peer->usage));
}
diff --git a/include/rxrpc/transport.h b/include/rxrpc/transport.h
index 92fb49c7d4b9..6aa88691186c 100644
--- a/include/rxrpc/transport.h
+++ b/include/rxrpc/transport.h
@@ -85,8 +85,7 @@ extern int rxrpc_create_transport(unsigned short port,
static inline void rxrpc_get_transport(struct rxrpc_transport *trans)
{
- if (atomic_read(&trans->usage) <= 0)
- BUG();
+ BUG_ON(atomic_read(&trans->usage) <= 0);
atomic_inc(&trans->usage);
//printk("rxrpc_get_transport(%p{u=%d})\n",
// trans, atomic_read(&trans->usage));
diff --git a/include/sound/core.h b/include/sound/core.h
index cbf5a1318769..00716c17d842 100644
--- a/include/sound/core.h
+++ b/include/sound/core.h
@@ -160,6 +160,7 @@ struct _snd_card {
int shutdown; /* this card is going down */
wait_queue_head_t shutdown_sleep;
struct work_struct free_workq; /* for free in workqueue */
+ struct device *dev;
#ifdef CONFIG_PM
int (*set_power_state) (snd_card_t *card, unsigned int state);