Subsystems (2)
Folks,
I apologize for the goof ups. I know accepting newbie patches must be annoying. If it's any consolation I'm trying hard to learn the ropes with a simple patches so I can contribute more substantial stuff later.
Thanks,
Gideon
PATCH 1/2 compiler-gcc.h: Added a new macro to wrap gcc attribute
This is resend, I've corrected the mistakes from the last patch.
Added __mode(x) into compiler-gcc.h as part of a cleanup task I've taken up, to replace gcc specific attributes with macros.
Last accepted patch I sent into linux-next for crypto: d8c34b949d8c:
crypto: Replaced gcc specific attributes with macros from compiler.h
The last commit of this task that went through you: 52f5684c8e1ec
kernel: use macros from compiler.h instead of __attribute__((...))
The next patch is for cleaning up the m68k subsystem and it requires a new macro to wrap __attribute__ ((mode (...)))
--- include/linux/compiler-gcc.h | 1 + 1 file changed, 1 insertion(+)
include/linux/compiler-gcc.h +1 -0
@@ -121,6 +121,7 @@#define __attribute_const__ __attribute__((__const__))#define __maybe_unused __attribute__((unused))#define __always_unused __attribute__((unused)) +#define __mode (x) __attribute__((mode(x)))/* gcc version specific checks */
Signature · 1 line
2.7.4
PATCH 1/2 compiler-gcc.h: Added a new macro to wrap gcc attribute
In reply to Gideon Israel DsouzaThis is resend, I've corrected the mistakes from the last patch.
Added __mode(x) into compiler-gcc.h as part of a cleanup task I've taken up, to replace gcc specific attributes with macros.
Last accepted patch I sent into linux-next for crypto: d8c34b949d8c:
crypto: Replaced gcc specific attributes with macros from compiler.h
The last commit of this task that went through you: 52f5684c8e1ec
kernel: use macros from compiler.h instead of __attribute__((...))
The next patch is for cleaning up the m68k subsystem and it requires a new macro to wrap __attribute__ ((mode (...)))
--- include/linux/compiler-gcc.h | 1 + 1 file changed, 1 insertion(+)
include/linux/compiler-gcc.h +1 -0
@@ -121,6 +121,7 @@#define __attribute_const__ __attribute__((__const__))#define __maybe_unused __attribute__((unused))#define __always_unused __attribute__((unused)) +#define __mode (x) __attribute__((mode(x)))/* gcc version specific checks */
Signature · 1 line
2.7.4
PATCH 2/2 m68k: replaced gcc specific macros with ones from compiler.h
In reply to Gideon Israel DsouzaThere is <linux/compiler.h> which provides macros for various gcc specific constructs. Eg: __weak for __attribute__((weak)). I've cleaned all instances of gcc specific attributes with the right macros for all files under /arch/m68k
This patch depends on the previous with changes in /include/linux/compiler-gcc.h
--- arch/m68k/68000/bootlogo-vz.h | 4 +++- arch/m68k/68000/bootlogo.h | 4 +++- arch/m68k/include/asm/MC68328.h | 3 ++- arch/m68k/include/asm/MC68EZ328.h | 3 ++- arch/m68k/include/asm/MC68VZ328.h | 2 +- arch/m68k/include/asm/natfeat.h | 3 ++- arch/m68k/lib/ashldi3.c | 8 ++++---- arch/m68k/lib/ashrdi3.c | 8 ++++---- arch/m68k/lib/lshrdi3.c | 8 ++++---- arch/m68k/lib/muldi3.c | 8 ++++---- 10 files changed, 29 insertions(+), 22 deletions(-)
arch/m68k/68000/bootlogo-vz.h +3 -1
@@ -1,6 +1,8 @@ +#include <linux/compiler.h> +#define splash_width 640#define splash_height 480 -unsigned char __attribute__ ((aligned (16 ))) bootlogo_bits[] = { +unsigned char __aligned(16) bootlogo_bits[] = {0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,
arch/m68k/68000/bootlogo.h +3 -1
@@ -1,6 +1,8 @@ +#include <linux/compiler.h> +#define bootlogo_width 160#define bootlogo_height 160 -unsigned char __attribute__ ((aligned (16 ))) bootlogo_bits[] = { +unsigned char __aligned(16) bootlogo_bits[] = {0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x55 ,0x01 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x40 ,0x55 ,0x01 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,
arch/m68k/include/asm/MC68328.h +2 -1
@@ -8,6 +8,7 @@* Copyright (C) 1998 Kenneth Albanowski <[email protected]>, * */ +#include <linux/compiler.h> #ifndef _MC68328_H_#define _MC68328_H_
@@ -993,7 +994,7 @@ typedef volatile struct {volatile unsigned short int pad1;volatile unsigned short int pad2;volatile unsigned short int pad3; -} __attribute__((packed)) m68328_uart; +}__packed m68328_uart;/**********
arch/m68k/include/asm/MC68EZ328.h +2 -1
@@ -9,6 +9,7 @@* The Silver Hammer Group, Ltd. * */ +#include <linux/compiler.h> #ifndef _MC68EZ328_H_#define _MC68EZ328_H_
@@ -815,7 +816,7 @@ typedef volatile struct {volatile unsigned short int nipr;volatile unsigned short int pad1;volatile unsigned short int pad2; -} __attribute__((packed)) m68328_uart; +}__packed m68328_uart;/**********
arch/m68k/include/asm/MC68VZ328.h +1 -1
@@ -909,7 +909,7 @@ typedef struct {volatile unsigned short int nipr;volatile unsigned short int hmark;volatile unsigned short int unused; -} __attribute__((packed)) m68328_uart; +}__packed m68328_uart;
arch/m68k/include/asm/natfeat.h +2 -1
@@ -6,6 +6,7 @@* This software may be used and distributed according to the terms of * the GNU General Public License (GPL), incorporated herein by reference. */ +#include <linux/compiler.h> #ifndef _NATFEAT_H#define _NATFEAT_H
@@ -17,6 +18,6 @@ void nf_init(void);void nf_shutdown (void ); void nfprint(const char *fmt, ...) - __attribute__ ((format (printf,1 ,2 ))); + __printf(1, 2);# endif /* _NATFEAT_H */
arch/m68k/lib/ashldi3.c +4 -4
@@ -18,10 +18,10 @@ GNU General Public License for more details. */#define BITS_PER_UNIT 8 -typedef int SItype __attribute__ ((mode (SI ))); -typedef unsigned int USItype __attribute__ ((mode (SI ))); -typedef int DItype __attribute__ ((mode (DI ))); -typedef int word_type __attribute__ ((mode (__word__))); +typedef int SItype __mode(SI); +typedef unsigned int USItype __mode(SI); +typedef int DItype __mode(DI); +typedef int word_type __mode(__word__);struct DIstruct {SItype high, low;};
arch/m68k/lib/ashrdi3.c +4 -4
@@ -18,10 +18,10 @@ GNU General Public License for more details. */#define BITS_PER_UNIT 8 -typedef int SItype __attribute__ ((mode (SI ))); -typedef unsigned int USItype __attribute__ ((mode (SI ))); -typedef int DItype __attribute__ ((mode (DI ))); -typedef int word_type __attribute__ ((mode (__word__))); +typedef int SItype __mode(SI); +typedef unsigned int USItype __mode(SI); +typedef int DItype __mode(DI); +typedef int word_type __mode(__word__);struct DIstruct {SItype high, low;};
arch/m68k/lib/lshrdi3.c +4 -4
@@ -18,10 +18,10 @@ GNU General Public License for more details. */#define BITS_PER_UNIT 8 -typedef int SItype __attribute__ ((mode (SI ))); -typedef unsigned int USItype __attribute__ ((mode (SI ))); -typedef int DItype __attribute__ ((mode (DI ))); -typedef int word_type __attribute__ ((mode (__word__))); +typedef int SItype __mode(SI); +typedef unsigned int USItype __mode(SI); +typedef int DItype __mode(DI); +typedef int word_type __mode(__word__);struct DIstruct {SItype high, low;};
arch/m68k/lib/muldi3.c +4 -4
@@ -65,10 +65,10 @@ GNU General Public License for more details. */umul_ppmm (__w.s.high, __w.s.low, u, v); \ __w.ll; }) -typedef int SItype __attribute__ ((mode (SI ))); -typedef unsigned int USItype __attribute__ ((mode (SI ))); -typedef int DItype __attribute__ ((mode (DI ))); -typedef int word_type __attribute__ ((mode (__word__))); +typedef int SItype __mode(SI); +typedef unsigned int USItype __mode(SI); +typedef int DItype __mode(DI); +typedef int word_type __mode(__word__);struct DIstruct {SItype high, low;};
Signature · 1 line
2.7.4
PATCH 2/2 m68k: replaced gcc specific macros with ones from compiler.h
In reply to Gideon Israel DsouzaThere is <linux/compiler.h> which provides macros for various gcc specific constructs. Eg: __weak for __attribute__((weak)). I've cleaned all instances of gcc specific attributes with the right macros for all files under /arch/m68k
This patch depends on the previous with changes in /include/linux/compiler-gcc.h
--- arch/m68k/68000/bootlogo-vz.h | 4 +++- arch/m68k/68000/bootlogo.h | 4 +++- arch/m68k/include/asm/MC68328.h | 3 ++- arch/m68k/include/asm/MC68EZ328.h | 3 ++- arch/m68k/include/asm/MC68VZ328.h | 2 +- arch/m68k/include/asm/natfeat.h | 3 ++- arch/m68k/lib/ashldi3.c | 8 ++++---- arch/m68k/lib/ashrdi3.c | 8 ++++---- arch/m68k/lib/lshrdi3.c | 8 ++++---- arch/m68k/lib/muldi3.c | 8 ++++---- 10 files changed, 29 insertions(+), 22 deletions(-)
arch/m68k/68000/bootlogo-vz.h +3 -1
@@ -1,6 +1,8 @@ +#include <linux/compiler.h> +#define splash_width 640#define splash_height 480 -unsigned char __attribute__ ((aligned (16 ))) bootlogo_bits[] = { +unsigned char __aligned(16) bootlogo_bits[] = {0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,
arch/m68k/68000/bootlogo.h +3 -1
@@ -1,6 +1,8 @@ +#include <linux/compiler.h> +#define bootlogo_width 160#define bootlogo_height 160 -unsigned char __attribute__ ((aligned (16 ))) bootlogo_bits[] = { +unsigned char __aligned(16) bootlogo_bits[] = {0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x55 ,0x01 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x40 ,0x55 ,0x01 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,
arch/m68k/include/asm/MC68328.h +2 -1
@@ -8,6 +8,7 @@* Copyright (C) 1998 Kenneth Albanowski <[email protected]>, * */ +#include <linux/compiler.h> #ifndef _MC68328_H_#define _MC68328_H_
@@ -993,7 +994,7 @@ typedef volatile struct {volatile unsigned short int pad1;volatile unsigned short int pad2;volatile unsigned short int pad3; -} __attribute__((packed)) m68328_uart; +}__packed m68328_uart;/**********
arch/m68k/include/asm/MC68EZ328.h +2 -1
@@ -9,6 +9,7 @@* The Silver Hammer Group, Ltd. * */ +#include <linux/compiler.h> #ifndef _MC68EZ328_H_#define _MC68EZ328_H_
@@ -815,7 +816,7 @@ typedef volatile struct {volatile unsigned short int nipr;volatile unsigned short int pad1;volatile unsigned short int pad2; -} __attribute__((packed)) m68328_uart; +}__packed m68328_uart;/**********
arch/m68k/include/asm/MC68VZ328.h +1 -1
@@ -909,7 +909,7 @@ typedef struct {volatile unsigned short int nipr;volatile unsigned short int hmark;volatile unsigned short int unused; -} __attribute__((packed)) m68328_uart; +}__packed m68328_uart;
arch/m68k/include/asm/natfeat.h +2 -1
@@ -6,6 +6,7 @@* This software may be used and distributed according to the terms of * the GNU General Public License (GPL), incorporated herein by reference. */ +#include <linux/compiler.h> #ifndef _NATFEAT_H#define _NATFEAT_H
@@ -17,6 +18,6 @@ void nf_init(void);void nf_shutdown (void ); void nfprint(const char *fmt, ...) - __attribute__ ((format (printf,1 ,2 ))); + __printf(1, 2);# endif /* _NATFEAT_H */
arch/m68k/lib/ashldi3.c +4 -4
@@ -18,10 +18,10 @@ GNU General Public License for more details. */#define BITS_PER_UNIT 8 -typedef int SItype __attribute__ ((mode (SI ))); -typedef unsigned int USItype __attribute__ ((mode (SI ))); -typedef int DItype __attribute__ ((mode (DI ))); -typedef int word_type __attribute__ ((mode (__word__))); +typedef int SItype __mode(SI); +typedef unsigned int USItype __mode(SI); +typedef int DItype __mode(DI); +typedef int word_type __mode(__word__);struct DIstruct {SItype high, low;};
arch/m68k/lib/ashrdi3.c +4 -4
@@ -18,10 +18,10 @@ GNU General Public License for more details. */#define BITS_PER_UNIT 8 -typedef int SItype __attribute__ ((mode (SI ))); -typedef unsigned int USItype __attribute__ ((mode (SI ))); -typedef int DItype __attribute__ ((mode (DI ))); -typedef int word_type __attribute__ ((mode (__word__))); +typedef int SItype __mode(SI); +typedef unsigned int USItype __mode(SI); +typedef int DItype __mode(DI); +typedef int word_type __mode(__word__);struct DIstruct {SItype high, low;};
arch/m68k/lib/lshrdi3.c +4 -4
@@ -18,10 +18,10 @@ GNU General Public License for more details. */#define BITS_PER_UNIT 8 -typedef int SItype __attribute__ ((mode (SI ))); -typedef unsigned int USItype __attribute__ ((mode (SI ))); -typedef int DItype __attribute__ ((mode (DI ))); -typedef int word_type __attribute__ ((mode (__word__))); +typedef int SItype __mode(SI); +typedef unsigned int USItype __mode(SI); +typedef int DItype __mode(DI); +typedef int word_type __mode(__word__);struct DIstruct {SItype high, low;};
arch/m68k/lib/muldi3.c +4 -4
@@ -65,10 +65,10 @@ GNU General Public License for more details. */umul_ppmm (__w.s.high, __w.s.low, u, v); \ __w.ll; }) -typedef int SItype __attribute__ ((mode (SI ))); -typedef unsigned int USItype __attribute__ ((mode (SI ))); -typedef int DItype __attribute__ ((mode (DI ))); -typedef int word_type __attribute__ ((mode (__word__))); +typedef int SItype __mode(SI); +typedef unsigned int USItype __mode(SI); +typedef int DItype __mode(DI); +typedef int word_type __mode(__word__);struct DIstruct {SItype high, low;};
Signature · 1 line
2.7.4