All of lore.kernel.org
 help / color / mirror / Atom feed
From: "H. Peter Anvin" <hpa@zytor.com>
To: kernel-janitors@vger.kernel.org
Subject: Re: [patch -next] x86: dubious one-bit signed bitfields
Date: Wed, 07 Dec 2011 07:39:31 +0000	[thread overview]
Message-ID: <4EDF1833.5050107@zytor.com> (raw)
In-Reply-To: <20111207063848.GA14507@elgon.mountain>

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@oracle.com>
> 
> 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.


  reply	other threads:[~2011-12-07  7:39 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-07  6:38 [patch -next] x86: dubious one-bit signed bitfields Dan Carpenter
2011-12-07  7:39 ` H. Peter Anvin [this message]
2011-12-07  7:58 ` Dan Carpenter
2011-12-07 18:14 ` H. Peter Anvin
2011-12-15 13:45 ` Dan Carpenter
2011-12-15 16:38 ` Andy Lutomirski
2011-12-15 17:06 ` Dan Carpenter
2012-01-04  6:41 ` Dan Carpenter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4EDF1833.5050107@zytor.com \
    --to=hpa@zytor.com \
    --cc=kernel-janitors@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.