[CRIU] [PATCH 17/23] print_hex_l: don't print more than 8 hex digits on non x86_64 architectures

Pavel Emelyanov xemul at parallels.com
Mon Jan 14 05:07:21 EST 2013


On 01/14/2013 11:25 AM, Alexander Kartashov wrote:
> This patch prevents shift overflow warnings on 32-bit architectures.
> 
> Signed-off-by: Alexander Kartashov <alekskartashov at parallels.com>
> ---
>  pie/log-simple.c |    2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/pie/log-simple.c b/pie/log-simple.c
> index eb940c1..58bc6c5 100644
> --- a/pie/log-simple.c
> +++ b/pie/log-simple.c
> @@ -136,6 +136,7 @@ static void print_hex_l(unsigned long num)
>  	hexdigit(num >> 24, &buf[11], &z);
>  	hexdigit(num >> 28, &buf[10], &z);
>  
> +#ifdef CONFIG_X86

It should be a bits-per-long macro instead.

>  	hexdigit(num >> 32, &buf[9], &z);
>  	hexdigit(num >> 36, &buf[8], &z);
>  	hexdigit(num >> 40, &buf[7], &z);
> @@ -144,6 +145,7 @@ static void print_hex_l(unsigned long num)
>  	hexdigit(num >> 52, &buf[4], &z);
>  	hexdigit(num >> 56, &buf[3], &z);
>  	hexdigit(num >> 60, &buf[2], &z);
> +#endif
>  
>  	z -= 2;
>  	z[0] = '0';
> 




More information about the CRIU mailing list