All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86: Get rid of 'dubious one-bit signed bitfield' sprase warning
@ 2012-01-11  1:11 Anton Vorontsov
  2012-01-12 15:53 ` Andy Lutomirski
  2012-01-16  9:04 ` [tip:x86/urgent] x86: Get rid of dubious one-bit signed bitfield tip-bot for Anton Vorontsov
  0 siblings, 2 replies; 3+ messages in thread
From: Anton Vorontsov @ 2012-01-11  1:11 UTC (permalink / raw)
  To: Ingo Molnar, Andy Lutomirski
  Cc: Linus Torvalds, H. Peter Anvin, linux-kernel, Dan Carpenter

This very noisy sparse warning appears on almost every file in the
kernel:

  CHECK   init/main.c
arch/x86/include/asm/thread_info.h:43:55: error: dubious one-bit signed bitfield
arch/x86/include/asm/thread_info.h:44:46: error: dubious one-bit signed bitfield

This patch changes sig_on_uaccess_error and uaccess_err flags to unsigned
type and thus fixes the warning.

Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
---

Not sure why this warning is still there, as it spams the build process
a lot. I googled some discussion dated month ago... but no one sent a
patch?

http://www.spinics.net/lists/linux-kernel-janitors/msg10172.html

I went safest way, i.e. changing types to unsigned instead of bool/__u8.

 arch/x86/include/asm/thread_info.h |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/x86/include/asm/thread_info.h b/arch/x86/include/asm/thread_info.h
index 7404715..bc817cd 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 */
 };
 
 #define INIT_THREAD_INFO(tsk)			\
-- 
1.7.7.3

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] x86: Get rid of 'dubious one-bit signed bitfield' sprase warning
  2012-01-11  1:11 [PATCH] x86: Get rid of 'dubious one-bit signed bitfield' sprase warning Anton Vorontsov
@ 2012-01-12 15:53 ` Andy Lutomirski
  2012-01-16  9:04 ` [tip:x86/urgent] x86: Get rid of dubious one-bit signed bitfield tip-bot for Anton Vorontsov
  1 sibling, 0 replies; 3+ messages in thread
From: Andy Lutomirski @ 2012-01-12 15:53 UTC (permalink / raw)
  To: Anton Vorontsov
  Cc: Ingo Molnar, Linus Torvalds, H. Peter Anvin, linux-kernel, Dan Carpenter

On Tue, Jan 10, 2012 at 5:11 PM, Anton Vorontsov <cbouatmailru@gmail.com> wrote:
> This very noisy sparse warning appears on almost every file in the
> kernel:
>
>  CHECK   init/main.c
> arch/x86/include/asm/thread_info.h:43:55: error: dubious one-bit signed bitfield
> arch/x86/include/asm/thread_info.h:44:46: error: dubious one-bit signed bitfield
>
> This patch changes sig_on_uaccess_error and uaccess_err flags to unsigned
> type and thus fixes the warning.
>
> Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
> ---

Acked-by: Andy Lutomirski <luto@mit.edu>

This structure isn't used by userspace (or not usefully, anyway --
it's not at all stable across releases).

--Andy

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [tip:x86/urgent] x86: Get rid of dubious one-bit signed bitfield
  2012-01-11  1:11 [PATCH] x86: Get rid of 'dubious one-bit signed bitfield' sprase warning Anton Vorontsov
  2012-01-12 15:53 ` Andy Lutomirski
@ 2012-01-16  9:04 ` tip-bot for Anton Vorontsov
  1 sibling, 0 replies; 3+ messages in thread
From: tip-bot for Anton Vorontsov @ 2012-01-16  9:04 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: linux-kernel, hpa, mingo, luto, torvalds, error27, tglx, hpa,
	mingo, cbouatmailru

Commit-ID:  f10448689d95b9516c656ccd4078839e656656e7
Gitweb:     http://git.kernel.org/tip/f10448689d95b9516c656ccd4078839e656656e7
Author:     Anton Vorontsov <cbouatmailru@gmail.com>
AuthorDate: Wed, 11 Jan 2012 05:11:46 +0400
Committer:  Ingo Molnar <mingo@elte.hu>
CommitDate: Mon, 16 Jan 2012 09:39:54 +0100

x86: Get rid of dubious one-bit signed bitfield

This very noisy sparse warning appears on almost every file in
the kernel:

  CHECK   init/main.c
  arch/x86/include/asm/thread_info.h:43:55: error: dubious one-bit
  signed bitfield arch/x86/include/asm/thread_info.h:44:46: error:
  dubious one-bit signed bitfield

Sparse is right and this patch changes sig_on_uaccess_error and
uaccess_err flags to unsigned type and thus fixes the warning.

Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
Acked-by: Andy Lutomirski <luto@mit.edu>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: H. Peter Anvin <hpa@linux.intel.com>
Cc: Dan Carpenter <error27@gmail.com>
Link: http://lkml.kernel.org/r/20120111011146.GA30428@oksana.dev.rtsoft.ru
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
 arch/x86/include/asm/thread_info.h |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/x86/include/asm/thread_info.h b/arch/x86/include/asm/thread_info.h
index 185b719..56a63ff 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 */
 };
 
 #define INIT_THREAD_INFO(tsk)			\

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-01-16  9:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-01-11  1:11 [PATCH] x86: Get rid of 'dubious one-bit signed bitfield' sprase warning Anton Vorontsov
2012-01-12 15:53 ` Andy Lutomirski
2012-01-16  9:04 ` [tip:x86/urgent] x86: Get rid of dubious one-bit signed bitfield tip-bot for Anton Vorontsov

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.