Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Remove "#ifdef __KERNEL__" checks from unexported headers

Remove the "#ifdef __KERNEL__" tests from unexported header files in
linux/include whose entire contents are wrapped in that preprocessor
test.

Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Robert P. J. Day and committed by
Linus Torvalds
735643ee 71cc2c21

+1 -130
-3
include/linux/agp_backend.h
··· 30 30 #ifndef _AGP_BACKEND_H 31 31 #define _AGP_BACKEND_H 1 32 32 33 - #ifdef __KERNEL__ 34 - 35 33 #ifndef TRUE 36 34 #define TRUE 1 37 35 #endif ··· 109 111 extern void agp_backend_release(struct agp_bridge_data *); 110 112 extern void agp_flush_chipset(struct agp_bridge_data *); 111 113 112 - #endif /* __KERNEL__ */ 113 114 #endif /* _AGP_BACKEND_H */
-2
include/linux/cdev.h
··· 1 1 #ifndef _LINUX_CDEV_H 2 2 #define _LINUX_CDEV_H 3 - #ifdef __KERNEL__ 4 3 5 4 #include <linux/kobject.h> 6 5 #include <linux/kdev_t.h> ··· 32 33 33 34 extern struct backing_dev_info directly_mappable_cdev_bdi; 34 35 35 - #endif 36 36 #endif
-2
include/linux/coda_fs_i.h
··· 8 8 #ifndef _LINUX_CODA_FS_I 9 9 #define _LINUX_CODA_FS_I 10 10 11 - #ifdef __KERNEL__ 12 11 #include <linux/types.h> 13 12 #include <linux/list.h> 14 13 #include <linux/coda.h> ··· 50 51 struct inode *coda_fid_to_inode(struct CodaFid *fid, struct super_block *sb); 51 52 void coda_replace_fid(struct inode *, struct CodaFid *, struct CodaFid *); 52 53 53 - #endif 54 54 #endif
+1 -2
include/linux/concap.h
··· 8 8 9 9 #ifndef _LINUX_CONCAP_H 10 10 #define _LINUX_CONCAP_H 11 - #ifdef __KERNEL__ 11 + 12 12 #include <linux/skbuff.h> 13 13 #include <linux/netdevice.h> 14 14 ··· 109 109 /* dummy submit method 110 110 */ 111 111 extern int concap_drop_skb(struct concap_proto *cprot, struct sk_buff *skb); 112 - #endif 113 112 #endif
-4
include/linux/configfs.h
··· 35 35 #ifndef _CONFIGFS_H_ 36 36 #define _CONFIGFS_H_ 37 37 38 - #ifdef __KERNEL__ 39 - 40 38 #include <linux/kernel.h> 41 39 #include <linux/types.h> 42 40 #include <linux/list.h> ··· 191 193 /* WARNING: These cannot be called underneath configfs callbacks!! */ 192 194 int configfs_depend_item(struct configfs_subsystem *subsys, struct config_item *target); 193 195 void configfs_undepend_item(struct configfs_subsystem *subsys, struct config_item *target); 194 - 195 - #endif /* __KERNEL__ */ 196 196 197 197 #endif /* _CONFIGFS_H_ */
-2
include/linux/crc-ccitt.h
··· 1 1 #ifndef _LINUX_CRC_CCITT_H 2 2 #define _LINUX_CRC_CCITT_H 3 - #ifdef __KERNEL__ 4 3 5 4 #include <linux/types.h> 6 5 ··· 12 13 return (crc >> 8) ^ crc_ccitt_table[(crc ^ c) & 0xff]; 13 14 } 14 15 15 - #endif /* __KERNEL__ */ 16 16 #endif /* _LINUX_CRC_CCITT_H */
-4
include/linux/dcache.h
··· 1 1 #ifndef __LINUX_DCACHE_H 2 2 #define __LINUX_DCACHE_H 3 3 4 - #ifdef __KERNEL__ 5 - 6 4 #include <asm/atomic.h> 7 5 #include <linux/list.h> 8 6 #include <linux/spinlock.h> ··· 362 364 extern struct dentry *lookup_create(struct nameidata *nd, int is_dir); 363 365 364 366 extern int sysctl_vfs_cache_pressure; 365 - 366 - #endif /* __KERNEL__ */ 367 367 368 368 #endif /* __LINUX_DCACHE_H */
-3
include/linux/device-mapper.h
··· 8 8 #ifndef _LINUX_DEVICE_MAPPER_H 9 9 #define _LINUX_DEVICE_MAPPER_H 10 10 11 - #ifdef __KERNEL__ 12 - 13 11 #include <linux/bio.h> 14 12 15 13 struct dm_target; ··· 342 344 return (n << SECTOR_SHIFT); 343 345 } 344 346 345 - #endif /* __KERNEL__ */ 346 347 #endif /* _LINUX_DEVICE_MAPPER_H */
-5
include/linux/eventfd.h
··· 8 8 #ifndef _LINUX_EVENTFD_H 9 9 #define _LINUX_EVENTFD_H 10 10 11 - 12 - #ifdef __KERNEL__ 13 - 14 11 #ifdef CONFIG_EVENTFD 15 12 16 13 struct file *eventfd_fget(int fd); ··· 20 23 { return 0; } 21 24 22 25 #endif /* CONFIG_EVENTFD */ 23 - 24 - #endif /* __KERNEL__ */ 25 26 26 27 #endif /* _LINUX_EVENTFD_H */ 27 28
-2
include/linux/fsl_devices.h
··· 14 14 * option) any later version. 15 15 */ 16 16 17 - #ifdef __KERNEL__ 18 17 #ifndef _FSL_DEVICE_H_ 19 18 #define _FSL_DEVICE_H_ 20 19 ··· 126 127 }; 127 128 128 129 #endif /* _FSL_DEVICE_H_ */ 129 - #endif /* __KERNEL__ */
-4
include/linux/fsnotify.h
··· 11 11 * (C) Copyright 2005 Robert Love 12 12 */ 13 13 14 - #ifdef __KERNEL__ 15 - 16 14 #include <linux/dnotify.h> 17 15 #include <linux/inotify.h> 18 16 #include <linux/audit.h> ··· 293 295 } 294 296 295 297 #endif /* ! CONFIG_INOTIFY */ 296 - 297 - #endif /* __KERNEL__ */ 298 298 299 299 #endif /* _LINUX_FS_NOTIFY_H */
-2
include/linux/hw_random.h
··· 11 11 12 12 #ifndef LINUX_HWRANDOM_H_ 13 13 #define LINUX_HWRANDOM_H_ 14 - #ifdef __KERNEL__ 15 14 16 15 #include <linux/types.h> 17 16 #include <linux/list.h> ··· 45 46 /** Unregister a Hardware Random Number Generator driver. */ 46 47 extern void hwrng_unregister(struct hwrng *rng); 47 48 48 - #endif /* __KERNEL__ */ 49 49 #endif /* LINUX_HWRANDOM_H_ */
-3
include/linux/i2o.h
··· 18 18 #ifndef _I2O_H 19 19 #define _I2O_H 20 20 21 - #ifdef __KERNEL__ /* This file to be included by kernel only */ 22 - 23 21 #include <linux/i2o-dev.h> 24 22 25 23 /* How many different OSM's are we allowing */ ··· 1253 1255 extern void i2o_dump_hrt(struct i2o_controller *c); 1254 1256 extern void i2o_debug_state(struct i2o_controller *c); 1255 1257 1256 - #endif /* __KERNEL__ */ 1257 1258 #endif /* _I2O_H */
-3
include/linux/if_macvlan.h
··· 1 1 #ifndef _LINUX_IF_MACVLAN_H 2 2 #define _LINUX_IF_MACVLAN_H 3 3 4 - #ifdef __KERNEL__ 5 - 6 4 extern struct sk_buff *(*macvlan_handle_frame_hook)(struct sk_buff *); 7 5 8 - #endif /* __KERNEL__ */ 9 6 #endif /* _LINUX_IF_MACVLAN_H */
-2
include/linux/inet.h
··· 42 42 #ifndef _LINUX_INET_H 43 43 #define _LINUX_INET_H 44 44 45 - #ifdef __KERNEL__ 46 45 #include <linux/types.h> 47 46 48 47 extern __be32 in_aton(const char *str); 49 48 extern int in4_pton(const char *src, int srclen, u8 *dst, int delim, const char **end); 50 49 extern int in6_pton(const char *src, int srclen, u8 *dst, int delim, const char **end); 51 - #endif 52 50 #endif /* _LINUX_INET_H */
-7
include/linux/isicom.h
··· 1 1 #ifndef _LINUX_ISICOM_H 2 2 #define _LINUX_ISICOM_H 3 3 4 - /*#define ISICOM_DEBUG*/ 5 - /*#define ISICOM_DEBUG_DTR_RTS*/ 6 - 7 - #ifdef __KERNEL__ 8 - 9 4 #define YES 1 10 5 #define NO 0 11 6 ··· 79 84 80 85 81 86 #define ISI_TXOK 0x0001 82 - 83 - #endif /* __KERNEL__ */ 84 87 85 88 #endif /* ISICOM_H */
-5
include/linux/kfifo.h
··· 21 21 #ifndef _LINUX_KFIFO_H 22 22 #define _LINUX_KFIFO_H 23 23 24 - #ifdef __KERNEL__ 25 - 26 24 #include <linux/kernel.h> 27 25 #include <linux/spinlock.h> 28 26 ··· 149 151 return ret; 150 152 } 151 153 152 - #else 153 - #warning "don't include kernel headers in userspace" 154 - #endif /* __KERNEL__ */ 155 154 #endif
-4
include/linux/kobj_map.h
··· 1 - #ifdef __KERNEL__ 2 - 3 1 #include <linux/mutex.h> 4 2 5 3 typedef struct kobject *kobj_probe_t(dev_t, int *, void *); ··· 8 10 void kobj_unmap(struct kobj_map *, dev_t, unsigned long); 9 11 struct kobject *kobj_lookup(struct kobj_map *, dev_t, int *); 10 12 struct kobj_map *kobj_map_init(kobj_probe_t *, struct mutex *); 11 - 12 - #endif
-3
include/linux/kobject.h
··· 16 16 #ifndef _KOBJECT_H_ 17 17 #define _KOBJECT_H_ 18 18 19 - #ifdef __KERNEL__ 20 - 21 19 #include <linux/types.h> 22 20 #include <linux/list.h> 23 21 #include <linux/sysfs.h> ··· 222 224 { return -EINVAL; } 223 225 #endif 224 226 225 - #endif /* __KERNEL__ */ 226 227 #endif /* _KOBJECT_H_ */
-3
include/linux/kref.h
··· 15 15 #ifndef _KREF_H_ 16 16 #define _KREF_H_ 17 17 18 - #ifdef __KERNEL__ 19 - 20 18 #include <linux/types.h> 21 19 #include <asm/atomic.h> 22 20 ··· 27 29 void kref_get(struct kref *kref); 28 30 int kref_put(struct kref *kref, void (*release) (struct kref *kref)); 29 31 30 - #endif /* __KERNEL__ */ 31 32 #endif /* _KREF_H_ */
-5
include/linux/list.h
··· 1 1 #ifndef _LINUX_LIST_H 2 2 #define _LINUX_LIST_H 3 3 4 - #ifdef __KERNEL__ 5 - 6 4 #include <linux/stddef.h> 7 5 #include <linux/poison.h> 8 6 #include <linux/prefetch.h> ··· 981 983 ({ tpos = hlist_entry(pos, typeof(*tpos), member); 1;}); \ 982 984 pos = rcu_dereference(pos->next)) 983 985 984 - #else 985 - #warning "don't include kernel headers in userspace" 986 - #endif /* __KERNEL__ */ 987 986 #endif
-2
include/linux/mmzone.h
··· 1 1 #ifndef _LINUX_MMZONE_H 2 2 #define _LINUX_MMZONE_H 3 3 4 - #ifdef __KERNEL__ 5 4 #ifndef __ASSEMBLY__ 6 5 #ifndef __GENERATING_BOUNDS_H 7 6 ··· 1004 1005 1005 1006 #endif /* !__GENERATING_BOUNDS.H */ 1006 1007 #endif /* !__ASSEMBLY__ */ 1007 - #endif /* __KERNEL__ */ 1008 1008 #endif /* _LINUX_MMZONE_H */
-2
include/linux/mount.h
··· 10 10 */ 11 11 #ifndef _LINUX_MOUNT_H 12 12 #define _LINUX_MOUNT_H 13 - #ifdef __KERNEL__ 14 13 15 14 #include <linux/types.h> 16 15 #include <linux/list.h> ··· 113 114 extern spinlock_t vfsmount_lock; 114 115 extern dev_t name_to_dev_t(char *name); 115 116 116 - #endif 117 117 #endif /* _LINUX_MOUNT_H */
-4
include/linux/ncp_fs_i.h
··· 8 8 #ifndef _LINUX_NCP_FS_I 9 9 #define _LINUX_NCP_FS_I 10 10 11 - #ifdef __KERNEL__ 12 - 13 11 /* 14 12 * This is the ncpfs part of the inode structure. This must contain 15 13 * all the information we need to work with an inode after creation. ··· 25 27 __u8 file_handle[6]; 26 28 struct inode vfs_inode; 27 29 }; 28 - 29 - #endif /* __KERNEL__ */ 30 30 31 31 #endif /* _LINUX_NCP_FS_I */
-2
include/linux/of_device.h
··· 1 1 #ifndef _LINUX_OF_DEVICE_H 2 2 #define _LINUX_OF_DEVICE_H 3 - #ifdef __KERNEL__ 4 3 5 4 #include <linux/device.h> 6 5 #include <linux/of.h> ··· 24 25 of_release_dev(&dev->dev); 25 26 } 26 27 27 - #endif /* __KERNEL__ */ 28 28 #endif /* _LINUX_OF_DEVICE_H */
-4
include/linux/pm.h
··· 21 21 #ifndef _LINUX_PM_H 22 22 #define _LINUX_PM_H 23 23 24 - #ifdef __KERNEL__ 25 - 26 24 #include <linux/list.h> 27 25 #include <asm/atomic.h> 28 26 #include <asm/errno.h> ··· 222 224 223 225 #define PM_APM 1 224 226 #define PM_ACPI 2 225 - 226 - #endif /* __KERNEL__ */ 227 227 228 228 #endif /* _LINUX_PM_H */
-4
include/linux/pnp.h
··· 6 6 #ifndef _LINUX_PNP_H 7 7 #define _LINUX_PNP_H 8 8 9 - #ifdef __KERNEL__ 10 - 11 9 #include <linux/device.h> 12 10 #include <linux/list.h> 13 11 #include <linux/errno.h> ··· 463 465 #else 464 466 #define pnp_dbg(format, arg...) do {} while (0) 465 467 #endif 466 - 467 - #endif /* __KERNEL__ */ 468 468 469 469 #endif /* _LINUX_PNP_H */
-4
include/linux/profile.h
··· 1 1 #ifndef _LINUX_PROFILE_H 2 2 #define _LINUX_PROFILE_H 3 3 4 - #ifdef __KERNEL__ 5 - 6 4 #include <linux/kernel.h> 7 5 #include <linux/init.h> 8 6 #include <linux/cpumask.h> ··· 115 117 } 116 118 117 119 #endif /* CONFIG_PROFILING */ 118 - 119 - #endif /* __KERNEL__ */ 120 120 121 121 #endif /* _LINUX_PROFILE_H */
-3
include/linux/rcuclassic.h
··· 33 33 #ifndef __LINUX_RCUCLASSIC_H 34 34 #define __LINUX_RCUCLASSIC_H 35 35 36 - #ifdef __KERNEL__ 37 - 38 36 #include <linux/cache.h> 39 37 #include <linux/spinlock.h> 40 38 #include <linux/threads.h> ··· 161 163 #define rcu_enter_nohz() do { } while (0) 162 164 #define rcu_exit_nohz() do { } while (0) 163 165 164 - #endif /* __KERNEL__ */ 165 166 #endif /* __LINUX_RCUCLASSIC_H */
-3
include/linux/rcupdate.h
··· 33 33 #ifndef __LINUX_RCUPDATE_H 34 34 #define __LINUX_RCUPDATE_H 35 35 36 - #ifdef __KERNEL__ 37 - 38 36 #include <linux/cache.h> 39 37 #include <linux/spinlock.h> 40 38 #include <linux/threads.h> ··· 243 245 extern void rcu_init(void); 244 246 extern int rcu_needs_cpu(int cpu); 245 247 246 - #endif /* __KERNEL__ */ 247 248 #endif /* __LINUX_RCUPDATE_H */
-3
include/linux/rcupreempt.h
··· 33 33 #ifndef __LINUX_RCUPREEMPT_H 34 34 #define __LINUX_RCUPREEMPT_H 35 35 36 - #ifdef __KERNEL__ 37 - 38 36 #include <linux/cache.h> 39 37 #include <linux/spinlock.h> 40 38 #include <linux/threads.h> ··· 102 104 #define rcu_exit_nohz() do { } while (0) 103 105 #endif /* CONFIG_NO_HZ */ 104 106 105 - #endif /* __KERNEL__ */ 106 107 #endif /* __LINUX_RCUPREEMPT_H */
-2
include/linux/rcupreempt_trace.h
··· 32 32 #ifndef __LINUX_RCUPREEMPT_TRACE_H 33 33 #define __LINUX_RCUPREEMPT_TRACE_H 34 34 35 - #ifdef __KERNEL__ 36 35 #include <linux/types.h> 37 36 #include <linux/kernel.h> 38 37 ··· 94 95 extern void rcupreempt_trace_invoke(struct rcupreempt_trace *trace); 95 96 extern void rcupreempt_trace_next_add(struct rcupreempt_trace *trace); 96 97 97 - #endif /* __KERNEL__ */ 98 98 #endif /* __LINUX_RCUPREEMPT_TRACE_H */
-3
include/linux/rio.h
··· 14 14 #ifndef LINUX_RIO_H 15 15 #define LINUX_RIO_H 16 16 17 - #ifdef __KERNEL__ 18 - 19 17 #include <linux/types.h> 20 18 #include <linux/ioport.h> 21 19 #include <linux/list.h> ··· 329 331 extern int rio_open_outb_mbox(struct rio_mport *, void *, int, int); 330 332 extern void rio_close_outb_mbox(struct rio_mport *, int); 331 333 332 - #endif /* __KERNEL__ */ 333 334 #endif /* LINUX_RIO_H */
-3
include/linux/rio_drv.h
··· 13 13 #ifndef LINUX_RIO_DRV_H 14 14 #define LINUX_RIO_DRV_H 15 15 16 - #ifdef __KERNEL__ 17 - 18 16 #include <linux/types.h> 19 17 #include <linux/ioport.h> 20 18 #include <linux/list.h> ··· 463 465 extern struct rio_dev *rio_get_asm(u16 vid, u16 did, u16 asm_vid, u16 asm_did, 464 466 struct rio_dev *from); 465 467 466 - #endif /* __KERNEL__ */ 467 468 #endif /* LINUX_RIO_DRV_H */
-3
include/linux/rwsem.h
··· 9 9 10 10 #include <linux/linkage.h> 11 11 12 - #ifdef __KERNEL__ 13 - 14 12 #include <linux/types.h> 15 13 #include <linux/kernel.h> 16 14 #include <asm/system.h> ··· 88 90 # define up_read_non_owner(sem) up_read(sem) 89 91 #endif 90 92 91 - #endif /* __KERNEL__ */ 92 93 #endif /* _LINUX_RWSEM_H */
-2
include/linux/seq_file.h
··· 1 1 #ifndef _LINUX_SEQ_FILE_H 2 2 #define _LINUX_SEQ_FILE_H 3 - #ifdef __KERNEL__ 4 3 5 4 #include <linux/types.h> 6 5 #include <linux/string.h> ··· 67 68 extern struct list_head *seq_list_next(void *v, struct list_head *head, 68 69 loff_t *ppos); 69 70 70 - #endif 71 71 #endif
-3
include/linux/slab.h
··· 9 9 #ifndef _LINUX_SLAB_H 10 10 #define _LINUX_SLAB_H 11 11 12 - #ifdef __KERNEL__ 13 - 14 12 #include <linux/gfp.h> 15 13 #include <linux/types.h> 16 14 ··· 281 283 ssize_t slabinfo_write(struct file *, const char __user *, size_t, loff_t *); 282 284 #endif 283 285 284 - #endif /* __KERNEL__ */ 285 286 #endif /* _LINUX_SLAB_H */
-2
include/linux/smb_fs_i.h
··· 9 9 #ifndef _LINUX_SMB_FS_I 10 10 #define _LINUX_SMB_FS_I 11 11 12 - #ifdef __KERNEL__ 13 12 #include <linux/types.h> 14 13 #include <linux/fs.h> 15 14 ··· 34 35 struct inode vfs_inode; /* must be at the end */ 35 36 }; 36 37 37 - #endif 38 38 #endif
-4
include/linux/smb_fs_sb.h
··· 9 9 #ifndef _SMB_FS_SB 10 10 #define _SMB_FS_SB 11 11 12 - #ifdef __KERNEL__ 13 - 14 12 #include <linux/types.h> 15 13 #include <linux/smb.h> 16 14 ··· 93 95 { 94 96 up(&(server->sem)); 95 97 } 96 - 97 - #endif /* __KERNEL__ */ 98 98 99 99 #endif
-3
include/linux/svga.h
··· 1 1 #ifndef _LINUX_SVGA_H 2 2 #define _LINUX_SVGA_H 3 3 4 - #ifdef __KERNEL__ 5 - 6 4 #include <linux/pci.h> 7 5 #include <video/vga.h> 8 6 ··· 120 122 121 123 int svga_match_format(const struct svga_fb_format *frm, struct fb_var_screeninfo *var, struct fb_fix_screeninfo *fix); 122 124 123 - #endif /* __KERNEL__ */ 124 125 #endif /* _LINUX_SVGA_H */ 125 126
-4
include/linux/textsearch.h
··· 1 1 #ifndef __LINUX_TEXTSEARCH_H 2 2 #define __LINUX_TEXTSEARCH_H 3 3 4 - #ifdef __KERNEL__ 5 - 6 4 #include <linux/types.h> 7 5 #include <linux/list.h> 8 6 #include <linux/kernel.h> ··· 174 176 { 175 177 return ((u8 *) conf + TS_PRIV_ALIGN(sizeof(struct ts_config))); 176 178 } 177 - 178 - #endif /* __KERNEL__ */ 179 179 180 180 #endif