Re: [patch -next] x86: dubious one-bit signed bitfields

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 12/06/2011 10:38 PM, Dan Carpenter wrote:
> It doesn't cause any runtime problems in this case, but bitfields should
> be unsigned.  This file gets included a lot so it generates thousands of
> Sparse warnings about dubious one-bit signed bitfields.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
> 
> diff --git a/arch/x86/include/asm/thread_info.h b/arch/x86/include/asm/thread_info.h
> index 0ecd1a9..114dca1 100644
> --- a/arch/x86/include/asm/thread_info.h
> +++ b/arch/x86/include/asm/thread_info.h
> @@ -40,8 +40,8 @@ struct thread_info {
>  						*/
>  	__u8			supervisor_stack[0];
>  #endif
> -	int			sig_on_uaccess_error:1;
> -	int			uaccess_err:1;	/* uaccess failed */
> +	unsigned int		sig_on_uaccess_error:1;
> +	unsigned int		uaccess_err:1;	/* uaccess failed */
>  };
>  

Can bitfields legally be declared "bool"?  If so it's probably the right
thing, really...

	-hpa
-- 
H. Peter Anvin, Intel Open Source Technology Center
I work for Intel.  I don't speak on their behalf.

--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux