2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-28 15:13:55 +08:00
linux-next/arch
Robert P. J. Day 82ddcb0405 [PATCH] extend the set of "__attribute__" shortcut macros
Extend the set of "__attribute__" shortcut macros, and remove identical
(and now superfluous) definitions from a couple of source files.

based on a page at robert love's blog:

	http://rlove.org/log/2005102601

extend the set of shortcut macros defined in compiler-gcc.h with the
following:

#define __packed                       __attribute__((packed))
#define __weak                         __attribute__((weak))
#define __naked                        __attribute__((naked))
#define __noreturn                     __attribute__((noreturn))
#define __pure                         __attribute__((pure))
#define __aligned(x)                   __attribute__((aligned(x)))
#define __printf(a,b)                  __attribute__((format(printf,a,b)))

Once these are in place, it's up to subsystem maintainers to decide if they
want to take advantage of them.  there is already a strong precedent for
using shortcuts like this in the source tree.

The ones that might give people pause are "__aligned" and "__printf", but
shortcuts for both of those are already in use, and in some ways very
confusingly.  note the two very different definitions for a macro named
"ALIGNED":

  drivers/net/sgiseeq.c:#define ALIGNED(x) ((((unsigned long)(x)) + 0xf) & ~(0xf))
  drivers/scsi/ultrastor.c:#define ALIGNED(x) __attribute__((aligned(x)))

also:

  include/acpi/platform/acgcc.h:
    #define ACPI_PRINTF_LIKE(c) __attribute__ ((__format__ (__printf__, c, c+1)))

Given the precedent, then, it seems logical to at least standardize on a
consistent set of these macros.

Signed-off-by: Robert P. J. Day <rpjday@mindspring.com>
Acked-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-02-11 10:51:35 -08:00
..
alpha [PATCH] Consolidate default sched_clock() 2007-02-11 10:51:28 -08:00
arm [PATCH] Consolidate default sched_clock() 2007-02-11 10:51:28 -08:00
arm26 [PATCH] Consolidate default sched_clock() 2007-02-11 10:51:28 -08:00
avr32 [PATCH] Consolidate default sched_clock() 2007-02-11 10:51:28 -08:00
cris [PATCH] Consolidate default sched_clock() 2007-02-11 10:51:28 -08:00
frv [PATCH] disable init/initramfs.c: architectures 2007-02-11 10:51:25 -08:00
h8300 [PATCH] Consolidate default sched_clock() 2007-02-11 10:51:28 -08:00
i386 [PATCH] Consolidate bust_spinlocks() 2007-02-11 10:51:34 -08:00
ia64 [PATCH] Consolidate bust_spinlocks() 2007-02-11 10:51:34 -08:00
m32r [PATCH] Consolidate bust_spinlocks() 2007-02-11 10:51:34 -08:00
m68k [PATCH] Consolidate default sched_clock() 2007-02-11 10:51:28 -08:00
m68knommu [PATCH] Consolidate default sched_clock() 2007-02-11 10:51:28 -08:00
mips [PATCH] extend the set of "__attribute__" shortcut macros 2007-02-11 10:51:35 -08:00
parisc [PATCH] Common compat_sys_sysinfo 2007-02-11 10:51:32 -08:00
powerpc [PATCH] Common compat_sys_sysinfo 2007-02-11 10:51:32 -08:00
ppc [PATCH] disable init/initramfs.c: architectures 2007-02-11 10:51:25 -08:00
s390 [PATCH] Consolidate bust_spinlocks() 2007-02-11 10:51:34 -08:00
sh [PATCH] Consolidate default sched_clock() 2007-02-11 10:51:28 -08:00
sh64 [PATCH] Consolidate default sched_clock() 2007-02-11 10:51:28 -08:00
sparc [PATCH] Consolidate default sched_clock() 2007-02-11 10:51:28 -08:00
sparc64 [PATCH] Common compat_sys_sysinfo 2007-02-11 10:51:32 -08:00
um [PATCH] proc: remove useless (and buggy) ->nlink settings 2007-02-11 10:51:32 -08:00
v850 [PATCH] Consolidate default sched_clock() 2007-02-11 10:51:28 -08:00
x86_64 [PATCH] Consolidate bust_spinlocks() 2007-02-11 10:51:34 -08:00
xtensa [PATCH] Consolidate default sched_clock() 2007-02-11 10:51:28 -08:00