Use strict kernel types to fix the world
Subsystems (13)
[email protected]
maintainercover Use strict kernel types to fix the world
I've gone through the files again and fixed up all non-strict types I could find. I did not check all architectures for this though.
I split out netfilter, DRM and MTD, because of both size and potentially controversial changes.
Arnd <><
[email protected]
maintainerPATCH 1/7 make exported headers use strict posix types
A number of standard posix types are used in exported headers, which is not allowed if __STRICT_KERNEL_NAMES is defined. In order to get rid of the non-__STRICT_KERNEL_NAMES part and to make sane headers the default, we have to change them all to safe types.
There are also still some leftovers in reiserfs_fs.h, elfcore.h and coda.h, but these files have not compiled in user space for a long time.
This leaves out the various integer types ({u_,u,}int{8,16,32,64}_t), which we take care of separately.
--- include/asm-generic/fcntl.h | 12 ++++++------ include/asm-generic/siginfo.h | 14 +++++++------- include/linux/agpgart.h | 14 +++++++------- include/linux/cn_proc.h | 20 ++++++++++---------- include/linux/cyclades.h | 6 +++--- include/linux/dvb/video.h | 2 +- include/linux/if_pppol2tp.h | 2 +- include/linux/mroute6.h | 2 +- include/linux/netfilter_ipv4/ipt_owner.h | 8 ++++---- include/linux/netfilter_ipv6/ip6t_owner.h | 8 ++++---- include/linux/ppp_defs.h | 4 ++-- include/linux/suspend_ioctls.h | 10 +++++----- include/linux/time.h | 8 ++++---- include/linux/times.h | 8 ++++---- include/linux/utime.h | 4 ++-- include/linux/xfrm.h | 2 +- include/mtd/mtd-abi.h | 4 ++-- include/sound/asound.h | 4 ++-- 18 files changed, 66 insertions(+), 66 deletions(-)
include/asm-generic/fcntl.h +6 -6
@@ -117,9 +117,9 @@struct flock {short l_type;short l_whence; -off_t l_start; -off_t l_len; -pid_t l_pid; +__kernel_off_t l_start; +__kernel_off_t l_len; +__kernel_pid_t l_pid; __ARCH_FLOCK_PAD };#endif
@@ -140,9 +140,9 @@ struct flock {struct flock64 {short l_type;short l_whence; -loff_t l_start; -loff_t l_len; -pid_t l_pid; +__kernel_loff_t l_start; +__kernel_loff_t l_len; +__kernel_pid_t l_pid; __ARCH_FLOCK64_PAD };#endif
include/asm-generic/siginfo.h +7 -7
@@ -23,7 +23,7 @@ typedef union sigval {#endif #ifndef __ARCH_SI_UID_T -#define __ARCH_SI_UID_T uid_t +#define __ARCH_SI_UID_T __kernel_uid32_t#endif /*
@@ -47,13 +47,13 @@ typedef struct siginfo {/* kill() */ struct { -pid_t _pid;/* sender's pid */ +__kernel_pid_t _pid;/* sender's pid */ __ARCH_SI_UID_T _uid;/* sender's uid */ } _kill;/* POSIX.1b timers */ struct { -timer_t _tid;/* timer id */ +__kernel_timer_t _tid;/* timer id */ int _overrun;/* overrun count */ char _pad[sizeof ( __ARCH_SI_UID_T) -sizeof (int )];sigval_t _sigval;/* same as below */
@@ -62,18 +62,18 @@ typedef struct siginfo {/* POSIX.1b signals */ struct { -pid_t _pid;/* sender's pid */ +__kernel_pid_t _pid;/* sender's pid */ __ARCH_SI_UID_T _uid;/* sender's uid */ sigval_t _sigval; } _rt;/* SIGCHLD */ struct { -pid_t _pid;/* which child */ +__kernel_pid_t _pid;/* which child */ __ARCH_SI_UID_T _uid;/* sender's uid */ int _status;/* exit code */ -clock_t _utime; -clock_t _stime; +__kernel_clock_t _utime; +__kernel_clock_t _stime; } _sigchld;/* SIGILL, SIGFPE, SIGSEGV, SIGBUS */
include/linux/agpgart.h +7 -7
@@ -77,20 +77,20 @@ typedef struct _agp_setup {* The "prot" down below needs still a "sleep" flag somehow ... */ typedef struct _agp_segment { -off_t pg_start;/* starting page to populate */ -size_t pg_count;/* number of pages */ -int prot;/* prot flags for mmap */ +__kernel_off_t pg_start;/* starting page to populate */ +__kernel_size_t pg_count;/* number of pages */ +int prot;/* prot flags for mmap */ }agp_segment ;typedef struct _agp_region { -pid_t pid;/* pid of process */ -size_t seg_count;/* number of segments */ +__kernel_pid_t pid;/* pid of process */ +__kernel_size_t seg_count;/* number of segments */ struct _agp_segment *seg_list; }agp_region ; typedef struct _agp_allocate { int key; /* tag of allocation */ - size_t pg_count; /* number of pages */ + __kernel_size_t pg_count;/* number of pages */ __u32 type; /* 0 == normal, other devspec */ __u32 physical; /* device specific (some devices * need a phys address of the
@@ -100,7 +100,7 @@ typedef struct _agp_allocate {typedef struct _agp_bind {int key;/* tag of allocation */ -off_t pg_start;/* starting page to populate */ +__kernel_off_t pg_start;/* starting page to populate */ }agp_bind ; typedef struct _agp_unbind {
include/linux/cn_proc.h +10 -10
@@ -65,20 +65,20 @@ struct proc_event { } ack;struct fork_proc_event { -pid_t parent_pid; -pid_t parent_tgid; -pid_t child_pid; -pid_t child_tgid; +__kernel_pid_t parent_pid; +__kernel_pid_t parent_tgid; +__kernel_pid_t child_pid; +__kernel_pid_t child_tgid; } fork;struct exec_proc_event { -pid_t process_pid; -pid_t process_tgid; +__kernel_pid_t process_pid; +__kernel_pid_t process_tgid; } exec;struct id_proc_event { -pid_t process_pid; -pid_t process_tgid; +__kernel_pid_t process_pid; +__kernel_pid_t process_tgid;union {__u32 ruid;/* task uid */ __u32 rgid;/* task gid */
@@ -90,8 +90,8 @@ struct proc_event { } id;struct exit_proc_event { -pid_t process_pid; -pid_t process_tgid; +__kernel_pid_t process_pid; +__kernel_pid_t process_tgid;__u32 exit_code, exit_signal; } exit; } event_data;
include/linux/cyclades.h +3 -3
@@ -82,9 +82,9 @@ struct cyclades_monitor {* open) */ struct cyclades_idle_stats { -time_t in_use;/* Time device has been in use (secs) */ -time_t recv_idle;/* Time since last char received (secs) */ -time_t xmit_idle;/* Time since last char transmitted (secs) */ +__kernel_time_t in_use;/* Time device has been in use (secs) */ +__kernel_time_t recv_idle;/* Time since last char received (secs) */ +__kernel_time_t xmit_idle;/* Time since last char transmitted (secs) */ unsigned long recv_bytes;/* Bytes received */ unsigned long xmit_bytes;/* Bytes transmitted */ unsigned long overruns;/* Input overruns */
include/linux/dvb/video.h +1 -1
@@ -137,7 +137,7 @@ struct video_event {#define VIDEO_EVENT_FRAME_RATE_CHANGED 2#define VIDEO_EVENT_DECODER_STOPPED 3#define VIDEO_EVENT_VSYNC 4 -time_t timestamp; +__kernel_time_t timestamp;union {video_size_t size;unsigned int frame_rate;/* in frames per 1000sec */
include/linux/if_pppol2tp.h +1 -1
@@ -26,7 +26,7 @@*/ struct pppol2tp_addr { -pid_t pid;/* pid that owns the fd. +__kernel_pid_t pid;/* pid that owns the fd. * 0 => current */ int fd;/* FD of UDP socket to use */
include/linux/mroute6.h +1 -1
@@ -65,7 +65,7 @@ struct mif6ctl {mifi_t mif6c_mifi;/* Index of MIF */ unsigned char mif6c_flags;/* MIFF_ flags */ unsigned char vifc_threshold;/* ttl limit */ -u_short mif6c_pifi;/* the index of the physical IF */ +__u16 mif6c_pifi;/* the index of the physical IF */ unsigned int vifc_rate_limit;/* Rate limiter values (NI) */ };
include/linux/netfilter_ipv4/ipt_owner.h +4 -4
@@ -9,10 +9,10 @@#define IPT_OWNER_COMM 0x10struct ipt_owner_info { -uid_t uid; -gid_t gid; -pid_t pid; -pid_t sid; +__kernel_uid32_t uid; +__kernel_gid32_t gid; +__kernel_pid_t pid; +__kernel_pid_t sid;char comm[16 ];u_int8_t match, invert;/* flags */ };
include/linux/netfilter_ipv6/ip6t_owner.h +4 -4
@@ -8,10 +8,10 @@#define IP6T_OWNER_SID 0x08struct ip6t_owner_info { -uid_t uid; -gid_t gid; -pid_t pid; -pid_t sid; +__kernel_uid32_t uid; +__kernel_gid32_t gid; +__kernel_pid_t pid; +__kernel_pid_t sid;u_int8_t match, invert;/* flags */ };
include/linux/ppp_defs.h +2 -2
@@ -177,8 +177,8 @@ struct ppp_comp_stats {* the last NP packet was sent or received. */ struct ppp_idle { -time_t xmit_idle;/* time since last NP packet sent */ -time_t recv_idle;/* time since last NP packet received */ +__kernel_time_t xmit_idle;/* time since last NP packet sent */ +__kernel_time_t recv_idle;/* time since last NP packet received */ };#endif /* _PPP_DEFS_H_ */
include/linux/suspend_ioctls.h +6 -5
@@ -1,14 +1,15 @@#ifndef _LINUX_SUSPEND_IOCTLS_H#define _LINUX_SUSPEND_IOCTLS_H +#include <linux/types.h> /* * This structure is used to pass the values needed for the identification * of the resume swap area from a user space to the kernel via the * SNAPSHOT_SET_SWAP_AREA ioctl */ struct resume_swap_area { -loff_t offset; -u_int32_t dev; +__kernel_loff_t offset; +__u32 dev; } __attribute__((packed));#define SNAPSHOT_IOC_MAGIC '3'
@@ -20,13 +21,13 @@ struct resume_swap_area {#define SNAPSHOT_S2RAM _IO(SNAPSHOT_IOC_MAGIC, 11)#define SNAPSHOT_SET_SWAP_AREA _IOW(SNAPSHOT_IOC_MAGIC, 13, \ struct resume_swap_area) -#define SNAPSHOT_GET_IMAGE_SIZE _IOR(SNAPSHOT_IOC_MAGIC, 14, loff_t) +#define SNAPSHOT_GET_IMAGE_SIZE _IOR(SNAPSHOT_IOC_MAGIC, 14, __kernel_loff_t)#define SNAPSHOT_PLATFORM_SUPPORT _IO(SNAPSHOT_IOC_MAGIC, 15)#define SNAPSHOT_POWER_OFF _IO(SNAPSHOT_IOC_MAGIC, 16)#define SNAPSHOT_CREATE_IMAGE _IOW(SNAPSHOT_IOC_MAGIC, 17, int)#define SNAPSHOT_PREF_IMAGE_SIZE _IO(SNAPSHOT_IOC_MAGIC, 18) -#define SNAPSHOT_AVAIL_SWAP_SIZE _IOR(SNAPSHOT_IOC_MAGIC, 19, loff_t) -#define SNAPSHOT_ALLOC_SWAP_PAGE _IOR(SNAPSHOT_IOC_MAGIC, 20, loff_t) +#define SNAPSHOT_AVAIL_SWAP_SIZE _IOR(SNAPSHOT_IOC_MAGIC, 19, __kernel_loff_t) +#define SNAPSHOT_ALLOC_SWAP_PAGE _IOR(SNAPSHOT_IOC_MAGIC, 20, __kernel_loff_t)#define SNAPSHOT_IOC_MAXNR 20#endif /* _LINUX_SUSPEND_IOCTLS_H */
include/linux/time.h +4 -4
@@ -12,14 +12,14 @@#ifndef _STRUCT_TIMESPEC#define _STRUCT_TIMESPECstruct timespec { -time_t tv_sec;/* seconds */ -long tv_nsec;/* nanoseconds */ +__kernel_time_t tv_sec;/* seconds */ +long tv_nsec;/* nanoseconds */ };#endif struct timeval { -time_t tv_sec;/* seconds */ -suseconds_t tv_usec;/* microseconds */ +__kernel_time_t tv_sec;/* seconds */ +__kernel_suseconds_t tv_usec;/* microseconds */ };struct timezone {
include/linux/times.h +4 -4
@@ -4,10 +4,10 @@#include <linux/types.h> struct tms { -clock_t tms_utime; -clock_t tms_stime; -clock_t tms_cutime; -clock_t tms_cstime; +__kernel_clock_t tms_utime; +__kernel_clock_t tms_stime; +__kernel_clock_t tms_cutime; +__kernel_clock_t tms_cstime; };#endif
include/linux/utime.h +2 -2
@@ -4,8 +4,8 @@#include <linux/types.h> struct utimbuf { -time_t actime; -time_t modtime; +__kernel_time_t actime; +__kernel_time_t modtime; };#endif
include/linux/xfrm.h +1 -1
@@ -58,7 +58,7 @@ struct xfrm_selector__u8 prefixlen_s;__u8 proto;int ifindex; -uid_t user; +__kernel_uid32_t user; };#define XFRM_INF (~(__u64)0)
include/mtd/mtd-abi.h +2 -2
@@ -84,8 +84,8 @@ struct otp_info {#define MEMGETREGIONINFO _IOWR('M', 8, struct region_info_user)#define MEMSETOOBSEL _IOW('M', 9, struct nand_oobinfo)#define MEMGETOOBSEL _IOR('M', 10, struct nand_oobinfo) -#define MEMGETBADBLOCK _IOW('M', 11, loff_t) -#define MEMSETBADBLOCK _IOW('M', 12, loff_t) +#define MEMGETBADBLOCK _IOW('M', 11, __kernel_loff_t) +#define MEMSETBADBLOCK _IOW('M', 12, __kernel_loff_t)#define OTPSELECT _IOR('M', 13, int)#define OTPGETREGIONCOUNT _IOW('M', 14, int)#define OTPGETREGIONINFO _IOW('M', 15, struct otp_info)
include/sound/asound.h +2 -2
@@ -385,7 +385,7 @@ struct snd_pcm_sw_params {struct snd_pcm_channel_info {unsigned int channel; -off_t offset;/* mmap offset */ +__kernel_off_t offset;/* mmap offset */ unsigned int first;/* offset to first sample in bits */ unsigned int step;/* samples distance in bits */ };
@@ -789,7 +789,7 @@ struct snd_ctl_elem_info {snd_ctl_elem_type_t type;/* R: value type - SNDRV_CTL_ELEM_TYPE_* */ unsigned int access;/* R: value access (bitmask) - SNDRV_CTL_ELEM_ACCESS_* */ unsigned int count;/* count of values */ -pid_t owner;/* owner's PID of this control */ +__kernel_pid_t owner;/* owner's PID of this control */ union { struct { long min; /* R: minimum value */
[email protected]
maintainerPATCH 2/7 make most exported headers use strict integer types
In reply to [email protected]This takes care of all files that have only a small number of non-strict integer type uses.
--- include/linux/atmlec.h | 5 +- include/linux/atmmpc.h | 44 ++++---- include/linux/cm4000_cs.h | 10 +- include/linux/dlm_netlink.h | 18 ++-- include/linux/dm-ioctl.h | 42 ++++---- include/linux/dvb/audio.h | 2 +- include/linux/dvb/video.h | 22 ++-- include/linux/if_arcnet.h | 27 +++-- include/linux/ip_vs.h | 26 ++-- include/linux/ivtvfb.h | 2 +- include/linux/matroxfb.h | 2 +- include/linux/pfkeyv2.h | 242 +++++++++++++++++++------------------- include/linux/pkt_sched.h | 2 +- include/linux/selinux_netlink.h | 6 +- include/sound/asound.h | 2 +- include/sound/emu10k1.h | 10 +- 16 files changed, 236 insertions(+), 226 deletions(-)
include/linux/atmlec.h +3 -2
@@ -11,6 +11,7 @@#include <linux/atmioc.h> #include <linux/atm.h> #include <linux/if_ether.h> +#include <linux/types.h> /* ATM lec daemon control socket */ #define ATMLEC_CTRL _IO('a', ATMIOC_LANE)
@@ -78,8 +79,8 @@ struct atmlec_msg { } normal;struct atmlec_config_msg config;struct { -uint16_t lec_id;/* requestor lec_id */ -uint32_t tran_id;/* transaction id */ +__u16 lec_id;/* requestor lec_id */ +__u32 tran_id;/* transaction id */ unsigned char mac_addr[ETH_ALEN ];/* dst mac addr */ unsigned char atm_addr[ATM_ESA_LEN ];/* reqestor ATM addr */ } proxy;/*
include/linux/atmmpc.h +23 -22
79 lines not on this page · raw message
include/linux/cm4000_cs.h +6 -4
@@ -1,6 +1,8 @@#ifndef _CM4000_H_#define _CM4000_H_ +#include <linux/types.h> +#define MAX_ATR 33#define CM4000_MAX_DEV 4
@@ -10,9 +12,9 @@* not to break compilation of userspace apps. -HW */ typedef struct atreq { -int32_t atr_len; +__s32 atr_len;unsigned char atr[64 ]; -int32_t power_act; +__s32 power_act;unsigned char bIFSD;unsigned char bIFSC; }atreq_t ;
@@ -22,13 +24,13 @@ typedef struct atreq {* member sizes. This leads to CONFIG_COMPAT breakage, since 32bit userspace * will lay out the structure members differently than the 64bit kernel. * -* I've changed "ptsreq.protocol" from "unsigned long" to "u_int32_t". +* I've changed "ptsreq.protocol" from "unsigned long" to "__u32". * On 32bit this will make no difference. With 64bit kernels, it will make * 32bit apps work, too. */ typedef struct ptsreq { - u_int32_t protocol; /*T=0: 2^0, T=1: 2^1*/ + __u32 protocol; /*T=0: 2^0, T=1: 2^1*/ unsigned char flags; unsigned char pts1; unsigned char pts2;
include/linux/dlm_netlink.h +10 -8
@@ -9,6 +9,8 @@#ifndef _DLM_NETLINK_H#define _DLM_NETLINK_H +#include <linux/types.h> +enum {DLM_STATUS_WAITING =1 , DLM_STATUS_GRANTED = 2,
@@ -18,16 +20,16 @@ enum {#define DLM_LOCK_DATA_VERSION 1struct dlm_lock_data { -uint16_t version; -uint32_t lockspace_id; +__u16 version; +__u32 lockspace_id;int nodeid;int ownpid; -uint32_t id; -uint32_t remid; -uint64_t xid; -int8_t status; -int8_t grmode; -int8_t rqmode; +__u32 id; +__u32 remid; +__u64 xid; +__s8 status; +__s8 grmode; +__s8 rqmode;unsigned long timestamp;int resource_namelen;char resource_name[DLM_RESNAME_MAXLEN ];
include/linux/dm-ioctl.h +21 -21
89 lines not on this page · raw message
include/linux/dvb/audio.h +1 -1
@@ -76,7 +76,7 @@ struct audio_karaoke{ /* if Vocal1 or V } audio_karaoke_t;/* into left and right */ -typedef uint16_t audio_attributes_t ; +typedef __u16 audio_attributes_t ;/* bits: descr. */ /* 15-13 audio coding mode (0=ac3, 2=mpeg1, 3=mpeg2ext, 4=LPCM, 6=DTS, */ /* 12 multichannel extension */
include/linux/dvb/video.h +11 -11
@@ -132,7 +132,7 @@ struct video_command {#define VIDEO_VSYNC_FIELD_PROGRESSIVE (3)struct video_event { -int32_t type; +__s32 type;#define VIDEO_EVENT_SIZE_CHANGED 1#define VIDEO_EVENT_FRAME_RATE_CHANGED 2#define VIDEO_EVENT_DECODER_STOPPED 3
@@ -157,25 +157,25 @@ struct video_status {struct video_still_picture {char __user *iFrame;/* pointer to a single iframe in memory */ -int32_t size; +__s32 size; };typedef struct video_highlight {int active;/* 1=show highlight, 0=hide highlight */ -uint8_t contrast1;/* 7- 4 Pattern pixel contrast */ +__u8 contrast1;/* 7- 4 Pattern pixel contrast */ /* 3- 0 Background pixel contrast */ -uint8_t contrast2;/* 7- 4 Emphasis pixel-2 contrast */ +__u8 contrast2;/* 7- 4 Emphasis pixel-2 contrast */ /* 3- 0 Emphasis pixel-1 contrast */ -uint8_t color1;/* 7- 4 Pattern pixel color */ +__u8 color1;/* 7- 4 Pattern pixel color */ /* 3- 0 Background pixel color */ -uint8_t color2;/* 7- 4 Emphasis pixel-2 color */ +__u8 color2;/* 7- 4 Emphasis pixel-2 color */ /* 3- 0 Emphasis pixel-1 color */ -uint32_t ypos;/* 23-22 auto action mode */ +__u32 ypos;/* 23-22 auto action mode */ /* 21-12 start y */ /* 9- 0 end y */ -uint32_t xpos;/* 23-22 button color number */ +__u32 xpos;/* 23-22 button color number */ /* 21-12 start x */ /* 9- 0 end x */ }video_highlight_t ;
@@ -189,17 +189,17 @@ typedef struct video_spu {typedef struct video_spu_palette {/* SPU Palette information */ int length; -uint8_t __user *palette; +__u8 __user *palette; }video_spu_palette_t ;typedef struct video_navi_pack {int length;/* 0 ... 1024 */ -uint8_t data[1024 ]; +__u8 data[1024 ]; }video_navi_pack_t ; -typedef uint16_t video_attributes_t ; +typedef __u16 video_attributes_t ;/* bits: descr. */ /* 15-14 Video compression mode (0=MPEG-1, 1=MPEG-2) */ /* 13-12 TV system (0=525/60, 1=625/50) */
include/linux/if_arcnet.h +14 -13
@@ -16,6 +16,7 @@#ifndef _LINUX_IF_ARCNET_H#define _LINUX_IF_ARCNET_H +#include <linux/types.h> #include <linux/if_ether.h>
@@ -57,10 +58,10 @@*/ struct arc_rfc1201 { -uint8_t proto;/* protocol ID field - varies */ -uint8_t split_flag;/* for use with split packets */ +__u8 proto;/* protocol ID field - varies */ +__u8 split_flag;/* for use with split packets */ __be16 sequence;/* sequence number */ -uint8_t payload[0 ];/* space remaining in packet (504 bytes)*/ +__u8 payload[0 ];/* space remaining in packet (504 bytes)*/ };#define RFC1201_HDR_SIZE 4
@@ -70,8 +71,8 @@ struct arc_rfc1201*/ struct arc_rfc1051 { -uint8_t proto;/* ARC_P_RFC1051_ARP/RFC1051_IP */ -uint8_t payload[0 ];/* 507 bytes */ +__u8 proto;/* ARC_P_RFC1051_ARP/RFC1051_IP */ +__u8 payload[0 ];/* 507 bytes */ };#define RFC1051_HDR_SIZE 1
@@ -82,20 +83,20 @@ struct arc_rfc1051*/ struct arc_eth_encap { -uint8_t proto;/* Always ARC_P_ETHER */ +__u8 proto;/* Always ARC_P_ETHER */ struct ethhdr eth;/* standard ethernet header (yuck!) */ -uint8_t payload[0 ];/* 493 bytes */ +__u8 payload[0 ];/* 493 bytes */ };#define ETH_ENCAP_HDR_SIZE 14struct arc_cap { -uint8_t proto; -uint8_t cookie[sizeof (int )];/* Actually NOT sent over the network */ +__u8 proto; +__u8 cookie[sizeof (int )];/* Actually NOT sent over the network */ union { -uint8_t ack; -uint8_t raw[0 ];/* 507 bytes */ +__u8 ack; +__u8 raw[0 ];/* 507 bytes */ } mes; };
@@ -109,7 +110,7 @@ struct arc_cap*/ struct arc_hardware { -uint8_t source,/* source ARCnet - filled in automagically */ +__u8 source,/* source ARCnet - filled in automagically */ dest,/* destination ARCnet - 0 for broadcast */ offset[2 ];/* offset bytes (some weird semantics) */ };
@@ -130,7 +131,7 @@ struct archdrstruct arc_rfc1051 rfc1051;struct arc_eth_encap eth_encap;struct arc_cap cap; -uint8_t raw[0 ];/* 508 bytes */ +__u8 raw[0 ];/* 508 bytes */ } soft; };
include/linux/ip_vs.h +13 -13
@@ -96,10 +96,10 @@*/ struct ip_vs_service_user {/* virtual service addresses */ -u_int16_t protocol; +__u16 protocol;__be32 addr;/* virtual ip address */ __be16 port; -u_int32_t fwmark;/* firwall mark of service */ +__u32 fwmark;/* firwall mark of service */ /* virtual service options */ char sched_name[IP_VS_SCHEDNAME_MAXLEN ];
@@ -119,8 +119,8 @@ struct ip_vs_dest_user {int weight;/* destination weight */ /* thresholds for active connections */ -u_int32_t u_threshold;/* upper threshold */ -u_int32_t l_threshold;/* lower threshold */ +__u32 u_threshold;/* upper threshold */ +__u32 l_threshold;/* lower threshold */ };
@@ -159,10 +159,10 @@ struct ip_vs_getinfo {/* The argument to IP_VS_SO_GET_SERVICE */ struct ip_vs_service_entry {/* which service: user fills in these */ -u_int16_t protocol; +__u16 protocol;__be32 addr;/* virtual address */ __be16 port; -u_int32_t fwmark;/* firwall mark of service */ +__u32 fwmark;/* firwall mark of service */ /* service options */ char sched_name[IP_VS_SCHEDNAME_MAXLEN ];
@@ -184,12 +184,12 @@ struct ip_vs_dest_entry {unsigned conn_flags;/* connection flags */ int weight;/* destination weight */ -u_int32_t u_threshold;/* upper threshold */ -u_int32_t l_threshold;/* lower threshold */ +__u32 u_threshold;/* upper threshold */ +__u32 l_threshold;/* lower threshold */ -u_int32_t activeconns;/* active connections */ -u_int32_t inactconns;/* inactive connections */ -u_int32_t persistconns;/* persistent connections */ +__u32 activeconns;/* active connections */ +__u32 inactconns;/* inactive connections */ +__u32 persistconns;/* persistent connections */ /* statistics */ struct ip_vs_stats_user stats;
@@ -199,10 +199,10 @@ struct ip_vs_dest_entry {/* The argument to IP_VS_SO_GET_DESTS */ struct ip_vs_get_dests {/* which service: user fills in these */ -u_int16_t protocol; +__u16 protocol;__be32 addr;/* virtual address */ __be16 port; -u_int32_t fwmark;/* firwall mark of service */ +__u32 fwmark;/* firwall mark of service */ /* number of real servers */ unsigned int num_dests;
include/linux/ivtvfb.h +1 -1
@@ -33,6 +33,6 @@ struct ivtvfb_dma_frame { };#define IVTVFB_IOC_DMA_FRAME _IOW('V', BASE_VIDIOC_PRIVATE+0, struct ivtvfb_dma_frame) -#define FBIO_WAITFORVSYNC _IOW('F', 0x20, u_int32_t) +#define FBIO_WAITFORVSYNC _IOW('F', 0x20, __u32)#endif
include/linux/matroxfb.h +1 -1
@@ -37,7 +37,7 @@ enum matroxfb_ctrl_id {MATROXFB_CID_LAST }; -#define FBIO_WAITFORVSYNC _IOW('F', 0x20, u_int32_t) +#define FBIO_WAITFORVSYNC _IOW('F', 0x20, __u32)#endif
include/linux/pfkeyv2.h +121 -121
346 lines not on this page · raw message
include/linux/pkt_sched.h +1 -1
@@ -515,7 +515,7 @@ enumstruct tc_drr_stats { -__u32 deficit; +u32 deficit; };#endif
include/linux/selinux_netlink.h +4 -2
@@ -12,6 +12,8 @@#ifndef _LINUX_SELINUX_NETLINK_H#define _LINUX_SELINUX_NETLINK_H +#include <linux/types.h> +/* Message types. */ #define SELNL_MSG_BASE 0x10 enum {
@@ -38,11 +40,11 @@ enum selinux_nlgroups {/* Message structures */ struct selnl_msg_setenforce { -int32_t val; +__s32 val; };struct selnl_msg_policyload { -u_int32_t seqno; +__u32 seqno; };#endif /* _LINUX_SELINUX_NETLINK_H */
include/sound/asound.h +3 -2
@@ -23,9 +23,10 @@#ifndef __SOUND_ASOUND_H#define __SOUND_ASOUND_H +#include <linux/types.h> +#ifdef __KERNEL__#include <linux/ioctl.h> -#include <linux/types.h> #include <linux/time.h> #include <asm/byteorder.h>
@@ -342,7 +343,7 @@ struct snd_interval {#define SNDRV_MASK_MAX 256struct snd_mask { -u_int32_t bits[(SNDRV_MASK_MAX +31 )/32 ]; +__u32 bits[(SNDRV_MASK_MAX +31 )/32 ]; };struct snd_pcm_hw_params {
include/sound/emu10k1.h +8 -4
@@ -1,6 +1,8 @@#ifndef __SOUND_EMU10K1_H#define __SOUND_EMU10K1_H +#include <linux/types.h> +/* * Copyright (c) by Jaroslav Kysela <[email protected]>, * Creative Labs, Inc.
@@ -34,6 +36,8 @@#include <sound/timer.h> #include <linux/interrupt.h> #include <linux/mutex.h> +#include <linux/types.h> +#include <asm/io.h> /* ------------------- DEFINES -------------------- */
@@ -2171,7 +2175,7 @@ struct snd_emu10k1_fx8010_code {char name[128 ];DECLARE_BITMAP (gpr_valid,0x200 );/* bitmask of valid initializers */ -u_int32_t __user *gpr_map;/* initializers */ +__u32 __user *gpr_map;/* initializers */ unsigned int gpr_add_control_count;/* count of GPR controls to add/replace */ struct snd_emu10k1_fx8010_control_gpr __user *gpr_add_controls;/* GPR controls to add/replace */
@@ -2184,11 +2188,11 @@ struct snd_emu10k1_fx8010_code {struct snd_emu10k1_fx8010_control_gpr __user *gpr_list_controls;/* listed GPR controls */ DECLARE_BITMAP (tram_valid,0x100 );/* bitmask of valid initializers */ -u_int32_t __user *tram_data_map;/* data initializers */ -u_int32_t __user *tram_addr_map;/* map initializers */ +__u32 __user *tram_data_map;/* data initializers */ +__u32 __user *tram_addr_map;/* map initializers */ DECLARE_BITMAP (code_valid,1024 );/* bitmask of valid instructions */ -u_int32_t __user *code;/* one instruction - 64 bits */ +__u32 __user *code;/* one instruction - 64 bits */ };struct snd_emu10k1_fx8010_tram {
[email protected]
maintainerPATCH 3/7 make MTD headers use strict integer types
In reply to [email protected]The MTD headers traditionally use stdint types rather than the kernel integer types. This converts them to do the same as all the others.
--- include/linux/jffs2.h | 26 ++++++++-------- include/mtd/inftl-user.h | 36 ++++++++++++------------ include/mtd/jffs2-user.h | 4 +- include/mtd/mtd-abi.h | 64 +++++++++++++++++++++--------------------- include/mtd/nftl-user.h | 30 ++++++++++---------- include/mtd/ubi-user.h | 70 +++++++++++++++++++++++----------------------- 6 files changed, 115 insertions(+), 115 deletions(-)
include/linux/jffs2.h +14 -13
@@ -12,6 +12,7 @@#ifndef __LINUX_JFFS2_H__#define __LINUX_JFFS2_H__ +#include <linux/types.h> #include <linux/magic.h> /* You must include something which defines the C99 uintXX_t types.
@@ -91,15 +92,15 @@byteswapping */ typedef struct { -uint32_t v32; +__u32 v32; } __attribute__((packed))jint32_t ;typedef struct { -uint32_t m; +__u32 m; } __attribute__((packed))jmode_t ;typedef struct { -uint16_t v16; +__u16 v16; } __attribute__((packed))jint16_t ;struct jffs2_unknown_node
@@ -121,12 +122,12 @@ struct jffs2_raw_direntjint32_t version;jint32_t ino;/* == zero for unlink */ jint32_t mctime; -uint8_t nsize; -uint8_t type; -uint8_t unused[2 ]; +__u8 nsize; +__u8 type; +__u8 unused[2 ];jint32_t node_crc;jint32_t name_crc; -uint8_t name[0 ]; +__u8 name[0 ]; };/* The JFFS2 raw inode structure: Used for storage on physical media. */
@@ -153,12 +154,12 @@ struct jffs2_raw_inodejint32_t offset;/* Where to begin to write. */ jint32_t csize;/* (Compressed) data size */ jint32_t dsize;/* Size of the node's data. (after decompression) */ -uint8_t compr;/* Compression algorithm used */ -uint8_t usercompr;/* Compression algorithm requested by the user */ +__u8 compr;/* Compression algorithm used */ +__u8 usercompr;/* Compression algorithm requested by the user */ jint16_t flags;/* See JFFS2_INO_FLAG_* */ jint32_t data_crc;/* CRC for the (compressed) data. */ jint32_t node_crc;/* CRC for the raw inode (excluding data) */ -uint8_t data[0 ]; +__u8 data[0 ]; };struct jffs2_raw_xattr {
@@ -168,12 +169,12 @@ struct jffs2_raw_xattr {jint32_t hdr_crc;jint32_t xid;/* XATTR identifier number */ jint32_t version; -uint8_t xprefix; -uint8_t name_len; +__u8 xprefix; +__u8 name_len;jint16_t value_len;jint32_t data_crc;jint32_t node_crc; -uint8_t data[0 ]; +__u8 data[0 ]; } __attribute__((packed));struct jffs2_raw_xref
include/mtd/inftl-user.h +18 -18
@@ -16,33 +16,33 @@/* Block Control Information */ struct inftl_bci { -uint8_t ECCsig[6 ]; -uint8_t Status; -uint8_t Status1; +__u8 ECCsig[6 ]; +__u8 Status; +__u8 Status1; } __attribute__((packed));struct inftl_unithead1 { -uint16_t virtualUnitNo; -uint16_t prevUnitNo; -uint8_t ANAC; -uint8_t NACs; -uint8_t parityPerField; -uint8_t discarded; +__u16 virtualUnitNo; +__u16 prevUnitNo; +__u8 ANAC; +__u8 NACs; +__u8 parityPerField; +__u8 discarded; } __attribute__((packed));struct inftl_unithead2 { -uint8_t parityPerField; -uint8_t ANAC; -uint16_t prevUnitNo; -uint16_t virtualUnitNo; -uint8_t NACs; -uint8_t discarded; +__u8 parityPerField; +__u8 ANAC; +__u16 prevUnitNo; +__u16 virtualUnitNo; +__u8 NACs; +__u8 discarded; } __attribute__((packed));struct inftl_unittail { -uint8_t Reserved[4 ]; -uint16_t EraseMark; -uint16_t EraseMark1; +__u8 Reserved[4 ]; +__u16 EraseMark; +__u16 EraseMark1; } __attribute__((packed));union inftl_uci {
include/mtd/jffs2-user.h +3 -2
@@ -7,6 +7,7 @@/* This file is blessed for inclusion by userspace */ #include <linux/jffs2.h> +#include <linux/types.h> #include <endian.h> #include <byteswap.h>
@@ -19,8 +20,8 @@extern int target_endian; -#define t16 (x) ({ uint16_t __b = (x); (target_endian==__BYTE_ORDER)?__b:bswap_16(__b); }) -#define t32 (x) ({ uint32_t __b = (x); (target_endian==__BYTE_ORDER)?__b:bswap_32(__b); }) +#define t16 (x) ({ __u16 __b = (x); (target_endian==__BYTE_ORDER)?__b:bswap_16(__b); }) +#define t32 (x) ({ __u32 __b = (x); (target_endian==__BYTE_ORDER)?__b:bswap_32(__b); })#define cpu_to_je16 (x) ((jint16_t){t16(x)})#define cpu_to_je32 (x) ((jint32_t){t32(x)})
include/mtd/mtd-abi.h +34 -32
112 lines not on this page · raw message
include/mtd/nftl-user.h +17 -15
@@ -6,33 +6,35 @@#ifndef __MTD_NFTL_USER_H__#define __MTD_NFTL_USER_H__ +#include <linux/types.h> +/* Block Control Information */ struct nftl_bci {unsigned char ECCSig[6 ]; -uint8_t Status; -uint8_t Status1; +__u8 Status; +__u8 Status1; }__attribute__((packed));/* Unit Control Information */ struct nftl_uci0 { -uint16_t VirtUnitNum; -uint16_t ReplUnitNum; -uint16_t SpareVirtUnitNum; -uint16_t SpareReplUnitNum; +__u16 VirtUnitNum; +__u16 ReplUnitNum; +__u16 SpareVirtUnitNum; +__u16 SpareReplUnitNum; } __attribute__((packed));struct nftl_uci1 { -uint32_t WearInfo; -uint16_t EraseMark; -uint16_t EraseMark1; +__u32 WearInfo; +__u16 EraseMark; +__u16 EraseMark1; } __attribute__((packed));struct nftl_uci2 { -uint16_t FoldMark; -uint16_t FoldMark1; -uint32_t unused; +__u16 FoldMark; +__u16 FoldMark1; +__u32 unused; } __attribute__((packed)); union nftl_uci {
@@ -50,9 +52,9 @@ struct nftl_oob {struct NFTLMediaHeader {char DataOrgID[6 ]; -uint16_t NumEraseUnits; -uint16_t FirstPhysicalEUN; -uint32_t FormattedSize; +__u16 NumEraseUnits; +__u16 FirstPhysicalEUN; +__u32 FormattedSize;unsigned char UnitSizeFactor; } __attribute__((packed));
include/mtd/ubi-user.h +37 -35
145 lines not on this page · raw message
Re: [patch 3/7] make MTD headers use strict integer types
I don't know if the idea is to do all at once, but MTD has a lot of things like u_char as well
Signature · 2 lines
- Thiago Galesi
Quoted 528 lines · On Wed, Feb 25, 2009 at 8:51 PM, <[email protected]> wrote:
The MTD headers traditionally use stdint types rather than the kernel integer types. This converts them to do the same as all the others.
Cc David Woodhouse <[email protected]>Signed-off-by Arnd Bergmann <[email protected]>---
include/linux/jffs2.h | 26 ++++++++--------include/mtd/inftl-user.h| 36 ++++++++++++------------include/mtd/jffs2-user.h| 4 +-
include/mtd/mtd-abi.h | 64 +++++++++++++++++++++---------------------include/mtd/nftl-user.h| 30 ++++++++++----------include/mtd/ubi-user.h| 70 +++++++++++++++++++++++-----------------------6 files changed, 115 insertions(+), 115 deletions(-)Index:
linux-2.6/include/linux/jffs2.h
===================================================================include/linux/jffs2.h +1
-0@@ -12,6 +12,7 @@ #ifndef __LINUX_JFFS2_H__ #define __LINUX_JFFS2_H__ +#include <linux/types.h> #include <linux/magic.h> /* You must include something which defines the C99 uintXX_t types.@@ -91,15 +92,15 @@byteswapping */
typedef struct {
-uint32_tv32;
+__u32v32;
} __attribute__((packed))jint32_t;typedef struct {
-uint32_tm;
+__u32m;
} __attribute__((packed))jmode_t;typedef struct {
-uint16_tv16;
+__u16v16;
} __attribute__((packed))jint16_t;struct
jffs2_unknown_nodeinclude/linux/jffs2.h +0
-0@@ -121,12 +122,12 @@ struct jffs2_raw_dirent jint32_t version;jint32_t ino; /* == zero for unlink */
jint32_t mctime;
-uint8_tnsize;
-uint8_ttype;
-uint8_tunused[2];
+__u8nsize;
+__u8type;
+__u8unused[2];
jint32_tnode_crc;
jint32_tname_crc;
-uint8_tname[0];
+__u8name[0];
};/* The JFFS2 raw inode structure: Used for storage on physical media. */
include/linux/jffs2.h +0
-0@@ -153,12 +154,12 @@ struct jffs2_raw_inodejint32_t offset; /* Where to begin to write. */
jint32_tcsize; /* (Compressed) data size */
jint32_t dsize; /* Size of the node's data. (after decompression) */
-uint8_tcompr; /* Compression algorithm used */
-uint8_tusercompr; /* Compression algorithm requested by the user */
+__u8compr; /* Compression algorithm used */
+__u8usercompr; /* Compression algorithm requested by the user */jint16_tflags; /* See JFFS2_INO_FLAG_* */
jint32_tdata_crc; /* CRC for the (compressed) data. */jint32_tnode_crc; /* CRC for the raw inode (excluding data) */
-uint8_tdata[0];
+__u8data[0];
};struct
jffs2_raw_xattr{include/linux/jffs2.h +0
-0@@ -168,12 +169,12 @@ struct jffs2_raw_xattr { jint32_t hdr_crc;jint32_t xid; /* XATTR identifier number */
jint32_tversion;
-uint8_txprefix;
-uint8_tname_len;
+__u8xprefix;
+__u8name_len;
jint16_tvalue_len;
jint32_tdata_crc;
jint32_tnode_crc;
-uint8_tdata[0];
+__u8data[0];
} __attribute__((packed));struct
jffs2_raw_xref
Index:linux-2.6/include/mtd/inftl-user.h
===================================================================include/mtd/inftl-user.h +18
-18@@ -16,33 +16,33 @@ /* Block Control Information */ struct inftl_bci { - uint8_t ECCsig[6]; - uint8_t Status; - uint8_t Status1; + __u8 ECCsig[6]; + __u8 Status; + __u8 Status1; } __attribute__((packed)); struct inftl_unithead1 { - uint16_t virtualUnitNo; - uint16_t prevUnitNo; - uint8_t ANAC; - uint8_t NACs; - uint8_t parityPerField; - uint8_t discarded; + __u16 virtualUnitNo; + __u16 prevUnitNo; + __u8 ANAC; + __u8 NACs; + __u8 parityPerField; + __u8 discarded; } __attribute__((packed)); struct inftl_unithead2 { - uint8_t parityPerField; - uint8_t ANAC; - uint16_t prevUnitNo; - uint16_t virtualUnitNo; - uint8_t NACs; - uint8_t discarded; + __u8 parityPerField; + __u8 ANAC; + __u16 prevUnitNo; + __u16 virtualUnitNo; + __u8 NACs; + __u8 discarded; } __attribute__((packed)); struct inftl_unittail { - uint8_t Reserved[4]; - uint16_t EraseMark; - uint16_t EraseMark1; + __u8 Reserved[4]; + __u16 EraseMark; + __u16 EraseMark1; } __attribute__((packed)); union inftl_uci {Index:
linux-2.6/include/mtd/jffs2-user.h
===================================================================include/mtd/jffs2-user.h +3
-2@@ -7,6 +7,7 @@ /* This file is blessed for inclusion by userspace */ #include <linux/jffs2.h> +#include <linux/types.h> #include <endian.h> #include <byteswap.h>@@ -19,8 +20,8 @@ extern int target_endian; -#define t16 (x) ({ uint16_t __b = (x); (target_endian==__BYTE_ORDER)?__b:bswap_16(__b); }) -#define t32 (x) ({ uint32_t __b = (x); (target_endian==__BYTE_ORDER)?__b:bswap_32(__b); }) +#define t16 (x) ({ __u16 __b = (x); (target_endian==__BYTE_ORDER)?__b:bswap_16(__b); }) +#define t32 (x) ({ __u32 __b = (x); (target_endian==__BYTE_ORDER)?__b:bswap_32(__b); }) #define cpu_to_je16(x) ((jint16_t){t16(x)}) #define cpu_to_je32(x) ((jint32_t){t32(x)})Index:
linux-2.6/include/mtd/mtd-abi.h
===================================================================include/mtd/mtd-abi.h +34
-32@@ -5,14 +5,16 @@ #ifndef __MTD_ABI_H__ #define __MTD_ABI_H__ +#include <linux/types.h> + struct erase_info_user { - uint32_t start; - uint32_t length; + __u32 start; + __u32 length; }; struct mtd_oob_buf { - uint32_t start; - uint32_t length; + __u32 start; + __u32 length; unsigned char __user *ptr; };@@ -48,30 +50,30 @@ struct mtd_oob_buf { #define MTD_OTP_USER 2 struct mtd_info_user { - uint8_t type; - uint32_t flags; - uint32_t size; // Total size of the MTD - uint32_t erasesize; - uint32_t writesize; - uint32_t oobsize; // Amount of OOB data per block (e.g. 16) + __u8 type; + __u32 flags; + __u32 size; // Total size of the MTD + __u32 erasesize; + __u32 writesize; + __u32 oobsize; // Amount of OOB data per block (e.g. 16) /* The below two fields are obsolete and broken, do not use them * (TODO: remove at some point) */ - uint32_t ecctype; - uint32_t eccsize; + __u32 ecctype; + __u32 eccsize; }; struct region_info_user { - uint32_t offset; /* At which this region starts, + __u32 offset; /* At which this region starts, * from the beginning of the MTD */ - uint32_t erasesize; /* For this region */ - uint32_t numblocks; /* Number of blocks in this region */ - uint32_t regionindex; + __u32 erasesize; /* For this region */ + __u32 numblocks; /* Number of blocks in this region */ + __u32 regionindex; }; struct otp_info { - uint32_t start; - uint32_t length; - uint32_t locked; + __u32 start; + __u32 length; + __u32 locked; }; #define MEMGETINFO _IOR('M', 1, struct mtd_info_user)@@ -99,15 +101,15 @@ struct otp_info {* interfaces */ struct nand_oobinfo { - uint32_t useecc; - uint32_t eccbytes; - uint32_t oobfree[8][2]; - uint32_t eccpos[32]; + __u32 useecc; + __u32 eccbytes; + __u32 oobfree[8][2]; + __u32 eccpos[32]; }; struct nand_oobfree { - uint32_t offset; - uint32_t length; + __u32 offset; + __u32 length; }; #define MTD_MAX_OOBFREE_ENTRIES 8@@ -116,9 +118,9 @@ struct nand_oobfree {* diagnosis and to allow creation of raw images */ struct nand_ecclayout { - uint32_t eccbytes; - uint32_t eccpos[64]; - uint32_t oobavail; + __u32 eccbytes; + __u32 eccpos[64]; + __u32 oobavail; struct nand_oobfree oobfree[MTD_MAX_OOBFREE_ENTRIES]; };@@ -131,10 +133,10 @@ struct nand_ecclayout {* @bbtblocks: number of blocks reserved for bad block tables */ struct mtd_ecc_stats { - uint32_t corrected; - uint32_t failed; - uint32_t badblocks; - uint32_t bbtblocks; + __u32 corrected; + __u32 failed; + __u32 badblocks; + __u32 bbtblocks; }; /*Index:
linux-2.6/include/mtd/nftl-user.h
===================================================================include/mtd/nftl-user.h +17
-15@@ -6,33 +6,35 @@ #ifndef __MTD_NFTL_USER_H__ #define __MTD_NFTL_USER_H__ +#include <linux/types.h> + /* Block Control Information */ struct nftl_bci { unsigned char ECCSig[6]; - uint8_t Status; - uint8_t Status1; + __u8 Status; + __u8 Status1; }__attribute__((packed)); /* Unit Control Information */ struct nftl_uci0 { - uint16_t VirtUnitNum; - uint16_t ReplUnitNum; - uint16_t SpareVirtUnitNum; - uint16_t SpareReplUnitNum; + __u16 VirtUnitNum; + __u16 ReplUnitNum; + __u16 SpareVirtUnitNum; + __u16 SpareReplUnitNum; } __attribute__((packed)); struct nftl_uci1 { - uint32_t WearInfo; - uint16_t EraseMark; - uint16_t EraseMark1; + __u32 WearInfo; + __u16 EraseMark; + __u16 EraseMark1; } __attribute__((packed)); struct nftl_uci2 { - uint16_t FoldMark; - uint16_t FoldMark1; - uint32_t unused; + __u16 FoldMark; + __u16 FoldMark1; + __u32 unused; } __attribute__((packed)); union nftl_uci {@@ -50,9 +52,9 @@ struct nftl_oob { struct NFTLMediaHeader { char DataOrgID[6]; - uint16_t NumEraseUnits; - uint16_t FirstPhysicalEUN; - uint32_t FormattedSize; + __u16 NumEraseUnits; + __u16 FirstPhysicalEUN; + __u32 FormattedSize; unsigned char UnitSizeFactor; } __attribute__((packed));Index:
linux-2.6/include/mtd/ubi-user.h
===================================================================include/mtd/ubi-user.h +37
-37@@ -21,6 +21,8 @@ #ifndef __UBI_USER_H__ #define __UBI_USER_H__ +#include <linux/types.h> + /** UBI device creation (the same as MTD device attachment) * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -152,7 +154,7 @@ /* Create an UBI volume */ #define UBI_IOCMKVOL _IOW(UBI_IOC_MAGIC, 0, struct ubi_mkvol_req) /* Remove an UBI volume */ -#define UBI_IOCRMVOL _IOW(UBI_IOC_MAGIC, 1, int32_t) +#define UBI_IOCRMVOL _IOW(UBI_IOC_MAGIC, 1, __s32) /* Re-size an UBI volume */ #define UBI_IOCRSVOL _IOW(UBI_IOC_MAGIC, 2, struct ubi_rsvol_req) /* Re-name volumes */@@ -165,24 +167,24 @@ /* Attach an MTD device */ #define UBI_IOCATT _IOW(UBI_CTRL_IOC_MAGIC, 64, struct ubi_attach_req) /* Detach an MTD device */ -#define UBI_IOCDET _IOW(UBI_CTRL_IOC_MAGIC, 65, int32_t) +#define UBI_IOCDET _IOW(UBI_CTRL_IOC_MAGIC, 65, __s32) /* ioctl commands of UBI volume character devices */ #define UBI_VOL_IOC_MAGIC 'O' /* Start UBI volume update */ -#define UBI_IOCVOLUP _IOW(UBI_VOL_IOC_MAGIC, 0, int64_t) +#define UBI_IOCVOLUP _IOW(UBI_VOL_IOC_MAGIC, 0, __s64) /* LEB erasure command, used for debugging, disabled by default */ -#define UBI_IOCEBER _IOW(UBI_VOL_IOC_MAGIC, 1, int32_t) +#define UBI_IOCEBER _IOW(UBI_VOL_IOC_MAGIC, 1, __s32) /* Atomic LEB change command */ -#define UBI_IOCEBCH _IOW(UBI_VOL_IOC_MAGIC, 2, int32_t) +#define UBI_IOCEBCH _IOW(UBI_VOL_IOC_MAGIC, 2, __s32) /* Map LEB command */ #define UBI_IOCEBMAP _IOW(UBI_VOL_IOC_MAGIC, 3, struct ubi_map_req) /* Unmap LEB command */ -#define UBI_IOCEBUNMAP _IOW(UBI_VOL_IOC_MAGIC, 4, int32_t) +#define UBI_IOCEBUNMAP _IOW(UBI_VOL_IOC_MAGIC, 4, __s32) /* Check if LEB is mapped command */ -#define UBI_IOCEBISMAP _IOR(UBI_VOL_IOC_MAGIC, 5, int32_t) +#define UBI_IOCEBISMAP _IOR(UBI_VOL_IOC_MAGIC, 5, __s32) /* Set an UBI volume property */ #define UBI_IOCSETPROP _IOW(UBI_VOL_IOC_MAGIC, 6, struct ubi_set_prop_req)@@ -260,10 +262,10 @@ enum {* sub-page of the first page and add needed padding. */ struct ubi_attach_req { - int32_t ubi_num; - int32_t mtd_num; - int32_t vid_hdr_offset; - int8_t padding[12]; + __s32 ubi_num; + __s32 mtd_num; + __s32 vid_hdr_offset; + __s8 padding[12]; }; /**@@ -298,13 +300,13 @@ struct ubi_attach_req {* BLOBs, without caring about how to properly align them. */ struct ubi_mkvol_req { - int32_t vol_id; - int32_t alignment; - int64_t bytes; - int8_t vol_type; - int8_t padding1; - int16_t name_len; - int8_t padding2[4]; + __s32 vol_id; + __s32 alignment; + __s64 bytes; + __s8 vol_type; + __s8 padding1; + __s16 name_len; + __s8 padding2[4]; char name[UBI_MAX_VOLUME_NAME + 1]; } __attribute__ ((packed));@@ -320,8 +322,8 @@ struct ubi_mkvol_req {* zero number of bytes). */ struct ubi_rsvol_req { - int64_t bytes; - int32_t vol_id; + __s64 bytes; + __s32 vol_id; } __attribute__ ((packed)); /**@@ -356,12 +358,12 @@ struct ubi_rsvol_req {* re-name request. */ struct ubi_rnvol_req { - int32_t count; - int8_t padding1[12]; + __s32 count; + __s8 padding1[12]; struct { - int32_t vol_id; - int16_t name_len; - int8_t padding2[2]; + __s32 vol_id; + __s16 name_len; + __s8 padding2[2]; char name[UBI_MAX_VOLUME_NAME + 1]; } ents[UBI_MAX_RNVOL]; } __attribute__ ((packed));@@ -375,10 +377,10 @@ struct ubi_rnvol_req {* @padding: reserved for future, not used, has to be zeroed */ struct ubi_leb_change_req { - int32_t lnum; - int32_t bytes; - int8_t dtype; - int8_t padding[7]; + __s32 lnum; + __s32 bytes; + __s8 dtype; + __s8 padding[7]; } __attribute__ ((packed)); /**@@ -388,9 +390,9 @@ struct ubi_leb_change_req {* @padding: reserved for future, not used, has to be zeroed */ struct ubi_map_req { - int32_t lnum; - int8_t dtype; - int8_t padding[3]; + __s32 lnum; + __s8 dtype; + __s8 padding[3]; } __attribute__ ((packed));@@ -402,9 +404,9 @@ struct ubi_map_req {* @value: value to set */ struct ubi_set_prop_req { - uint8_t property; - uint8_t padding[7]; - uint64_t value; + __u8 property; + __u8 padding[7]; + __u64 value; } __attribute__ ((packed)); #endif /* __UBI_USER_H__ */ -- --To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Arnd Bergmann
maintainerRe: [patch 3/7] make MTD headers use strict integer types
Quoted 2 lines · Thiago Galesi
I don't know if the idea is to do all at once, but MTD has a lot of things like
u_charas well
I could not find any of those in the exported parts of the MTD headers, only inside of #ifdef __KERNEL__, where it doesn't do any harm.
Arnd <><
[email protected]
maintainerPATCH 4/7 make drm headers use strict integer types
In reply to [email protected]The drm headers are traditionally shared with BSD and could not use the strict linux integer types. This is over now, so we can use our own types now.
--- include/drm/drm.h | 21 +++--- include/drm/drm_mode.h | 153 ++++++++++++++++++++++----------------------- include/drm/i915_drm.h | 140 +++++++++++++++++++++--------------------- include/drm/mga_drm.h | 18 +++--- include/drm/radeon_drm.h | 4 +- include/drm/via_drm.h | 42 +++++++------ 6 files changed, 190 insertions(+), 188 deletions(-)
include/drm/drm.h +10 -11
@@ -36,8 +36,7 @@#ifndef _DRM_H_#define _DRM_H_ -#if defined(__KERNEL__) -#endif +#include <linux/types.h> #include <asm/ioctl.h> /* For _IO* macros */ #define DRM_IOCTL_NR (n) _IOC_NR(n)#define DRM_IOC_VOID _IOC_NONE
@@ -497,8 +496,8 @@ union drm_wait_vblank {* \sa drmModesetCtl(). */ struct drm_modeset_ctl { -uint32_t crtc; -uint32_t cmd; +__u32 crtc; +__u32 cmd; };/**
@@ -574,29 +573,29 @@ struct drm_set_version {/** DRM_IOCTL_GEM_CLOSE ioctl argument type */ struct drm_gem_close {/** Handle of the object to be closed. */ -uint32_t handle; -uint32_t pad; +__u32 handle; +__u32 pad; };/** DRM_IOCTL_GEM_FLINK ioctl argument type */ struct drm_gem_flink {/** Handle for the object being named */ -uint32_t handle; +__u32 handle;/** Returned global name */ -uint32_t name; +__u32 name; };/** DRM_IOCTL_GEM_OPEN ioctl argument type */ struct drm_gem_open {/** Name of object being opened */ -uint32_t name; +__u32 name;/** Returned handle for the object */ -uint32_t handle; +__u32 handle;/** Returned size of the object */ -uint64_t size; +__u64 size; };#include "drm_mode.h"
include/drm/drm_mode.h +75 -78
233 lines not on this page · raw message
include/drm/i915_drm.h +70 -70
362 lines not on this page · raw message
include/drm/mga_drm.h +10 -8
@@ -35,6 +35,8 @@#ifndef __MGA_DRM_H__#define __MGA_DRM_H__ +#include <linux/types.h> +/* WARNING: If you change any of these defines, make sure to change the * defines in the Xserver file (mga_sarea.h) */
@@ -255,8 +257,8 @@ typedef struct _drm_mga_sarea {#define DRM_IOCTL_MGA_ILOAD DRM_IOW( DRM_COMMAND_BASE + DRM_MGA_ILOAD, drm_mga_iload_t)#define DRM_IOCTL_MGA_BLIT DRM_IOW( DRM_COMMAND_BASE + DRM_MGA_BLIT, drm_mga_blit_t)#define DRM_IOCTL_MGA_GETPARAM DRM_IOWR(DRM_COMMAND_BASE + DRM_MGA_GETPARAM, drm_mga_getparam_t) -#define DRM_IOCTL_MGA_SET_FENCE DRM_IOW( DRM_COMMAND_BASE + DRM_MGA_SET_FENCE, uint32_t) -#define DRM_IOCTL_MGA_WAIT_FENCE DRM_IOWR(DRM_COMMAND_BASE + DRM_MGA_WAIT_FENCE, uint32_t) +#define DRM_IOCTL_MGA_SET_FENCE DRM_IOW( DRM_COMMAND_BASE + DRM_MGA_SET_FENCE, __u32) +#define DRM_IOCTL_MGA_WAIT_FENCE DRM_IOWR(DRM_COMMAND_BASE + DRM_MGA_WAIT_FENCE, __u32)#define DRM_IOCTL_MGA_DMA_BOOTSTRAP DRM_IOWR(DRM_COMMAND_BASE + DRM_MGA_DMA_BOOTSTRAP, drm_mga_dma_bootstrap_t) typedef struct _drm_mga_warp_index {
@@ -310,7 +312,7 @@ typedef struct drm_mga_dma_bootstrap {*/ /*@{ */ unsigned long texture_handle;/**< Handle used to map AGP textures. */ -uint32_t texture_size;/**< Size of the AGP texture region. */ +__u32 texture_size;/**< Size of the AGP texture region. */ /*@} */ /**
@@ -319,7 +321,7 @@ typedef struct drm_mga_dma_bootstrap {* On return from the DRM_MGA_DMA_BOOTSTRAP ioctl, this field will be * filled in with the actual AGP mode. If AGP was not available */ -uint32_t primary_size; +__u32 primary_size;/** * Requested number of secondary DMA buffers.
@@ -329,7 +331,7 @@ typedef struct drm_mga_dma_bootstrap {* allocated. Particularly when PCI DMA is used, this may be * (subtantially) less than the number requested. */ -uint32_t secondary_bin_count; +__u32 secondary_bin_count;/** * Requested size of each secondary DMA buffer.
@@ -338,7 +340,7 @@ typedef struct drm_mga_dma_bootstrap {* dma_mga_dma_bootstrap::secondary_bin_count, it is \b not allowed * to reduce dma_mga_dma_bootstrap::secondary_bin_size. */ -uint32_t secondary_bin_size; +__u32 secondary_bin_size;/** * Bit-wise mask of AGPSTAT2_* values. Currently only \c AGPSTAT2_1X,
@@ -350,12 +352,12 @@ typedef struct drm_mga_dma_bootstrap {* filled in with the actual AGP mode. If AGP was not available * (i.e., PCI DMA was used), this value will be zero. */ -uint32_t agp_mode; +__u32 agp_mode;/** * Desired AGP GART size, measured in megabytes. */ -uint8_t agp_size; +__u8 agp_size; } drm_mga_dma_bootstrap_t; typedef struct drm_mga_clear {
include/drm/radeon_drm.h +3 -1
@@ -33,6 +33,8 @@#ifndef __RADEON_DRM_H__#define __RADEON_DRM_H__ +#include <linux/types.h> +/* WARNING: If you change any of these defines, make sure to change the * defines in the X server file (radeon_sarea.h) */
@@ -722,7 +724,7 @@ typedef struct drm_radeon_irq_wait {typedef struct drm_radeon_setparam {unsigned int param; -int64_t value; +__s64 value; }drm_radeon_setparam_t ;#define RADEON_SETPARAM_FB_LOCATION 1/* determined framebuffer location */
include/drm/via_drm.h +22 -20
94 lines not on this page · raw message
Signature · 3 lines
1.5.6.3 --
[email protected]
maintainerPATCH 5/7 make netfilter use strict integer types
In reply to [email protected]Netfilter traditionally uses BSD integer types in its interface headers. This changes it to use the Linux strict integer types, like everyone else.
--- include/linux/netfilter/nf_conntrack_tcp.h | 6 +++- include/linux/netfilter/nfnetlink.h | 4 +- include/linux/netfilter/nfnetlink_compat.h | 7 ++++- include/linux/netfilter/nfnetlink_log.h | 32 ++++++++++++------------ include/linux/netfilter/nfnetlink_queue.h | 24 +++++++++--------- include/linux/netfilter/x_tables.h | 30 ++++++++++++----------- include/linux/netfilter/xt_CLASSIFY.h | 4 ++- include/linux/netfilter/xt_CONNMARK.h | 8 ++++-- include/linux/netfilter/xt_CONNSECMARK.h | 4 ++- include/linux/netfilter/xt_DSCP.h | 7 +++-- include/linux/netfilter/xt_MARK.h | 6 +++- include/linux/netfilter/xt_NFLOG.h | 12 +++++---- include/linux/netfilter/xt_NFQUEUE.h | 4 ++- include/linux/netfilter/xt_RATEEST.h | 6 +++- include/linux/netfilter/xt_SECMARK.h | 6 +++- include/linux/netfilter/xt_TCPMSS.h | 4 ++- include/linux/netfilter/xt_connbytes.h | 6 +++- include/linux/netfilter/xt_connmark.h | 8 ++++-- include/linux/netfilter/xt_conntrack.h | 12 ++++---- include/linux/netfilter/xt_dccp.h | 14 ++++++---- include/linux/netfilter/xt_dscp.h | 12 +++++---- include/linux/netfilter/xt_esp.h | 6 +++- include/linux/netfilter/xt_hashlimit.h | 32 +++++++++++++----------- include/linux/netfilter/xt_iprange.h | 4 ++- include/linux/netfilter/xt_length.h | 6 +++- include/linux/netfilter/xt_limit.h | 10 ++++--- include/linux/netfilter/xt_mark.h | 8 ++++-- include/linux/netfilter/xt_multiport.h | 18 +++++++------ include/linux/netfilter/xt_owner.h | 8 ++++-- include/linux/netfilter/xt_physdev.h | 6 +++- include/linux/netfilter/xt_policy.h | 14 ++++++---- include/linux/netfilter/xt_rateest.h | 14 ++++++---- include/linux/netfilter/xt_realm.h | 8 ++++-- include/linux/netfilter/xt_recent.h | 12 +++++---- include/linux/netfilter/xt_sctp.h | 36 ++++++++++++++------------- include/linux/netfilter/xt_statistic.h | 14 ++++++---- include/linux/netfilter/xt_string.h | 12 +++++---- include/linux/netfilter/xt_tcpmss.h | 6 +++- include/linux/netfilter/xt_tcpudp.h | 20 ++++++++------- 39 files changed, 260 insertions(+), 190 deletions(-)
include/linux/netfilter/nf_conntrack_tcp.h +4 -2
@@ -2,6 +2,8 @@#define _NF_CONNTRACK_TCP_H/* TCP tracking. */ +#include <linux/types.h> +/* This is exposed to userspace (ctnetlink) */ enum tcp_conntrack {TCP_CONNTRACK_NONE ,
@@ -34,8 +36,8 @@ enum tcp_conntrack {#define IP_CT_TCP_FLAG_DATA_UNACKNOWLEDGED 0x10struct nf_ct_tcp_flags { -u_int8_t flags; -u_int8_t mask; +__u8 flags; +__u8 mask; };#ifdef __KERNEL__
include/linux/netfilter/nfnetlink.h +2 -2
@@ -25,8 +25,8 @@ enum nfnetlink_groups {/* General form of address family dependent message. */ struct nfgenmsg { -u_int8_t nfgen_family;/* AF_xxx */ -u_int8_t version;/* nfnetlink version */ +__u8 nfgen_family;/* AF_xxx */ +__u8 version;/* nfnetlink version */ __be16 res_id;/* resource id */ };
include/linux/netfilter/nfnetlink_compat.h +5 -2
@@ -1,5 +1,8 @@#ifndef _NFNETLINK_COMPAT_H#define _NFNETLINK_COMPAT_H + +#include <linux/types.h> +#ifndef __KERNEL__/* Old nfnetlink macros for userspace */
@@ -20,8 +23,8 @@struct nfattr { -u_int16_t nfa_len; -u_int16_t nfa_type;/* we use 15 bits for the type, and the highest +__u16 nfa_len; +__u16 nfa_type;/* we use 15 bits for the type, and the highest * bit to indicate whether the payload is nested */ };
include/linux/netfilter/nfnetlink_log.h +16 -16
@@ -17,14 +17,14 @@ enum nfulnl_msg_types {struct nfulnl_msg_packet_hdr {__be16 hw_protocol;/* hw protocol (network order) */ -u_int8_t hook;/* netfilter hook */ -u_int8_t _pad; +__u8 hook;/* netfilter hook */ +__u8 _pad; };struct nfulnl_msg_packet_hw {__be16 hw_addrlen; -u_int16_t _pad; -u_int8_t hw_addr[8 ]; +__u16 _pad; +__u8 hw_addr[8 ]; };struct nfulnl_msg_packet_timestamp {
@@ -35,12 +35,12 @@ struct nfulnl_msg_packet_timestamp {enum nfulnl_attr_type {NFULA_UNSPEC ,NFULA_PACKET_HDR , -NFULA_MARK ,/* u_int32_t nfmark */ +NFULA_MARK ,/* __u32 nfmark */ NFULA_TIMESTAMP ,/* nfulnl_msg_packet_timestamp */ -NFULA_IFINDEX_INDEV ,/* u_int32_t ifindex */ -NFULA_IFINDEX_OUTDEV ,/* u_int32_t ifindex */ -NFULA_IFINDEX_PHYSINDEV ,/* u_int32_t ifindex */ -NFULA_IFINDEX_PHYSOUTDEV ,/* u_int32_t ifindex */ +NFULA_IFINDEX_INDEV ,/* __u32 ifindex */ +NFULA_IFINDEX_OUTDEV ,/* __u32 ifindex */ +NFULA_IFINDEX_PHYSINDEV ,/* __u32 ifindex */ +NFULA_IFINDEX_PHYSOUTDEV ,/* __u32 ifindex */ NFULA_HWADDR ,/* nfulnl_msg_packet_hw */ NFULA_PAYLOAD ,/* opaque data payload */ NFULA_PREFIX ,/* string prefix */
@@ -65,23 +65,23 @@ enum nfulnl_msg_config_cmds { };struct nfulnl_msg_config_cmd { -u_int8_t command;/* nfulnl_msg_config_cmds */ +__u8 command;/* nfulnl_msg_config_cmds */ } __attribute__ ((packed));struct nfulnl_msg_config_mode {__be32 copy_range; -u_int8_t copy_mode; -u_int8_t _pad; +__u8 copy_mode; +__u8 _pad; } __attribute__ ((packed));enum nfulnl_attr_config {NFULA_CFG_UNSPEC ,NFULA_CFG_CMD ,/* nfulnl_msg_config_cmd */ NFULA_CFG_MODE ,/* nfulnl_msg_config_mode */ -NFULA_CFG_NLBUFSIZ ,/* u_int32_t buffer size */ -NFULA_CFG_TIMEOUT ,/* u_int32_t in 1/100 s */ -NFULA_CFG_QTHRESH ,/* u_int32_t */ -NFULA_CFG_FLAGS ,/* u_int16_t */ +NFULA_CFG_NLBUFSIZ ,/* __u32 buffer size */ +NFULA_CFG_TIMEOUT ,/* __u32 in 1/100 s */ +NFULA_CFG_QTHRESH ,/* __u32 */ +NFULA_CFG_FLAGS ,/* __u16 */ __NFULA_CFG_MAX };#define NFULA_CFG_MAX (__NFULA_CFG_MAX -1)
include/linux/netfilter/nfnetlink_queue.h +12 -12
@@ -15,13 +15,13 @@ enum nfqnl_msg_types {struct nfqnl_msg_packet_hdr {__be32 packet_id;/* unique ID of packet in queue */ __be16 hw_protocol;/* hw protocol (network order) */ -u_int8_t hook;/* netfilter hook */ +__u8 hook;/* netfilter hook */ } __attribute__ ((packed));struct nfqnl_msg_packet_hw {__be16 hw_addrlen; -u_int16_t _pad; -u_int8_t hw_addr[8 ]; +__u16 _pad; +__u8 hw_addr[8 ]; };struct nfqnl_msg_packet_timestamp {
@@ -33,12 +33,12 @@ enum nfqnl_attr_type {NFQA_UNSPEC ,NFQA_PACKET_HDR ,NFQA_VERDICT_HDR ,/* nfqnl_msg_verdict_hrd */ -NFQA_MARK ,/* u_int32_t nfmark */ +NFQA_MARK ,/* __u32 nfmark */ NFQA_TIMESTAMP ,/* nfqnl_msg_packet_timestamp */ -NFQA_IFINDEX_INDEV ,/* u_int32_t ifindex */ -NFQA_IFINDEX_OUTDEV ,/* u_int32_t ifindex */ -NFQA_IFINDEX_PHYSINDEV ,/* u_int32_t ifindex */ -NFQA_IFINDEX_PHYSOUTDEV ,/* u_int32_t ifindex */ +NFQA_IFINDEX_INDEV ,/* __u32 ifindex */ +NFQA_IFINDEX_OUTDEV ,/* __u32 ifindex */ +NFQA_IFINDEX_PHYSINDEV ,/* __u32 ifindex */ +NFQA_IFINDEX_PHYSOUTDEV ,/* __u32 ifindex */ NFQA_HWADDR ,/* nfqnl_msg_packet_hw */ NFQA_PAYLOAD, /* opaque data payload */
@@ -61,8 +61,8 @@ enum nfqnl_msg_config_cmds { };struct nfqnl_msg_config_cmd { -u_int8_t command;/* nfqnl_msg_config_cmds */ -u_int8_t _pad; +__u8 command;/* nfqnl_msg_config_cmds */ +__u8 _pad;__be16 pf;/* AF_xxx for PF_[UN]BIND */ };
@@ -74,7 +74,7 @@ enum nfqnl_config_mode {struct nfqnl_msg_config_params {__be32 copy_range; -u_int8_t copy_mode;/* enum nfqnl_config_mode */ +__u8 copy_mode;/* enum nfqnl_config_mode */ } __attribute__ ((packed));
@@ -82,7 +82,7 @@ enum nfqnl_attr_config {NFQA_CFG_UNSPEC ,NFQA_CFG_CMD ,/* nfqnl_msg_config_cmd */ NFQA_CFG_PARAMS ,/* nfqnl_msg_config_params */ -NFQA_CFG_QUEUE_MAXLEN ,/* u_int32_t */ +NFQA_CFG_QUEUE_MAXLEN ,/* __u32 */ __NFQA_CFG_MAX };#define NFQA_CFG_MAX (__NFQA_CFG_MAX-1)
include/linux/netfilter/x_tables.h +16 -14
@@ -1,6 +1,8 @@#ifndef _X_TABLES_H#define _X_TABLES_H +#include <linux/types.h> +#define XT_FUNCTION_MAXNAMELEN 30#define XT_TABLE_MAXNAMELEN 32
@@ -8,22 +10,22 @@ struct xt_entry_match {union {struct { -u_int16_t match_size; +__u16 match_size;/* Used by userspace */ char name[XT_FUNCTION_MAXNAMELEN -1 ]; -u_int8_t revision; +__u8 revision; } user;struct { -u_int16_t match_size; +__u16 match_size;/* Used inside the kernel */ struct xt_match *match; } kernel;/* Total length */ -u_int16_t match_size; +__u16 match_size; } u;unsigned char data[0 ];
@@ -33,22 +35,22 @@ struct xt_entry_target {union {struct { -u_int16_t target_size; +__u16 target_size;/* Used by userspace */ char name[XT_FUNCTION_MAXNAMELEN -1 ]; -u_int8_t revision; +__u8 revision; } user;struct { -u_int16_t target_size; +__u16 target_size;/* Used inside the kernel */ struct xt_target *target; } kernel;/* Total length */ -u_int16_t target_size; +__u16 target_size; } u;unsigned char data[0 ];
@@ -74,7 +76,7 @@ struct xt_get_revision {char name[XT_FUNCTION_MAXNAMELEN -1 ]; -u_int8_t revision; +__u8 revision; };/* CONTINUE verdict for targets */
@@ -90,10 +92,10 @@ struct xt_get_revision*/ struct _xt_align { -u_int8_t u8; -u_int16_t u16; -u_int32_t u32; -u_int64_t u64; +__u8 u8; +__u16 u16; +__u32 u32; +__u64 u64; };#define XT_ALIGN (s) (((s) + (__alignof__(struct _xt_align)-1)) \
@@ -109,7 +111,7 @@ struct _xt_alignstruct xt_counters { -u_int64_t pcnt, bcnt;/* Packet and byte counters */ +__u64 pcnt, bcnt;/* Packet and byte counters */ };/* The argument to IPT_SO_ADD_COUNTERS. */
include/linux/netfilter/xt_CLASSIFY.h +3 -1
@@ -1,8 +1,10 @@#ifndef _XT_CLASSIFY_H#define _XT_CLASSIFY_H +#include <linux/types.h> +struct xt_classify_target_info { -u_int32_t priority; +__u32 priority; };#endif /*_XT_CLASSIFY_H */
include/linux/netfilter/xt_CONNMARK.h +5 -3
@@ -1,6 +1,8 @@#ifndef _XT_CONNMARK_H_target#define _XT_CONNMARK_H_target +#include <linux/types.h> +/* Copyright (C) 2002,2004 MARA Systems AB <http://www.marasystems.com> * by Henrik Nordstrom <[email protected]> *
@@ -19,12 +21,12 @@ enum {struct xt_connmark_target_info {unsigned long mark;unsigned long mask; -u_int8_t mode; +__u8 mode; };struct xt_connmark_tginfo1 { -u_int32_t ctmark, ctmask, nfmask; -u_int8_t mode; +__u32 ctmark, ctmask, nfmask; +__u8 mode; };#endif /*_XT_CONNMARK_H_target*/
include/linux/netfilter/xt_CONNSECMARK.h +3 -1
@@ -1,13 +1,15 @@#ifndef _XT_CONNSECMARK_H_target#define _XT_CONNSECMARK_H_target +#include <linux/types.h> +enum {CONNSECMARK_SAVE =1 ,CONNSECMARK_RESTORE , };struct xt_connsecmark_target_info { -u_int8_t mode; +__u8 mode; };#endif /*_XT_CONNSECMARK_H_target */
include/linux/netfilter/xt_DSCP.h +4 -3
@@ -11,15 +11,16 @@#ifndef _XT_DSCP_TARGET_H#define _XT_DSCP_TARGET_H#include <linux/netfilter/xt_dscp.h> +#include <linux/types.h> /* target info */ struct xt_DSCP_info { -u_int8_t dscp; +__u8 dscp; };struct xt_tos_target_info { -u_int8_t tos_value; -u_int8_t tos_mask; +__u8 tos_value; +__u8 tos_mask; };#endif /* _XT_DSCP_TARGET_H */
include/linux/netfilter/xt_MARK.h +4 -2
@@ -1,6 +1,8 @@ #ifndef _XT_MARK_H_target #define _XT_MARK_H_target +#include <linux/types.h> + /* Version 0 */ struct xt_mark_target_info { unsigned long mark;
@@ -15,11 +17,11 @@ enum {struct xt_mark_target_info_v1 {unsigned long mark; -u_int8_t mode; +__u8 mode; };struct xt_mark_tginfo2 { -u_int32_t mark, mask; +__u32 mark, mask; };#endif /*_XT_MARK_H_target */
include/linux/netfilter/xt_NFLOG.h +7 -5
@@ -1,17 +1,19 @@#ifndef _XT_NFLOG_TARGET#define _XT_NFLOG_TARGET +#include <linux/types.h> +#define XT_NFLOG_DEFAULT_GROUP 0x1#define XT_NFLOG_DEFAULT_THRESHOLD 1#define XT_NFLOG_MASK 0x0struct xt_nflog_info { -u_int32_t len; -u_int16_t group; -u_int16_t threshold; -u_int16_t flags; -u_int16_t pad; +__u32 len; +__u16 group; +__u16 threshold; +__u16 flags; +__u16 pad;char prefix[64 ]; };
include/linux/netfilter/xt_NFQUEUE.h +3 -1
@@ -8,9 +8,11 @@#ifndef _XT_NFQ_TARGET_H#define _XT_NFQ_TARGET_H +#include <linux/types.h> +/* target info */ struct xt_NFQ_info { -u_int16_t queuenum; +__u16 queuenum; };#endif /* _XT_NFQ_TARGET_H */
include/linux/netfilter/xt_RATEEST.h +4 -2
@@ -1,10 +1,12 @@ #ifndef _XT_RATEEST_TARGET_H #define _XT_RATEEST_TARGET_H +#include <linux/types.h> + struct xt_rateest_target_info { char name[IFNAMSIZ]; - int8_t interval; - u_int8_t ewma_log; + __s8 interval; + __u8 ewma_log; /* Used internally by the kernel */ struct xt_rateest *est __attribute__((aligned(8)));
include/linux/netfilter/xt_SECMARK.h +4 -2
@@ -1,6 +1,8 @@#ifndef _XT_SECMARK_H_target#define _XT_SECMARK_H_target +#include <linux/types.h> +/* * This is intended for use by various security subsystems (but not * at the same time).
@@ -12,12 +14,12 @@#define SECMARK_SELCTX_MAX 256struct xt_secmark_target_selinux_info { -u_int32_t selsid; +__u32 selsid;char selctx[SECMARK_SELCTX_MAX ]; };struct xt_secmark_target_info { -u_int8_t mode; +__u8 mode;union {struct xt_secmark_target_selinux_info sel; } u;
include/linux/netfilter/xt_TCPMSS.h +3 -1
@@ -1,8 +1,10 @@#ifndef _XT_TCPMSS_H#define _XT_TCPMSS_H +#include <linux/types.h> +struct xt_tcpmss_info { -u_int16_t mss; +__u16 mss; };#define XT_TCPMSS_CLAMP_PMTU 0xffff
include/linux/netfilter/xt_connbytes.h +4 -2
@@ -1,6 +1,8 @@#ifndef _XT_CONNBYTES_H#define _XT_CONNBYTES_H +#include <linux/types.h> +enum xt_connbytes_what {XT_CONNBYTES_PKTS , XT_CONNBYTES_BYTES,
@@ -19,7 +21,7 @@ struct xt_connbytes_infoaligned_u64 from;/* count to be matched */ aligned_u64 to; /* count to be matched */ } count; -u_int8_t what;/* ipt_connbytes_what */ -u_int8_t direction;/* ipt_connbytes_direction */ +__u8 what;/* ipt_connbytes_what */ +__u8 direction;/* ipt_connbytes_direction */ };#endif
include/linux/netfilter/xt_connmark.h +5 -3
@@ -1,6 +1,8 @@#ifndef _XT_CONNMARK_H#define _XT_CONNMARK_H +#include <linux/types.h> +/* Copyright (C) 2002,2004 MARA Systems AB <http://www.marasystems.com> * by Henrik Nordstrom <[email protected]> *
@@ -12,12 +14,12 @@struct xt_connmark_info {unsigned long mark, mask; -u_int8_t invert; +__u8 invert; };struct xt_connmark_mtinfo1 { -u_int32_t mark, mask; -u_int8_t invert; +__u32 mark, mask; +__u8 invert; };#endif /*_XT_CONNMARK_H*/
include/linux/netfilter/xt_conntrack.h +6 -6
@@ -63,9 +63,9 @@ struct xt_conntrack_infounsigned long expires_min, expires_max;/* Flags word */ -u_int8_t flags; +__u8 flags;/* Inverse flags */ -u_int8_t invflags; +__u8 invflags; };struct xt_conntrack_mtinfo1 {
@@ -73,12 +73,12 @@ struct xt_conntrack_mtinfo1 {union nf_inet_addr origdst_addr, origdst_mask;union nf_inet_addr replsrc_addr, replsrc_mask;union nf_inet_addr repldst_addr, repldst_mask; -u_int32_t expires_min, expires_max; -u_int16_t l4proto; +__u32 expires_min, expires_max; +__u16 l4proto;__be16 origsrc_port, origdst_port;__be16 replsrc_port, repldst_port; -u_int16_t match_flags, invert_flags; - u_int8_t state_mask, status_mask; +__u16 match_flags, invert_flags; + __u8 state_mask, status_mask; };#endif /*_XT_CONNTRACK_H*/
include/linux/netfilter/xt_dccp.h +8 -6
@@ -1,6 +1,8 @@#ifndef _XT_DCCP_H_#define _XT_DCCP_H_ +#include <linux/types.h> +#define XT_DCCP_SRC_PORTS 0x01#define XT_DCCP_DEST_PORTS 0x02#define XT_DCCP_TYPE 0x04
@@ -9,14 +11,14 @@#define XT_DCCP_VALID_FLAGS 0x0fstruct xt_dccp_info { -u_int16_t dpts[2 ];/* Min, Max */ -u_int16_t spts[2 ];/* Min, Max */ +__u16 dpts[2 ];/* Min, Max */ +__u16 spts[2 ];/* Min, Max */ -u_int16_t flags; -u_int16_t invflags; +__u16 flags; +__u16 invflags; -u_int16_t typemask; -u_int8_t option; +__u16 typemask; +__u8 option; };#endif /* _XT_DCCP_H_ */
include/linux/netfilter/xt_dscp.h +7 -5
@@ -10,20 +10,22 @@#ifndef _XT_DSCP_H#define _XT_DSCP_H +#include <linux/types.h> +#define XT_DSCP_MASK 0xfc/* 11111100 */ #define XT_DSCP_SHIFT 2#define XT_DSCP_MAX 0x3f/* 00111111 */ /* match info */ struct xt_dscp_info { -u_int8_t dscp; -u_int8_t invert; +__u8 dscp; +__u8 invert; };struct xt_tos_match_info { -u_int8_t tos_mask; -u_int8_t tos_value; -u_int8_t invert; +__u8 tos_mask; +__u8 tos_value; +__u8 invert; };#endif /* _XT_DSCP_H */
include/linux/netfilter/xt_esp.h +4 -2
@@ -1,10 +1,12 @@#ifndef _XT_ESP_H#define _XT_ESP_H +#include <linux/types.h> +struct xt_esp { -u_int32_t spis[2 ];/* Security Parameter Index */ -u_int8_t invflags;/* Inverse flags */ +__u32 spis[2 ];/* Security Parameter Index */ +__u8 invflags;/* Inverse flags */ };/* Values for "invflags" field in struct xt_esp. */
include/linux/netfilter/xt_hashlimit.h +17 -15
@@ -1,6 +1,8 @@#ifndef _XT_HASHLIMIT_H#define _XT_HASHLIMIT_H +#include <linux/types.h> +/* timings are in milliseconds. */ #define XT_HASHLIMIT_SCALE 10000/* 1/10,000 sec period => max of 10,000/sec. Min rate is then 429490
@@ -18,15 +20,15 @@ enum { };struct hashlimit_cfg { -u_int32_t mode;/* bitmask of XT_HASHLIMIT_HASH_* */ -u_int32_t avg;/* Average secs between packets * scale */ -u_int32_t burst;/* Period multiplier for upper limit. */ +__u32 mode;/* bitmask of XT_HASHLIMIT_HASH_* */ +__u32 avg;/* Average secs between packets * scale */ +__u32 burst;/* Period multiplier for upper limit. */ /* user specified */ -u_int32_t size;/* how many buckets */ -u_int32_t max;/* max number of entries */ -u_int32_t gc_interval;/* gc interval */ -u_int32_t expire;/* when do entries expire? */ +__u32 size;/* how many buckets */ +__u32 max;/* max number of entries */ +__u32 gc_interval;/* gc interval */ +__u32 expire;/* when do entries expire? */ };struct xt_hashlimit_info {
@@ -42,17 +44,17 @@ struct xt_hashlimit_info { };struct hashlimit_cfg1 { -u_int32_t mode;/* bitmask of XT_HASHLIMIT_HASH_* */ -u_int32_t avg;/* Average secs between packets * scale */ -u_int32_t burst;/* Period multiplier for upper limit. */ +__u32 mode;/* bitmask of XT_HASHLIMIT_HASH_* */ +__u32 avg;/* Average secs between packets * scale */ +__u32 burst;/* Period multiplier for upper limit. */ /* user specified */ -u_int32_t size;/* how many buckets */ -u_int32_t max;/* max number of entries */ -u_int32_t gc_interval;/* gc interval */ -u_int32_t expire;/* when do entries expire? */ +__u32 size;/* how many buckets */ +__u32 max;/* max number of entries */ +__u32 gc_interval;/* gc interval */ +__u32 expire;/* when do entries expire? */ -u_int8_t srcmask, dstmask; +__u8 srcmask, dstmask; };struct xt_hashlimit_mtinfo1 {
include/linux/netfilter/xt_iprange.h +3 -1
@@ -1,6 +1,8 @@#ifndef _LINUX_NETFILTER_XT_IPRANGE_H#define _LINUX_NETFILTER_XT_IPRANGE_H 1 +#include <linux/types.h> +enum {IPRANGE_SRC =1 <<0 ,/* match source IP address */ IPRANGE_DST = 1 << 1, /* match destination IP address */
@@ -11,7 +13,7 @@ enum {struct xt_iprange_mtinfo {union nf_inet_addr src_min, src_max;union nf_inet_addr dst_min, dst_max; -u_int8_t flags; +__u8 flags; };#endif /* _LINUX_NETFILTER_XT_IPRANGE_H */
include/linux/netfilter/xt_length.h +4 -2
@@ -1,9 +1,11 @@#ifndef _XT_LENGTH_H#define _XT_LENGTH_H +#include <linux/types.h> +struct xt_length_info { -u_int16_t min, max; -u_int8_t invert; +__u16 min, max; +__u8 invert; };#endif /*_XT_LENGTH_H*/
include/linux/netfilter/xt_limit.h +6 -4
@@ -1,19 +1,21 @@ #ifndef _XT_RATE_H #define _XT_RATE_H +#include <linux/types.h> + /* timings are in milliseconds. */ #define XT_LIMIT_SCALE 10000 /* 1/10,000 sec period => max of 10,000/sec. Min rate is then 429490 seconds, or one every 59 hours. */ struct xt_rateinfo { - u_int32_t avg; /* Average secs between packets * scale */ - u_int32_t burst; /* Period multiplier for upper limit. */ + __u32 avg; /* Average secs between packets * scale */ + __u32 burst; /* Period multiplier for upper limit. */ /* Used internally by the kernel */ unsigned long prev; - u_int32_t credit; - u_int32_t credit_cap, cost; + __u32 credit; + __u32 credit_cap, cost; /* Ugly, ugly fucker. */ struct xt_rateinfo *master;
include/linux/netfilter/xt_mark.h +5 -3
@@ -1,14 +1,16 @@#ifndef _XT_MARK_H#define _XT_MARK_H +#include <linux/types.h> +struct xt_mark_info {unsigned long mark, mask; -u_int8_t invert; +__u8 invert; };struct xt_mark_mtinfo1 { -u_int32_t mark, mask; -u_int8_t invert; +__u32 mark, mask; +__u8 invert; };#endif /*_XT_MARK_H*/
include/linux/netfilter/xt_multiport.h +10 -8
@@ -1,6 +1,8 @@#ifndef _XT_MULTIPORT_H#define _XT_MULTIPORT_H +#include <linux/types.h> +enum xt_multiport_flags { XT_MULTIPORT_SOURCE,
@@ -13,18 +15,18 @@ enum xt_multiport_flags/* Must fit inside union xt_matchinfo: 16 bytes */ struct xt_multiport { -u_int8_t flags;/* Type of comparison */ -u_int8_t count;/* Number of ports */ -u_int16_t ports[XT_MULTI_PORTS ];/* Ports */ +__u8 flags;/* Type of comparison */ +__u8 count;/* Number of ports */ +__u16 ports[XT_MULTI_PORTS ];/* Ports */ };struct xt_multiport_v1 { -u_int8_t flags;/* Type of comparison */ -u_int8_t count;/* Number of ports */ -u_int16_t ports[XT_MULTI_PORTS ];/* Ports */ -u_int8_t pflags[XT_MULTI_PORTS ];/* Port flags */ -u_int8_t invert;/* Invert flag */ +__u8 flags;/* Type of comparison */ +__u8 count;/* Number of ports */ +__u16 ports[XT_MULTI_PORTS ];/* Ports */ +__u8 pflags[XT_MULTI_PORTS ];/* Port flags */ +__u8 invert;/* Invert flag */ };#endif /*_XT_MULTIPORT_H*/
include/linux/netfilter/xt_owner.h +5 -3
@@ -1,6 +1,8 @@#ifndef _XT_OWNER_MATCH_H#define _XT_OWNER_MATCH_H +#include <linux/types.h> +enum {XT_OWNER_UID =1 <<0 , XT_OWNER_GID = 1 << 1,
@@ -8,9 +10,9 @@ enum { };struct xt_owner_match_info { -u_int32_t uid_min, uid_max; -u_int32_t gid_min, gid_max; -u_int8_t match, invert; +__u32 uid_min, uid_max; +__u32 gid_min, gid_max; +__u8 match, invert; };#endif /* _XT_OWNER_MATCH_H */
include/linux/netfilter/xt_physdev.h +4 -2
@@ -1,6 +1,8 @@#ifndef _XT_PHYSDEV_H#define _XT_PHYSDEV_H +#include <linux/types.h> +#ifdef __KERNEL__#include <linux/if.h> #endif
@@ -17,8 +19,8 @@ struct xt_physdev_info {char in_mask[IFNAMSIZ ];char physoutdev[IFNAMSIZ ];char out_mask[IFNAMSIZ ]; -u_int8_t invert; - u_int8_t bitmask; +__u8 invert; + __u8 bitmask; };#endif /*_XT_PHYSDEV_H*/
include/linux/netfilter/xt_policy.h +8 -6
@@ -1,6 +1,8 @@#ifndef _XT_POLICY_H#define _XT_POLICY_H +#include <linux/types.h> +#define XT_POLICY_MAX_ELEM 4enum xt_policy_flags
@@ -19,7 +21,7 @@ enum xt_policy_modesstruct xt_policy_spec { -u_int8_t saddr:1 , +__u8 saddr:1 , daddr:1 , proto:1 , mode:1,
@@ -55,9 +57,9 @@ struct xt_policy_elem#endif };__be32 spi; -u_int32_t reqid; -u_int8_t proto; -u_int8_t mode; +__u32 reqid; +__u8 proto; +__u8 mode;struct xt_policy_spec match;struct xt_policy_spec invert;
@@ -66,8 +68,8 @@ struct xt_policy_elemstruct xt_policy_info {struct xt_policy_elem pol[XT_POLICY_MAX_ELEM ]; -u_int16_t flags; -u_int16_t len; +__u16 flags; +__u16 len; };#endif /* _XT_POLICY_H */
include/linux/netfilter/xt_rateest.h +8 -6
@@ -1,6 +1,8 @@#ifndef _XT_RATEEST_MATCH_H#define _XT_RATEEST_MATCH_H +#include <linux/types.h> +enum xt_rateest_match_flags {XT_RATEEST_MATCH_INVERT =1 <<0 , XT_RATEEST_MATCH_ABS = 1<<1,
@@ -20,12 +22,12 @@ enum xt_rateest_match_mode {struct xt_rateest_match_info {char name1[IFNAMSIZ ];char name2[IFNAMSIZ ]; -u_int16_t flags; -u_int16_t mode; -u_int32_t bps1; -u_int32_t pps1; -u_int32_t bps2; -u_int32_t pps2; +__u16 flags; +__u16 mode; +__u32 bps1; +__u32 pps1; +__u32 bps2; +__u32 pps2;/* Used internally by the kernel */ struct xt_rateest *est1 __attribute__((aligned (8 )));
include/linux/netfilter/xt_realm.h +5 -3
@@ -1,10 +1,12 @@#ifndef _XT_REALM_H#define _XT_REALM_H +#include <linux/types.h> +struct xt_realm_info { -u_int32_t id; -u_int32_t mask; -u_int8_t invert; +__u32 id; +__u32 mask; +__u8 invert; };#endif /* _XT_REALM_H */
include/linux/netfilter/xt_recent.h +7 -5
@@ -1,6 +1,8 @@#ifndef _LINUX_NETFILTER_XT_RECENT_H#define _LINUX_NETFILTER_XT_RECENT_H 1 +#include <linux/types.h> +enum {XT_RECENT_CHECK =1 <<0 , XT_RECENT_SET = 1 << 1,
@@ -15,12 +17,12 @@ enum { };struct xt_recent_mtinfo { -u_int32_t seconds; -u_int32_t hit_count; -u_int8_t check_set; -u_int8_t invert; +__u32 seconds; +__u32 hit_count; +__u8 check_set; +__u8 invert;char name[XT_RECENT_NAME_LEN ]; -u_int8_t side; +__u8 side; };#endif /* _LINUX_NETFILTER_XT_RECENT_H */
include/linux/netfilter/xt_sctp.h +19 -17
@@ -1,6 +1,8 @@#ifndef _XT_SCTP_H_#define _XT_SCTP_H_ +#include <linux/types.h> +#define XT_SCTP_SRC_PORTS 0x01#define XT_SCTP_DEST_PORTS 0x02#define XT_SCTP_CHUNK_TYPES 0x04
@@ -8,49 +10,49 @@#define XT_SCTP_VALID_FLAGS 0x07struct xt_sctp_flag_info { -u_int8_t chunktype; -u_int8_t flag; -u_int8_t flag_mask; +__u8 chunktype; +__u8 flag; +__u8 flag_mask; };#define XT_NUM_SCTP_FLAGS 4struct xt_sctp_info { -u_int16_t dpts[2 ];/* Min, Max */ -u_int16_t spts[2 ];/* Min, Max */ +__u16 dpts[2 ];/* Min, Max */ +__u16 spts[2 ];/* Min, Max */ -u_int32_t chunkmap[256 /sizeof (u_int32_t)];/* Bit mask of chunks to be matched according to RFC 2960 */ +__u32 chunkmap[256 /sizeof (__u32)];/* Bit mask of chunks to be matched according to RFC 2960 */ #define SCTP_CHUNK_MATCH_ANY 0x01/* Match if any of the chunk types are present */ #define SCTP_CHUNK_MATCH_ALL 0x02/* Match if all of the chunk types are present */ #define SCTP_CHUNK_MATCH_ONLY 0x04/* Match if these are the only chunk types present */ -u_int32_t chunk_match_type; +__u32 chunk_match_type;struct xt_sctp_flag_info flag_info[XT_NUM_SCTP_FLAGS ];int flag_count; -u_int32_t flags; -u_int32_t invflags; +__u32 flags; +__u32 invflags; };#define bytes (type) (sizeof(type) * 8)#define SCTP_CHUNKMAP_SET (chunkmap, type) \ do { \ - (chunkmap)[type / bytes(u_int32_t)] |= \ - 1 << (type % bytes(u_int32_t)); \ + (chunkmap)[type / bytes(__u32)] |= \ + 1 << (type % bytes(__u32)); \ } while (0)#define SCTP_CHUNKMAP_CLEAR (chunkmap, type) \ do { \ - (chunkmap)[type / bytes(u_int32_t)] &= \ - ~(1 << (type % bytes(u_int32_t))); \ + (chunkmap)[type / bytes(__u32)] &= \ + ~(1 << (type % bytes(__u32))); \ } while (0)#define SCTP_CHUNKMAP_IS_SET (chunkmap, type) \ ({ \ - ((chunkmap)[type / bytes (u_int32_t)] & \ - (1 << (type % bytes (u_int32_t)))) ? 1: 0; \ + ((chunkmap)[type / bytes (__u32)] & \ + (1 << (type % bytes (__u32)))) ? 1: 0; \ })#define SCTP_CHUNKMAP_RESET (chunkmap) \
@@ -65,7 +67,7 @@ struct xt_sctp_info {#define SCTP_CHUNKMAP_IS_CLEAR (chunkmap) \ __sctp_chunkmap_is_clear((chunkmap), ARRAY_SIZE(chunkmap))static inline bool -__sctp_chunkmap_is_clear (const u_int32_t *chunkmap,unsigned int n) +__sctp_chunkmap_is_clear (const __u32 *chunkmap,unsigned int n) {unsigned int i;for (i =0 ; i < n; ++i)
@@ -77,7 +79,7 @@ __sctp_chunkmap_is_clear(const u_int32_t *chunkmap, unsigned int n)#define SCTP_CHUNKMAP_IS_ALL_SET (chunkmap) \ __sctp_chunkmap_is_all_set((chunkmap), ARRAY_SIZE(chunkmap))static inline bool -__sctp_chunkmap_is_all_set (const u_int32_t *chunkmap,unsigned int n) +__sctp_chunkmap_is_all_set (const __u32 *chunkmap,unsigned int n) {unsigned int i;for (i =0 ; i < n; ++i)
include/linux/netfilter/xt_statistic.h +8 -6
@@ -1,6 +1,8 @@#ifndef _XT_STATISTIC_H#define _XT_STATISTIC_H +#include <linux/types.h> +enum xt_statistic_mode {XT_STATISTIC_MODE_RANDOM , XT_STATISTIC_MODE_NTH,
@@ -14,17 +16,17 @@ enum xt_statistic_flags {#define XT_STATISTIC_MASK 0x1struct xt_statistic_info { -u_int16_t mode; -u_int16_t flags; +__u16 mode; +__u16 flags;union {struct { -u_int32_t probability; +__u32 probability; } random;struct { -u_int32_t every; -u_int32_t packet; +__u32 every; +__u32 packet;/* Used internally by the kernel */ -u_int32_t count; +__u32 count; } nth; } u;struct xt_statistic_info *master __attribute__((aligned (8 )));
include/linux/netfilter/xt_string.h +7 -5
@@ -1,6 +1,8 @@#ifndef _XT_STRING_H#define _XT_STRING_H +#include <linux/types.h> +#define XT_STRING_MAX_PATTERN_SIZE 128#define XT_STRING_MAX_ALGO_NAME_SIZE 16
@@ -11,18 +13,18 @@ enum {struct xt_string_info { -u_int16_t from_offset; -u_int16_t to_offset; +__u16 from_offset; +__u16 to_offset;char algo[XT_STRING_MAX_ALGO_NAME_SIZE ];char pattern[XT_STRING_MAX_PATTERN_SIZE ]; -u_int8_t patlen; +__u8 patlen;union {struct { -u_int8_t invert; +__u8 invert; } v0;struct { -u_int8_t flags; +__u8 flags; } v1; } u;
include/linux/netfilter/xt_tcpmss.h +4 -2
@@ -1,9 +1,11 @@#ifndef _XT_TCPMSS_MATCH_H#define _XT_TCPMSS_MATCH_H +#include <linux/types.h> +struct xt_tcpmss_match_info { -u_int16_t mss_min, mss_max; -u_int8_t invert; +__u16 mss_min, mss_max; +__u8 invert; };#endif /*_XT_TCPMSS_MATCH_H*/
include/linux/netfilter/xt_tcpudp.h +11 -9
@@ -1,15 +1,17 @@#ifndef _XT_TCPUDP_H#define _XT_TCPUDP_H +#include <linux/types.h> +/* TCP matching stuff */ struct xt_tcp { -u_int16_t spts[2 ];/* Source port range. */ -u_int16_t dpts[2 ];/* Destination port range. */ -u_int8_t option;/* TCP Option iff non-zero*/ -u_int8_t flg_mask;/* TCP flags mask byte */ -u_int8_t flg_cmp;/* TCP flags compare byte */ -u_int8_t invflags;/* Inverse flags */ +__u16 spts[2 ];/* Source port range. */ +__u16 dpts[2 ];/* Destination port range. */ +__u8 option;/* TCP Option iff non-zero*/ +__u8 flg_mask;/* TCP flags mask byte */ +__u8 flg_cmp;/* TCP flags compare byte */ +__u8 invflags;/* Inverse flags */ };/* Values for "inv" field in struct ipt_tcp. */
@@ -22,9 +24,9 @@ struct xt_tcp/* UDP matching stuff */ struct xt_udp { -u_int16_t spts[2 ];/* Source port range. */ -u_int16_t dpts[2 ];/* Destination port range. */ -u_int8_t invflags;/* Inverse flags */ +__u16 spts[2 ];/* Source port range. */ +__u16 dpts[2 ];/* Destination port range. */ +__u8 invflags;/* Inverse flags */ };/* Values for "invflags" field in struct ipt_udp. */
Signature · 3 lines
1.5.6.3 --
Re: [patch 5/7] make netfilter use strict integer types
Quoted 3 lines · On Thursday 2009-02-26 00:51, [email protected] wrote:
Netfilter traditionally uses BSD integer types in its interface headers. This changes it to use the Linux strict integer types, like everyone else.
I _strongly disagree_ with this move. Userspace also has the uintX types via <stdint.h>/<cstdint>, and now you are adding a dependency on linux/types.h, not to mention that your step can lead to compile time piling up.
IMHO, __uXX should be replaced by uintX_t, but a move this great I will leave to future generations because there is just too much persisting opinions wrt. such proposal. As such I'd like to join and persist on my position and that uintX that we have should be kept.
Quoted 23 lines
index a049df4..3066789 100644
include/linux/netfilter/nf_conntrack_tcp.h +4
-2@@ -2,6 +2,8 @@#define _NF_CONNTRACK_TCP_H/* TCP tracking. */ +#include <linux/types.h> +/* This is exposed to userspace (ctnetlink) */ enum tcp_conntrack {TCP_CONNTRACK_NONE ,@@ -34,8 +36,8 @@ enum tcp_conntrack {#define IP_CT_TCP_FLAG_DATA_UNACKNOWLEDGED 0x10struct nf_ct_tcp_flags { -u_int8_t flags; -u_int8_t mask; +__u8 flags; +__u8 mask; };#ifdef __KERNEL__
Re: [patch 5/7] make netfilter use strict integer types
Quoted 11 lines · Jan Engelhardt
I
_stronglydisagree_with this move. Userspace also has the uintX types via <stdint.h>/<cstdint>, and now you are adding a dependency onlinux/types.h, not to mention that your step can lead to compile time piling up.IMHO,
__uXXshould be replaced byuintX_t, but a move this great I will leave to future generations because there is just too much persisting opinions wrt. such proposal. As such I'd like to join and persist on my position and that uintX that we have should be kept.
We *CAN'T* replace __uXX with uintX_t. Period, full stop, end of story.
It isn't possible to do universally, and doing it non-universally is
just silly. Nor is it likely that this adds anything to the compile time, since most realistic programs will have a dependency on <linux/types.h> through some indirect path.
Now, I have to say I'd personally would prefer if make headers_install did this transformation mechanically for the common integer types, instead of requiring it to have the source code formatted in a specific fashion.
-hpa
Re: [patch 5/7] make netfilter use strict integer types
Quoted 7 lines · H. Peter Anvin
Quoted 5 lines
[...]
IMHO,__uXXshould be replaced byuintX_t, but a move this great I will leave to future generations because there is just too much persisting opinions wrt. such proposal. As such I'd like to join and persist on my position and that uintX that we have should be kept.We *CAN'T* replace
__uXXwithuintX_t. Period, full stop, end of story.
Would the mindful master please elaborate why this is so, if it is indeed not a personal decision.
Re: [patch 5/7] make netfilter use strict integer types
Quoted 10 lines · Jan Engelhardt
Quoted 6 lines · H. Peter Anvin
Quoted 5 lines
[...]
IMHO,__uXXshould be replaced byuintX_t, but a move this great I will leave to future generations because there is just too much persisting opinions wrt. such proposal. As such I'd like to join and persist on my position and that uintX that we have should be kept.We *CAN'T* replace
__uXXwithuintX_t. Period, full stop, end of story.Would the mindful master please elaborate why this is so, if it is indeed not a personal decision.
POSIX has strict rules as to what symbols you are allowed to present into the user-visible namespace. This means you can't use these types for any header that may be indirectly included.
Since we can't use them in general, it's silly to use them for a minority of headers, which would then have different exposure rules than people otherwise can expect.
-hpa
Re: [patch 5/7] make netfilter use strict integer types
In reply to Jan EngelhardtQuoted 16 lines · Jan Engelhardt
Quoted 3 lines · On Thursday 2009-02-26 00:51, [email protected] wrote:
Netfilter traditionally uses BSD integer types in its interface headers. This changes it to use the Linux strict integer types, like everyone else.
I
_stronglydisagree_with this move. Userspace also has the uintX types via <stdint.h>/<cstdint>, and now you are adding a dependency onlinux/types.h, not to mention that your step can lead to compile time piling up.IMHO,
__uXXshould be replaced byuintX_t, but a move this great I will leave to future generations because there is just too much persisting opinions wrt. such proposal. As such I'd like to join and persist on my position and that uintX that we have should be kept.
Quoted 4 lines
include/linux/netfilter/nf_conntrack_tcp.h enum tcp_conntrack { · line 40
Quoted 4 lines
include/linux/netfilter/nf_conntrack_tcp.h +2
-2-u_int8_t flags; -u_int8_t mask; +__u8 flags; +__u8 mask;
Not to mention the fact that the standard type is uint8_t, not u_int8_t as the file currently have, which makes it double broken.
-hpa
David Miller
maintainerRe: [patch 5/7] make netfilter use strict integer types
In reply to Jan EngelhardtFrom: Jan Engelhardt <[email protected]>
Date: Thu, 26 Feb 2009 01:10:25 +0100 (CET)
Quoted 12 lines · On Thursday 2009-02-26 00:51, [email protected] wrote:
Quoted 4 lines
Netfilter traditionally uses BSD integer types in its interface headers. This changes it to use the Linux strict integer types, like everyone else.
I
_stronglydisagree_with this move. Userspace also has the uintX types via <stdint.h>/<cstdint>, and now you are adding a dependency onlinux/types.h, not to mention that your step can lead to compile time piling up.
Quoted 4 lines
IMHO,
__uXXshould be replaced byuintX_t, but a move this great I will leave to future generations because there is just too much persisting opinions wrt. such proposal. As such I'd like to join and persist on my position and that uintX that we have should be kept.
Disagreed, I think we should have done what Arnd is doing a long time ago.
Ending up with linux/types.h in userspace for these kinds of interfaces is already a fore-gone conclusion, it happens already whether you like it or not.
And existing apps will work just fine, since they are already getting stdint.h
As for compile time, since you're already getting linux/types.h in your apps it's a non-argument. But even if it was, what are you compiling netfilter utilities on? A VAX?
Re: [patch 5/7] make netfilter use strict integer types
Quoted 8 lines · David Miller
Disagreed, I think we should have done what Arnd is doing a long time ago.
Ending up with
linux/types.hin userspace for these kinds of interfaces is already a fore-gone conclusion, it happens already whether you like it or not.
Quoted 6 lines
And existing apps will work just fine, since they are already getting
stdint.hAs for compile time, since you're already getting
linux/types.hin your apps it's a non-argument. But even if it was, what are you compiling netfilter utilities on? A VAX?
I take it that you're OK that we merge Arnd's patchset?
-hpa
Re: [patch 5/7] make netfilter use strict integer types
From: "H. Peter Anvin" <[email protected]>
Date: Wed, 25 Feb 2009 16:58:22 -0800
Quoted 12 lines
Quoted 10 lines · David Miller
Disagreed, I think we should have done what Arnd is doing a long time ago.
Ending up withlinux/types.hin userspace for these kinds of interfaces is already a fore-gone conclusion, it happens already whether you like it or not.
And existing apps will work just fine, since they are already gettingstdint.h
As for compile time, since you're already gettinglinux/types.hin your apps it's a non-argument. But even if it was, what are you compiling netfilter utilities on? A VAX?
Quoted 1 line
I take it that you're OK that we merge Arnd's patchset?
Yes, ignore Jan, I think he forgot to take his medication today:
[email protected]
maintainerPATCH 6/7 coda_psdev: dont export internals to user space
In reply to [email protected]Most of this header file makes no sense in user space and should not be exported.
--- include/linux/coda_psdev.h | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-)
include/linux/coda_psdev.h +3 -0
@@ -6,6 +6,8 @@#define CODA_PSDEV_MAJOR 67#define MAX_CODADEVS 5/* how many do we allow */ +#ifdef __KERNEL__ +struct kstatfs ;/* communication pending/processing queues */
@@ -90,3 +92,4 @@ struct upc_req {extern struct venus_comm coda_comms[];#endif +#endif
Signature · 3 lines
1.5.6.3 --
[email protected]
maintainerPATCH 7/7 remove __KERNEL_STRICT_NAMES
In reply to [email protected]With the last used of non-strict names gone from the exported header files, we can remove the old libc5 compatibility cruft from our headers and only export strict types.
--- include/asm-generic/statfs.h | 5 +++-- include/linux/types.h | 13 ++----------- 2 files changed, 5 insertions(+), 13 deletions(-)
include/asm-generic/statfs.h +3 -2
@@ -1,8 +1,9 @@#ifndef _GENERIC_STATFS_H#define _GENERIC_STATFS_H -#ifndef __KERNEL_STRICT_NAMES -# include <linux/types.h> +#include <linux/types.h> + +#ifdef __KERNEL__typedef __kernel_fsid_t fsid_t ;#endif
include/linux/types.h +2 -11
@@ -11,7 +11,7 @@#include <linux/posix_types.h> #include <asm/types.h> -#ifndef __KERNEL_STRICT_NAMES +#ifdef __KERNEL__typedef __u32 __kernel_dev_t ;
@@ -29,7 +29,6 @@ typedef __kernel_timer_t timer_t;typedef __kernel_clockid_t clockid_t ;typedef __kernel_mqd_t mqd_t ; -#ifdef __KERNEL__typedef _Bool bool ;typedef __kernel_uid32_t uid_t ;
@@ -45,14 +44,6 @@ typedef __kernel_old_uid_t old_uid_t;typedef __kernel_old_gid_t old_gid_t ;#endif /* CONFIG_UID16 */ -/* libc5 includes this file to define uid_t, thus uid_t can never change -* when it is included by non-kernel code -*/ -#else -typedef __kernel_uid_t uid_t ; -typedef __kernel_gid_t gid_t ; -#endif /* __KERNEL__ */ -#if defined(__GNUC__)typedef __kernel_loff_t loff_t ;#endif
@@ -154,7 +145,7 @@ typedef unsigned long blkcnt_t;#define pgoff_t unsigned long#endif -#endif /* __KERNEL_STRICT_NAMES */ +#endif /* __KERNEL__ */ /* * Below are truly Linux-specific types that should never collide with
Signature · 3 lines
1.5.6.3 --
Quoted 6 lines · [email protected] wrote:
I've gone through the files again and fixed up all non-strict types I could find. I did not check all architectures for this though.
I split out netfilter, DRM and MTD, because of both size and potentially controversial changes.
I take it this supercedes your previous monolithic patch?
-hpa
Arnd Bergmann
maintainerQuoted 5 lines · H. Peter Anvin
Quoted 3 lines
I split out netfilter, DRM and MTD, because of both size and potentially controversial changes.
I take it this supercedes your previous monolithic patch?
Patch 1/7 supercedes my previous patch and is still as monolithic, except for the separate 6/7 hunk. I only split the integer type patches by subsystem, but I did these from scratch now.
Patch 7/7 is a new one, based on your input from the last time we discussed it.
Arnd <><
Quoted 11 lines · Arnd Bergmann
Quoted 3 lines · H. Peter Anvin
Quoted 2 lines
I split out netfilter, DRM and MTD, because of both size and potentially controversial changes.
I take it this supercedes your previous monolithic patch?
Patch 1/7 supercedes my previous patch and is still as monolithic, except for the separate 6/7 hunk. I only split the integer type patches by subsystem, but I did these from scratch now.
Patch 7/7 is a new one, based on your input from the last time we discussed it.
6/7 we already had in -tip, apparently.
I'm really of two minds regarding the patches that replace pure data types (2/7-5/7). Part of me thinks it would be better to do this via a script in make headers_install, but another part of me thinks that that is a recipe for missing includes.
However, if subsystem maintainers are sharing headers with other platforms, it's probably the only sane road to go.
-hpa
Arnd Bergmann
maintainerQuoted 7 lines · H. Peter Anvin
I'm really of two minds regarding the patches that replace pure data types (2/7-5/7). Part of me thinks it would be better to do this via a script in make
headers_install, but another part of me thinks that that is a recipe for missing includes.However, if subsystem maintainers are sharing headers with other platforms, it's probably the only sane road to go.
The only file I found that is obviously shared across operating systems is linux/coda.h, and I completely left that one alone on the basis that the hacks in there should still work with the new linux/types.h.
Doing an automated conversion on coda.h would guarantee trouble, which I see as an argument for doing the manual approach in general.
The changes outside of mtd, netfilter, drm and pfkeyv2.h are actually pretty minimal. For reference, all other patches touching those files since 2.6.28 have a combined diffstat of
include/drm/drm.h | 26 +++- include/drm/drm_mode.h | 271 ++++++++++++++++++++++++++++++++ include/drm/i915_drm.h | 43 +++++- include/linux/agpgart.h | 1 - include/linux/cyclades.h | 2 - include/linux/dvb/audio.h | 5 - include/linux/dvb/video.h | 7 +- include/linux/if_pppol2tp.h | 2 +- include/linux/matroxfb.h | 2 +- include/linux/mroute6.h | 26 +++- include/linux/netfilter/x_tables.h | 2 +- include/linux/netfilter/xt_conntrack.h | 1 + include/linux/pkt_sched.h | 18 ++ include/linux/ppp_defs.h | 2 + include/linux/time.h | 1 + include/linux/types.h | 24 ++-- include/linux/xfrm.h | 14 ++ include/mtd/inftl-user.h | 2 + include/mtd/ubi-user.h | 134 +++++++++++++--- include/sound/asound.h | 1 + 20 files changed, 530 insertions(+), 54 deletions(-)
As long as the netfilter, mtd and drm maintainers agree, I don't see anything holding up the convert-everything-now approach.
Arnd <><
Quoted 44 lines · Arnd Bergmann
Quoted 7 lines · H. Peter Anvin
I'm really of two minds regarding the patches that replace pure data types (2/7-5/7). Part of me thinks it would be better to do this via a script in make
headers_install, but another part of me thinks that that is a recipe for missing includes.However, if subsystem maintainers are sharing headers with other platforms, it's probably the only sane road to go.
The only file I found that is obviously shared across operating systems is
linux/coda.h, and I completely left that one alone on the basis that the hacks in there should still work with the newlinux/types.h.Doing an automated conversion on
coda.hwould guarantee trouble, which I see as an argument for doing the manual approach in general.The changes outside of mtd, netfilter, drm and
pfkeyv2.hare actually pretty minimal. For reference, all other patches touching those files since 2.6.28 have a combined diffstat ofinclude/drm/drm.h | 26 +++- include/drm/drm_mode.h | 271 ++++++++++++++++++++++++++++++++ include/drm/i915_drm.h | 43 +++++- include/linux/agpgart.h | 1 - include/linux/cyclades.h | 2 - include/linux/dvb/audio.h | 5 - include/linux/dvb/video.h | 7 +- include/linux/if_pppol2tp.h | 2 +- include/linux/matroxfb.h | 2 +- include/linux/mroute6.h | 26 +++- include/linux/netfilter/x_tables.h | 2 +- include/linux/netfilter/xt_conntrack.h | 1 + include/linux/pkt_sched.h | 18 ++ include/linux/ppp_defs.h | 2 + include/linux/time.h | 1 + include/linux/types.h | 24 ++-- include/linux/xfrm.h | 14 ++ include/mtd/inftl-user.h | 2 + include/mtd/ubi-user.h | 134 +++++++++++++--- include/sound/asound.h | 1 + 20 files changed, 530 insertions(+), 54 deletions(-)
Quoted 3 lines
As long as the netfilter, mtd and drm maintainers agree, I don't see anything holding up the convert-everything-now approach.
In addition to that we could also keep tip:core/header-fixes feature-free and pullable. So should any maintainer run into conflicts in that area the branch could be pulled into that tree. (the branch is focused on fixing the situation so generally pullable.)
Ingo