[CRIU] [PATCH] headers: Drop uintX_t usage

Andrew Vagin avagin at parallels.com
Wed Dec 4 19:50:27 PST 2013


Acked-by: Andrew Vagin <avagin at parallels.com>

On Tue, Nov 19, 2013 at 05:28:49PM +0400, Cyrill Gorcunov wrote:
> We have a mess of uintX_t and uX usage. Drop off uintX_t ones.
> 
> Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
> ---
>  arch/arm/include/asm/parasite.h |  2 +-
>  arch/arm/include/asm/types.h    |  6 +++---
>  arch/x86/include/asm/types.h    |  6 +++---
>  include/proc_parse.h            |  8 ++++----
>  include/restorer.h              | 10 +++++-----
>  include/util-pie.h              | 10 +++++-----
>  security.c                      |  2 +-
>  sk-inet.c                       |  6 +++---
>  sockets.c                       | 12 ++++++------
>  9 files changed, 31 insertions(+), 31 deletions(-)
> 
> diff --git a/arch/arm/include/asm/parasite.h b/arch/arm/include/asm/parasite.h
> index 3ea6e3434188..01c4d5899160 100644
> --- a/arch/arm/include/asm/parasite.h
> +++ b/arch/arm/include/asm/parasite.h
> @@ -2,7 +2,7 @@
>  #define __ASM_PARASITE_H__
>  
>  static inline u32 arch_get_tls(void) {
> -	uint32_t res;
> +	u32 res;
>  
>  	asm (
>  	     "adr %%r1, 1f              \n"
> diff --git a/arch/arm/include/asm/types.h b/arch/arm/include/asm/types.h
> index 89bbd9aaa5b5..68d92a22f949 100644
> --- a/arch/arm/include/asm/types.h
> +++ b/arch/arm/include/asm/types.h
> @@ -116,9 +116,9 @@ typedef UserArmRegsEntry UserRegsEntry;
>  
>  #define TI_SP(core) ((core)->ti_arm->gpregs->sp)
>  
> -typedef uint32_t auxv_t;
> +typedef u32 auxv_t;
>  
> -static inline void *decode_pointer(uint64_t v) { return (void*)(uint32_t)v; }
> -static inline uint64_t encode_pointer(void *p) { return (uint32_t)p; }
> +static inline void *decode_pointer(u64 v) { return (void*)(u32)v; }
> +static inline u64 encode_pointer(void *p) { return (u32)p; }
>  
>  #endif /* __CR_ASM_TYPES_H__ */
> diff --git a/arch/x86/include/asm/types.h b/arch/x86/include/asm/types.h
> index 665eea5a7e61..97a15134c1ad 100644
> --- a/arch/x86/include/asm/types.h
> +++ b/arch/x86/include/asm/types.h
> @@ -118,7 +118,7 @@ typedef struct {
>  
>  #define TASK_SIZE ((1UL << 47) - PAGE_SIZE)
>  
> -typedef uint64_t auxv_t;
> +typedef u64 auxv_t;
>  
>  #define REG_RES(regs) ((regs).ax)
>  #define REG_IP(regs)  ((regs).ip)
> @@ -136,7 +136,7 @@ typedef uint64_t auxv_t;
>  
>  typedef UserX86RegsEntry UserRegsEntry;
>  
> -static inline uint64_t encode_pointer(void *p) { return (uint64_t)p; }
> -static inline void *decode_pointer(uint64_t v) { return (void*)v; }
> +static inline u64 encode_pointer(void *p) { return (u64)p; }
> +static inline void *decode_pointer(u64 v) { return (void*)v; }
>  
>  #endif /* __CR_ASM_TYPES_H__ */
> diff --git a/include/proc_parse.h b/include/proc_parse.h
> index 553a8bbc02cc..6c376ccd98c6 100644
> --- a/include/proc_parse.h
> +++ b/include/proc_parse.h
> @@ -84,10 +84,10 @@ struct proc_status_creds {
>  	unsigned int uids[4];
>  	unsigned int gids[4];
>  
> -	uint32_t cap_inh[PROC_CAP_SIZE];
> -	uint32_t cap_prm[PROC_CAP_SIZE];
> -	uint32_t cap_eff[PROC_CAP_SIZE];
> -	uint32_t cap_bnd[PROC_CAP_SIZE];
> +	u32 cap_inh[PROC_CAP_SIZE];
> +	u32 cap_prm[PROC_CAP_SIZE];
> +	u32 cap_eff[PROC_CAP_SIZE];
> +	u32 cap_bnd[PROC_CAP_SIZE];
>  };
>  
>  struct mount_info;
> diff --git a/include/restorer.h b/include/restorer.h
> index f7f31e1e21d9..e6e2da361338 100644
> --- a/include/restorer.h
> +++ b/include/restorer.h
> @@ -126,11 +126,11 @@ struct task_restore_args {
>  	struct restore_posix_timer 	*posix_timers;
>  
>  	CredsEntry			creds;
> -	uint32_t			cap_inh[CR_CAP_SIZE];
> -	uint32_t			cap_prm[CR_CAP_SIZE];
> -	uint32_t			cap_eff[CR_CAP_SIZE];
> -	uint32_t			cap_bnd[CR_CAP_SIZE];
> -	uint32_t			cap_last_cap;
> +	u32				cap_inh[CR_CAP_SIZE];
> +	u32				cap_prm[CR_CAP_SIZE];
> +	u32				cap_eff[CR_CAP_SIZE];
> +	u32				cap_bnd[CR_CAP_SIZE];
> +	u32				cap_last_cap;
>  
>  	MmEntry				mm;
>  	auxv_t				mm_saved_auxv[AT_VECTOR_SIZE];
> diff --git a/include/util-pie.h b/include/util-pie.h
> index 049696c7051b..cbaed4224cfd 100644
> --- a/include/util-pie.h
> +++ b/include/util-pie.h
> @@ -26,11 +26,11 @@
>  struct fd_opts {
>  	char flags;
>  	struct {
> -		uint32_t uid;
> -		uint32_t euid;
> -		uint32_t signum;
> -		uint32_t pid_type;
> -		uint32_t pid;
> +		u32 uid;
> +		u32 euid;
> +		u32 signum;
> +		u32 pid_type;
> +		u32 pid;
>  	} fown;
>  };
>  
> diff --git a/security.c b/security.c
> index 27eaf2ed9921..2e1abdc6adb0 100644
> --- a/security.c
> +++ b/security.c
> @@ -35,7 +35,7 @@ static bool check_ids(unsigned int crid, unsigned int rid, unsigned int eid, uns
>  	return false;
>  }
>  
> -static bool check_caps(uint32_t *inh, uint32_t *eff, uint32_t *prm)
> +static bool check_caps(u32 *inh, u32 *eff, u32 *prm)
>  {
>  	int i;
>  
> diff --git a/sk-inet.c b/sk-inet.c
> index bd431b858fa1..02c653ff31e6 100644
> --- a/sk-inet.c
> +++ b/sk-inet.c
> @@ -568,10 +568,10 @@ union sockaddr_inet {
>  };
>  
>  static int restore_sockaddr(union sockaddr_inet *sa,
> -		int family, uint32_t pb_port, uint32_t *pb_addr)
> +		int family, u32 pb_port, u32 *pb_addr)
>  {
> -	BUILD_BUG_ON(sizeof(sa->v4.sin_addr.s_addr) > PB_ALEN_INET * sizeof(uint32_t));
> -	BUILD_BUG_ON(sizeof(sa->v6.sin6_addr.s6_addr) > PB_ALEN_INET6 * sizeof(uint32_t));
> +	BUILD_BUG_ON(sizeof(sa->v4.sin_addr.s_addr) > PB_ALEN_INET * sizeof(u32));
> +	BUILD_BUG_ON(sizeof(sa->v6.sin6_addr.s6_addr) > PB_ALEN_INET6 * sizeof(u32));
>  
>  	memzero(sa, sizeof(*sa));
>  
> diff --git a/sockets.c b/sockets.c
> index 3869efc58c1c..e2ce240e3b89 100644
> --- a/sockets.c
> +++ b/sockets.c
> @@ -143,20 +143,20 @@ static int restore_bound_dev(int sk, SkOptsEntry *soe)
>   * to move socket image across architectures.
>   */
>  
> -static void encode_filter(struct sock_filter *f, uint64_t *img, int n)
> +static void encode_filter(struct sock_filter *f, u64 *img, int n)
>  {
>  	int i;
>  
>  	BUILD_BUG_ON(sizeof(*f) != sizeof(*img));
>  
>  	for (i = 0; i < n; i++)
> -		img[i] = ((uint64_t)f[i].code << 48) |
> -			 ((uint64_t)f[i].jt << 40) |
> -			 ((uint64_t)f[i].jf << 32) |
> -			 ((uint64_t)f[i].k << 0);
> +		img[i] = ((u64)f[i].code << 48) |
> +			 ((u64)f[i].jt << 40) |
> +			 ((u64)f[i].jf << 32) |
> +			 ((u64)f[i].k << 0);
>  }
>  
> -static void decode_filter(uint64_t *img, struct sock_filter *f, int n)
> +static void decode_filter(u64 *img, struct sock_filter *f, int n)
>  {
>  	int i;
>  
> -- 
> 1.8.3.1
> 
> _______________________________________________
> CRIU mailing list
> CRIU at openvz.org
> https://lists.openvz.org/mailman/listinfo/criu


More information about the CRIU mailing list