mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Barebox List <barebox@lists.infradead.org>
Subject: [PATCH 02/14] drop __BITS_PER_LONG
Date: Fri, 22 May 2015 08:10:59 +0200	[thread overview]
Message-ID: <1432275071-28554-3-git-send-email-s.hauer@pengutronix.de> (raw)
In-Reply-To: <1432275071-28554-1-git-send-email-s.hauer@pengutronix.de>

The kernel has __BITS_PER_LONG and BITS_PER_LONG. The formaer
is needed for architectures which support 32bit userspace on a
64bit kernel. This is not relevant for barebox, so drop
__BITS_PER_LONG and use BITS_PER_LONG only.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 arch/mips/include/asm/bitsperlong.h |  4 +---
 include/asm-generic/bitsperlong.h   | 22 ----------------------
 include/asm-generic/swab.h          |  2 +-
 3 files changed, 2 insertions(+), 26 deletions(-)

diff --git a/arch/mips/include/asm/bitsperlong.h b/arch/mips/include/asm/bitsperlong.h
index 3e4c10a..4171216 100644
--- a/arch/mips/include/asm/bitsperlong.h
+++ b/arch/mips/include/asm/bitsperlong.h
@@ -1,8 +1,6 @@
 #ifndef __ASM_MIPS_BITSPERLONG_H
 #define __ASM_MIPS_BITSPERLONG_H
 
-#define __BITS_PER_LONG _MIPS_SZLONG
-
-#include <asm-generic/bitsperlong.h>
+#define BITS_PER_LONG _MIPS_SZLONG
 
 #endif /* __ASM_MIPS_BITSPERLONG_H */
diff --git a/include/asm-generic/bitsperlong.h b/include/asm-generic/bitsperlong.h
index 4ae54e0..bb98650 100644
--- a/include/asm-generic/bitsperlong.h
+++ b/include/asm-generic/bitsperlong.h
@@ -1,32 +1,10 @@
 #ifndef __ASM_GENERIC_BITS_PER_LONG
 #define __ASM_GENERIC_BITS_PER_LONG
 
-/*
- * There seems to be no way of detecting this automatically from user
- * space, so 64 bit architectures should override this in their
- * bitsperlong.h. In particular, an architecture that supports
- * both 32 and 64 bit user space must not rely on CONFIG_64BIT
- * to decide it, but rather check a compiler provided macro.
- */
-#ifndef __BITS_PER_LONG
-#define __BITS_PER_LONG 32
-#endif
-
-#ifdef __KERNEL__
-
 #ifdef CONFIG_64BIT
 #define BITS_PER_LONG 64
 #else
 #define BITS_PER_LONG 32
 #endif /* CONFIG_64BIT */
 
-/*
- * FIXME: The check currently breaks x86-64 build, so it's
- * temporarily disabled. Please fix x86-64 and reenable
- */
-#if 0 && BITS_PER_LONG != __BITS_PER_LONG
-#error Inconsistent word size. Check asm/bitsperlong.h
-#endif
-
-#endif /* __KERNEL__ */
 #endif /* __ASM_GENERIC_BITS_PER_LONG */
diff --git a/include/asm-generic/swab.h b/include/asm-generic/swab.h
index a8e9029..3ab5add 100644
--- a/include/asm-generic/swab.h
+++ b/include/asm-generic/swab.h
@@ -9,7 +9,7 @@
  * valid if the compiler supports 64 bit data types.
  */
 
-#if __BITS_PER_LONG == 32
+#if BITS_PER_LONG == 32
 #if defined(__GNUC__) && !defined(__STRICT_ANSI__) || defined(__KERNEL__)
 #define __SWAB_64_THRU_32__
 #endif
-- 
2.1.4


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  parent reply	other threads:[~2015-05-22  6:11 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-22  6:10 Introduce asm-generic/posix_types.h Sascha Hauer
2015-05-22  6:10 ` [PATCH 01/14] dma: Use generic place for dma_addr_t typedef Sascha Hauer
2015-05-22  6:10 ` Sascha Hauer [this message]
2015-05-22  6:11 ` [PATCH 03/14] introduce bitsperlong.h for remaining architectures Sascha Hauer
2015-05-22  6:11 ` [PATCH 04/14] introduce generic posix_types.h Sascha Hauer
2015-05-22  6:11 ` [PATCH 05/14] remove unused nlink_t Sascha Hauer
2015-05-22  6:11 ` [PATCH 06/14] ARM: use generic posix_types.h Sascha Hauer
2015-05-22  6:11 ` [PATCH 07/14] blackfin: " Sascha Hauer
2015-05-22  6:11 ` [PATCH 08/14] x86: " Sascha Hauer
2015-05-22  6:11 ` [PATCH 09/14] openrisc: " Sascha Hauer
2015-05-22  6:11 ` [PATCH 10/14] mips: " Sascha Hauer
2015-05-22  6:11 ` [PATCH 11/14] ppc: " Sascha Hauer
2015-05-22  6:11 ` [PATCH 12/14] sandbox: " Sascha Hauer
2015-05-22  6:11 ` [PATCH 13/14] efi: " Sascha Hauer
2015-05-22  6:11 ` [PATCH 14/14] nios2: " Sascha Hauer

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=1432275071-28554-3-git-send-email-s.hauer@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox