linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH resend] asm/types.h: All architectures use int-ll64.h in kernelspace
@ 2011-08-13 19:53 Geert Uytterhoeven
  2011-08-13 21:25 ` Arnd Bergmann
  0 siblings, 1 reply; 4+ messages in thread
From: Geert Uytterhoeven @ 2011-08-13 19:53 UTC (permalink / raw)
  To: Linus Torvalds, Andrew Morton, Arnd Bergmann
  Cc: Randy Dunlap, linux-arch, linux-doc, Linux Kernel Development

Now all 64-bit architectures have been converted to int-ll64.h, we can
deprecate int-l64.h in kernelspace:
  - Add a check to prevent new architectures from using int-l64.h in
    kernelspace,
  - Update documentation, as the casts to (unsigned) long long are no longer
    needed.

For backwards compatibility, alpha, ia64, mips, and powerpc still use
int-l64.h in userspace.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
For the documentation parts:
Acked-by: Randy Dunlap <rdunlap@xenotime.net>
---
 Documentation/printk-formats.txt |    4 ++--
 include/asm-generic/int-l64.h    |   38 +-------------------------------------
 include/asm-generic/types.h      |    3 +--
 3 files changed, 4 insertions(+), 41 deletions(-)

diff --git a/Documentation/printk-formats.txt b/Documentation/printk-formats.txt
index 5df176e..dd8c3d6 100644
--- a/Documentation/printk-formats.txt
+++ b/Documentation/printk-formats.txt
@@ -127,11 +127,11 @@ struct va_format:
 
 u64 SHOULD be printed with %llu/%llx, (unsigned long long):
 
-	printk("%llu", (unsigned long long)u64_var);
+	printk("%llu", u64_var);
 
 s64 SHOULD be printed with %lld/%llx, (long long):
 
-	printk("%lld", (long long)s64_var);
+	printk("%lld", s64_var);
 
 If <type> is dependent on a config option for its size (e.g., sector_t,
 blkcnt_t, phys_addr_t, resource_size_t) or is architecture-dependent
diff --git a/include/asm-generic/int-l64.h b/include/asm-generic/int-l64.h
index 1ca3efc..f07a500 100644
--- a/include/asm-generic/int-l64.h
+++ b/include/asm-generic/int-l64.h
@@ -31,43 +31,7 @@ typedef unsigned long __u64;
 #endif /* __ASSEMBLY__ */
 
 #ifdef __KERNEL__
-
-#ifndef __ASSEMBLY__
-
-typedef signed char s8;
-typedef unsigned char u8;
-
-typedef signed short s16;
-typedef unsigned short u16;
-
-typedef signed int s32;
-typedef unsigned int u32;
-
-typedef signed long s64;
-typedef unsigned long u64;
-
-#define S8_C(x)  x
-#define U8_C(x)  x ## U
-#define S16_C(x) x
-#define U16_C(x) x ## U
-#define S32_C(x) x
-#define U32_C(x) x ## U
-#define S64_C(x) x ## L
-#define U64_C(x) x ## UL
-
-#else /* __ASSEMBLY__ */
-
-#define S8_C(x)  x
-#define U8_C(x)  x
-#define S16_C(x) x
-#define U16_C(x) x
-#define S32_C(x) x
-#define U32_C(x) x
-#define S64_C(x) x
-#define U64_C(x) x
-
-#endif /* __ASSEMBLY__ */
-
+#error Please use <asm-generic/int-ll64.h> in kernelspace
 #endif /* __KERNEL__ */
 
 #endif /* _ASM_GENERIC_INT_L64_H */
diff --git a/include/asm-generic/types.h b/include/asm-generic/types.h
index 7a0f69e..a9672ef 100644
--- a/include/asm-generic/types.h
+++ b/include/asm-generic/types.h
@@ -1,8 +1,7 @@
 #ifndef _ASM_GENERIC_TYPES_H
 #define _ASM_GENERIC_TYPES_H
 /*
- * int-ll64 is used practically everywhere now,
- * so use it as a reasonable default.
+ * int-ll64 is used everywhere now.
  */
 #include <asm-generic/int-ll64.h>
 
-- 
1.7.0.4

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds

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

* Re: [PATCH resend] asm/types.h: All architectures use int-ll64.h in kernelspace
  2011-08-13 19:53 [PATCH resend] asm/types.h: All architectures use int-ll64.h in kernelspace Geert Uytterhoeven
@ 2011-08-13 21:25 ` Arnd Bergmann
  2012-02-11  9:44   ` Al Viro
  0 siblings, 1 reply; 4+ messages in thread
From: Arnd Bergmann @ 2011-08-13 21:25 UTC (permalink / raw)
  To: Geert Uytterhoeven, Al Viro
  Cc: Linus Torvalds, Andrew Morton, Randy Dunlap, linux-arch,
	linux-doc, Linux Kernel Development

On Saturday 13 August 2011 21:53:43 Geert Uytterhoeven wrote:
> Now all 64-bit architectures have been converted to int-ll64.h, we can
> deprecate int-l64.h in kernelspace:
>   - Add a check to prevent new architectures from using int-l64.h in
>     kernelspace,
>   - Update documentation, as the casts to (unsigned) long long are no longer
>     needed.
> 
> For backwards compatibility, alpha, ia64, mips, and powerpc still use
> int-l64.h in userspace.
> 
> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
> For the documentation parts:
> Acked-by: Randy Dunlap <rdunlap@xenotime.net>

I believe that Al Viro is working on a patch to unify all umode_t definitions
so that it becomes unsigned short everywhere. Once that is done,
asm-generic/int-ll64.h can become asm-generic/types.h and all architectures
can use that.

	Arnd

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

* Re: [PATCH resend] asm/types.h: All architectures use int-ll64.h in kernelspace
  2011-08-13 21:25 ` Arnd Bergmann
@ 2012-02-11  9:44   ` Al Viro
  2012-02-13  2:59     ` Arnd Bergmann
  0 siblings, 1 reply; 4+ messages in thread
From: Al Viro @ 2012-02-11  9:44 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Geert Uytterhoeven, Linus Torvalds, Andrew Morton, Randy Dunlap,
	linux-arch, linux-doc, Linux Kernel Development

On Sat, Aug 13, 2011 at 11:25:59PM +0200, Arnd Bergmann wrote:
> On Saturday 13 August 2011 21:53:43 Geert Uytterhoeven wrote:
> > Now all 64-bit architectures have been converted to int-ll64.h, we can
> > deprecate int-l64.h in kernelspace:
> >   - Add a check to prevent new architectures from using int-l64.h in
> >     kernelspace,
> >   - Update documentation, as the casts to (unsigned) long long are no longer
> >     needed.
> > 
> > For backwards compatibility, alpha, ia64, mips, and powerpc still use
> > int-l64.h in userspace.
> > 
> > Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
> > For the documentation parts:
> > Acked-by: Randy Dunlap <rdunlap@xenotime.net>
> 
> I believe that Al Viro is working on a patch to unify all umode_t definitions
> so that it becomes unsigned short everywhere. Once that is done,
> asm-generic/int-ll64.h can become asm-generic/types.h and all architectures
> can use that.

Umm...  That has happened and yes, asm-generic/types.h is currently
equivalent to asm-generic/int-ll64.h.  What exactly are you planning
to do?  Just rename the latter to the former and do search-and-replace
over the tree?  We still have places that pull int-l64.h, albeit only
!__KERNEL__ ones (i.e. everything under #ifdef __KERNEL__ in there
seems to be killable)...

AFAICS, for quite a few of those guys we can simply add bitsperlong.h
and add types.h to generic-y; is that the plan?

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

* Re: [PATCH resend] asm/types.h: All architectures use int-ll64.h in kernelspace
  2012-02-11  9:44   ` Al Viro
@ 2012-02-13  2:59     ` Arnd Bergmann
  0 siblings, 0 replies; 4+ messages in thread
From: Arnd Bergmann @ 2012-02-13  2:59 UTC (permalink / raw)
  To: Al Viro
  Cc: Geert Uytterhoeven, Linus Torvalds, Andrew Morton, Randy Dunlap,
	linux-arch, linux-doc, Linux Kernel Development, David Howells

On Saturday 11 February 2012, Al Viro wrote:

> Umm...  That has happened and yes, asm-generic/types.h is currently
> equivalent to asm-generic/int-ll64.h.  What exactly are you planning
> to do?  Just rename the latter to the former and do search-and-replace
> over the tree?  We still have places that pull int-l64.h, albeit only
> !__KERNEL__ ones (i.e. everything under #ifdef __KERNEL__ in there
> seems to be killable)...
> 
> AFAICS, for quite a few of those guys we can simply add bitsperlong.h
> and add types.h to generic-y; is that the plan?

Yes, I think both would be good cleanups. Maybe David Howells can comment
as well since his user api split is going to change that a bit:
We end up needing only a separate version of uapi/asm/types.h for
alpha/ia64/mips64/powerpc64, while the in-kernel file is ok.

	Arnd

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

end of thread, other threads:[~2012-02-13  3:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-08-13 19:53 [PATCH resend] asm/types.h: All architectures use int-ll64.h in kernelspace Geert Uytterhoeven
2011-08-13 21:25 ` Arnd Bergmann
2012-02-11  9:44   ` Al Viro
2012-02-13  2:59     ` Arnd Bergmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).