summaryrefslogtreecommitdiff
path: root/include/linux
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/linux
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/linux')
-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
25 files changed, 155 insertions, 167 deletions
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();
}