* [PATCH 1/6] MN10300: Fix RTC routines
@ 2010-08-12 15:54 David Howells
2010-08-12 15:54 ` [PATCH 2/6] MN10300: Fix size_t and ssize_t David Howells
` (4 more replies)
0 siblings, 5 replies; 6+ messages in thread
From: David Howells @ 2010-08-12 15:54 UTC (permalink / raw)
To: torvalds, akpm; +Cc: linux-am33-list, linux-kernel, David Howells
A change to the RTC routines in the MN10300 arch used set_rtc_mms() when it
meant set_rtc_mmss(). This results in an error due to a reference of an
undefined symbol.
Signed-off-by: David Howells <dhowells@redhat.com>
---
arch/mn10300/kernel/rtc.c | 5 +----
1 files changed, 1 insertions(+), 4 deletions(-)
diff --git a/arch/mn10300/kernel/rtc.c b/arch/mn10300/kernel/rtc.c
index 815a933..4eef0e7 100644
--- a/arch/mn10300/kernel/rtc.c
+++ b/arch/mn10300/kernel/rtc.c
@@ -20,9 +20,6 @@
DEFINE_SPINLOCK(rtc_lock);
EXPORT_SYMBOL(rtc_lock);
-/* last time the RTC got updated */
-static long last_rtc_update;
-
/* time for RTC to update itself in ioclks */
static unsigned long mn10300_rtc_update_period;
@@ -110,7 +107,7 @@ static int set_rtc_mmss(unsigned long nowtime)
int update_persistent_clock(struct timespec now)
{
- return set_rtc_mms(now.tv_sec);
+ return set_rtc_mmss(now.tv_sec);
}
/*
^ permalink raw reply [flat|nested] 6+ messages in thread* [PATCH 2/6] MN10300: Fix size_t and ssize_t 2010-08-12 15:54 [PATCH 1/6] MN10300: Fix RTC routines David Howells @ 2010-08-12 15:54 ` David Howells 2010-08-12 15:54 ` [PATCH 3/6] MN10300: Permit .GCC-command-line sections David Howells ` (3 subsequent siblings) 4 siblings, 0 replies; 6+ messages in thread From: David Howells @ 2010-08-12 15:54 UTC (permalink / raw) To: torvalds, akpm; +Cc: linux-am33-list, linux-kernel, David Howells With the newer compilers, size_t and ssize_t are expected to be (un)signed int rather than (un)signed long. Signed-off-by: David Howells <dhowells@redhat.com> --- arch/mn10300/include/asm/posix_types.h | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-) diff --git a/arch/mn10300/include/asm/posix_types.h b/arch/mn10300/include/asm/posix_types.h index 077567c..56ffbc1 100644 --- a/arch/mn10300/include/asm/posix_types.h +++ b/arch/mn10300/include/asm/posix_types.h @@ -25,8 +25,13 @@ typedef int __kernel_pid_t; typedef unsigned short __kernel_ipc_pid_t; typedef unsigned short __kernel_uid_t; typedef unsigned short __kernel_gid_t; +#if __GNUC__ == 4 +typedef unsigned int __kernel_size_t; +typedef signed int __kernel_ssize_t; +#else typedef unsigned long __kernel_size_t; -typedef long __kernel_ssize_t; +typedef signed long __kernel_ssize_t; +#endif typedef int __kernel_ptrdiff_t; typedef long __kernel_time_t; typedef long __kernel_suseconds_t; ^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 3/6] MN10300: Permit .GCC-command-line sections 2010-08-12 15:54 [PATCH 1/6] MN10300: Fix RTC routines David Howells 2010-08-12 15:54 ` [PATCH 2/6] MN10300: Fix size_t and ssize_t David Howells @ 2010-08-12 15:54 ` David Howells 2010-08-12 15:54 ` [PATCH 4/6] MN10300: Don't try and #include <linux/slab.h> in lib/inflate.c from bootloader David Howells ` (2 subsequent siblings) 4 siblings, 0 replies; 6+ messages in thread From: David Howells @ 2010-08-12 15:54 UTC (permalink / raw) To: torvalds, akpm; +Cc: linux-am33-list, linux-kernel, David Howells Permit .GCC-command-line sections in modules. Otherwise modpost says things like: WARNING: drivers/mtd/chips/map_ram.o (.GCC-command-line): unexpected non-allocatable section. Did you forget to use "ax"/"aw" in a .S file? Note that for example <linux/init.h> contains section definitions for use in .S files. Signed-off-by: David Howells <dhowells@redhat.com> --- scripts/mod/modpost.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c index 7acbdd8..253c107 100644 --- a/scripts/mod/modpost.c +++ b/scripts/mod/modpost.c @@ -790,6 +790,7 @@ static const char *section_white_list[] = { ".comment*", ".debug*", + ".GCC-command-line", /* mn10300 */ ".mdebug*", /* alpha, score, mips etc. */ ".pdr", /* alpha, score, mips etc. */ ".stab*", ^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 4/6] MN10300: Don't try and #include <linux/slab.h> in lib/inflate.c from bootloader 2010-08-12 15:54 [PATCH 1/6] MN10300: Fix RTC routines David Howells 2010-08-12 15:54 ` [PATCH 2/6] MN10300: Fix size_t and ssize_t David Howells 2010-08-12 15:54 ` [PATCH 3/6] MN10300: Permit .GCC-command-line sections David Howells @ 2010-08-12 15:54 ` David Howells 2010-08-12 15:54 ` [PATCH 5/6] Add a dummy printk function for the maintenance of unused printks David Howells 2010-08-12 15:55 ` [PATCH 6/6] MN10300: Use no_printk() for disabled gdbstub debugging functions David Howells 4 siblings, 0 replies; 6+ messages in thread From: David Howells @ 2010-08-12 15:54 UTC (permalink / raw) To: torvalds, akpm; +Cc: linux-am33-list, linux-kernel, David Howells Don't try and #include <linux/slab.h> in lib/inflate.c from the bootloader code as linux/slab.h hauls in function defs that aren't available in the bootloader code and may also haul in conflicting functions. To fix this, make the inclusion of linux/slab.h contingent on NO_INFLATE_MALLOC as are the usages of kmalloc() and kfree(). In MN10300, this causes the following errors: In file included from include/linux/string.h:21, from include/linux/bitmap.h:8, from include/linux/nodemask.h:93, from include/linux/mmzone.h:16, from include/linux/gfp.h:4, from include/linux/slab.h:12, from arch/mn10300/boot/compressed/../../../../lib/inflate.c:106, from arch/mn10300/boot/compressed/misc.c:170: /warthog/am33/linux-2.6-mn10300/arch/mn10300/include/asm/string.h:19: error: conflicting types for 'memset' arch/mn10300/boot/compressed/misc.c:59: error: previous definition of 'memset' was here Signed-off-by: David Howells <dhowells@redhat.com> --- arch/mn10300/boot/compressed/misc.c | 1 + lib/inflate.c | 2 ++ 2 files changed, 3 insertions(+), 0 deletions(-) diff --git a/arch/mn10300/boot/compressed/misc.c b/arch/mn10300/boot/compressed/misc.c index f673383..42cbd77 100644 --- a/arch/mn10300/boot/compressed/misc.c +++ b/arch/mn10300/boot/compressed/misc.c @@ -167,6 +167,7 @@ static uch *high_buffer_start /* = (uch *)(((ulg)&end) + HEAP_SIZE)*/; static char *vidmem = (char *)0xb8000; static int lines, cols; +#define BOOTLOADER_INFLATE #include "../../../../lib/inflate.c" static inline void scroll(void) diff --git a/lib/inflate.c b/lib/inflate.c index 677b738..013a761 100644 --- a/lib/inflate.c +++ b/lib/inflate.c @@ -103,7 +103,9 @@ the two sets of lengths. */ #include <linux/compiler.h> +#ifdef NO_INFLATE_MALLOC #include <linux/slab.h> +#endif #ifdef RCSID static char rcsid[] = "#Id: inflate.c,v 0.14 1993/06/10 13:27:04 jloup Exp #"; ^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 5/6] Add a dummy printk function for the maintenance of unused printks 2010-08-12 15:54 [PATCH 1/6] MN10300: Fix RTC routines David Howells ` (2 preceding siblings ...) 2010-08-12 15:54 ` [PATCH 4/6] MN10300: Don't try and #include <linux/slab.h> in lib/inflate.c from bootloader David Howells @ 2010-08-12 15:54 ` David Howells 2010-08-12 15:55 ` [PATCH 6/6] MN10300: Use no_printk() for disabled gdbstub debugging functions David Howells 4 siblings, 0 replies; 6+ messages in thread From: David Howells @ 2010-08-12 15:54 UTC (permalink / raw) To: torvalds, akpm; +Cc: linux-am33-list, linux-kernel, David Howells Add a dummy printk function for the maintenance of unused printks through gcc format checking, and also so that side-effect checking is maintained too. Signed-off-by: David Howells <dhowells@redhat.com> --- arch/mn10300/kernel/mn10300-serial.c | 5 ----- fs/afs/internal.h | 12 +++--------- fs/cachefiles/internal.h | 13 +++---------- fs/fscache/internal.h | 14 ++++---------- include/linux/kernel.h | 7 +++++++ kernel/cred.c | 4 ---- net/rxrpc/ar-internal.h | 16 +++++----------- security/keys/internal.h | 5 ----- 8 files changed, 22 insertions(+), 54 deletions(-) diff --git a/arch/mn10300/kernel/mn10300-serial.c b/arch/mn10300/kernel/mn10300-serial.c index ef34d5a..9d49073 100644 --- a/arch/mn10300/kernel/mn10300-serial.c +++ b/arch/mn10300/kernel/mn10300-serial.c @@ -44,11 +44,6 @@ static const char serial_revdate[] = "2007-11-06"; #include <unit/timex.h> #include "mn10300-serial.h" -static inline __attribute__((format(printf, 1, 2))) -void no_printk(const char *fmt, ...) -{ -} - #define kenter(FMT, ...) \ printk(KERN_DEBUG "-->%s(" FMT ")\n", __func__, ##__VA_ARGS__) #define _enter(FMT, ...) \ diff --git a/fs/afs/internal.h b/fs/afs/internal.h index 8679089..c6c93f1 100644 --- a/fs/afs/internal.h +++ b/fs/afs/internal.h @@ -752,12 +752,6 @@ extern unsigned afs_debug; #define dbgprintk(FMT,...) \ printk("[%-6.6s] "FMT"\n", current->comm ,##__VA_ARGS__) -/* make sure we maintain the format strings, even when debugging is disabled */ -static inline __attribute__((format(printf,1,2))) -void _dbprintk(const char *fmt, ...) -{ -} - #define kenter(FMT,...) dbgprintk("==> %s("FMT")",__func__ ,##__VA_ARGS__) #define kleave(FMT,...) dbgprintk("<== %s()"FMT"",__func__ ,##__VA_ARGS__) #define kdebug(FMT,...) dbgprintk(" "FMT ,##__VA_ARGS__) @@ -792,9 +786,9 @@ do { \ } while (0) #else -#define _enter(FMT,...) _dbprintk("==> %s("FMT")",__func__ ,##__VA_ARGS__) -#define _leave(FMT,...) _dbprintk("<== %s()"FMT"",__func__ ,##__VA_ARGS__) -#define _debug(FMT,...) _dbprintk(" "FMT ,##__VA_ARGS__) +#define _enter(FMT,...) no_printk("==> %s("FMT")",__func__ ,##__VA_ARGS__) +#define _leave(FMT,...) no_printk("<== %s()"FMT"",__func__ ,##__VA_ARGS__) +#define _debug(FMT,...) no_printk(" "FMT ,##__VA_ARGS__) #endif /* diff --git a/fs/cachefiles/internal.h b/fs/cachefiles/internal.h index a8cd821..bd6bc1b 100644 --- a/fs/cachefiles/internal.h +++ b/fs/cachefiles/internal.h @@ -267,13 +267,6 @@ do { \ #define dbgprintk(FMT, ...) \ printk(KERN_DEBUG "[%-6.6s] "FMT"\n", current->comm, ##__VA_ARGS__) -/* make sure we maintain the format strings, even when debugging is disabled */ -static inline void _dbprintk(const char *fmt, ...) - __attribute__((format(printf, 1, 2))); -static inline void _dbprintk(const char *fmt, ...) -{ -} - #define kenter(FMT, ...) dbgprintk("==> %s("FMT")", __func__, ##__VA_ARGS__) #define kleave(FMT, ...) dbgprintk("<== %s()"FMT"", __func__, ##__VA_ARGS__) #define kdebug(FMT, ...) dbgprintk(FMT, ##__VA_ARGS__) @@ -304,9 +297,9 @@ do { \ } while (0) #else -#define _enter(FMT, ...) _dbprintk("==> %s("FMT")", __func__, ##__VA_ARGS__) -#define _leave(FMT, ...) _dbprintk("<== %s()"FMT"", __func__, ##__VA_ARGS__) -#define _debug(FMT, ...) _dbprintk(FMT, ##__VA_ARGS__) +#define _enter(FMT, ...) no_printk("==> %s("FMT")", __func__, ##__VA_ARGS__) +#define _leave(FMT, ...) no_printk("<== %s()"FMT"", __func__, ##__VA_ARGS__) +#define _debug(FMT, ...) no_printk(FMT, ##__VA_ARGS__) #endif #if 1 /* defined(__KDEBUGALL) */ diff --git a/fs/fscache/internal.h b/fs/fscache/internal.h index 6a02644..f6aad48 100644 --- a/fs/fscache/internal.h +++ b/fs/fscache/internal.h @@ -321,17 +321,11 @@ void fscache_put_context(struct fscache_cookie *cookie, void *context) #define dbgprintk(FMT, ...) \ printk(KERN_DEBUG "[%-6.6s] "FMT"\n", current->comm, ##__VA_ARGS__) -/* make sure we maintain the format strings, even when debugging is disabled */ -static inline __attribute__((format(printf, 1, 2))) -void _dbprintk(const char *fmt, ...) -{ -} - #define kenter(FMT, ...) dbgprintk("==> %s("FMT")", __func__, ##__VA_ARGS__) #define kleave(FMT, ...) dbgprintk("<== %s()"FMT"", __func__, ##__VA_ARGS__) #define kdebug(FMT, ...) dbgprintk(FMT, ##__VA_ARGS__) -#define kjournal(FMT, ...) _dbprintk(FMT, ##__VA_ARGS__) +#define kjournal(FMT, ...) no_printk(FMT, ##__VA_ARGS__) #ifdef __KDEBUG #define _enter(FMT, ...) kenter(FMT, ##__VA_ARGS__) @@ -358,9 +352,9 @@ do { \ } while (0) #else -#define _enter(FMT, ...) _dbprintk("==> %s("FMT")", __func__, ##__VA_ARGS__) -#define _leave(FMT, ...) _dbprintk("<== %s()"FMT"", __func__, ##__VA_ARGS__) -#define _debug(FMT, ...) _dbprintk(FMT, ##__VA_ARGS__) +#define _enter(FMT, ...) no_printk("==> %s("FMT")", __func__, ##__VA_ARGS__) +#define _leave(FMT, ...) no_printk("<== %s()"FMT"", __func__, ##__VA_ARGS__) +#define _debug(FMT, ...) no_printk(FMT, ##__VA_ARGS__) #endif /* diff --git a/include/linux/kernel.h b/include/linux/kernel.h index d848cb8..2b0a35e 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h @@ -306,6 +306,13 @@ static inline void log_buf_kexec_setup(void) } #endif +/* + * Dummy printk for disabled debugging statements to use whilst maintaining + * gcc's format and side-effect checking. + */ +static inline __attribute__ ((format (printf, 1, 2))) +int no_printk(const char *s, ...) { return 0; } + extern int printk_needs_cpu(int cpu); extern void printk_tick(void); diff --git a/kernel/cred.c b/kernel/cred.c index 60bc8b1..9a3e226 100644 --- a/kernel/cred.c +++ b/kernel/cred.c @@ -22,10 +22,6 @@ #define kdebug(FMT, ...) \ printk("[%-5.5s%5u] "FMT"\n", current->comm, current->pid ,##__VA_ARGS__) #else -static inline __attribute__((format(printf, 1, 2))) -void no_printk(const char *fmt, ...) -{ -} #define kdebug(FMT, ...) \ no_printk("[%-5.5s%5u] "FMT"\n", current->comm, current->pid ,##__VA_ARGS__) #endif diff --git a/net/rxrpc/ar-internal.h b/net/rxrpc/ar-internal.h index 7043b29..8e22bd3 100644 --- a/net/rxrpc/ar-internal.h +++ b/net/rxrpc/ar-internal.h @@ -597,12 +597,6 @@ extern unsigned rxrpc_debug; #define dbgprintk(FMT,...) \ printk("[%-6.6s] "FMT"\n", current->comm ,##__VA_ARGS__) -/* make sure we maintain the format strings, even when debugging is disabled */ -static inline __attribute__((format(printf,1,2))) -void _dbprintk(const char *fmt, ...) -{ -} - #define kenter(FMT,...) dbgprintk("==> %s("FMT")",__func__ ,##__VA_ARGS__) #define kleave(FMT,...) dbgprintk("<== %s()"FMT"",__func__ ,##__VA_ARGS__) #define kdebug(FMT,...) dbgprintk(" "FMT ,##__VA_ARGS__) @@ -655,11 +649,11 @@ do { \ } while (0) #else -#define _enter(FMT,...) _dbprintk("==> %s("FMT")",__func__ ,##__VA_ARGS__) -#define _leave(FMT,...) _dbprintk("<== %s()"FMT"",__func__ ,##__VA_ARGS__) -#define _debug(FMT,...) _dbprintk(" "FMT ,##__VA_ARGS__) -#define _proto(FMT,...) _dbprintk("### "FMT ,##__VA_ARGS__) -#define _net(FMT,...) _dbprintk("@@@ "FMT ,##__VA_ARGS__) +#define _enter(FMT,...) no_printk("==> %s("FMT")",__func__ ,##__VA_ARGS__) +#define _leave(FMT,...) no_printk("<== %s()"FMT"",__func__ ,##__VA_ARGS__) +#define _debug(FMT,...) no_printk(" "FMT ,##__VA_ARGS__) +#define _proto(FMT,...) no_printk("### "FMT ,##__VA_ARGS__) +#define _net(FMT,...) no_printk("@@@ "FMT ,##__VA_ARGS__) #endif /* diff --git a/security/keys/internal.h b/security/keys/internal.h index addb67b..56a133d 100644 --- a/security/keys/internal.h +++ b/security/keys/internal.h @@ -15,11 +15,6 @@ #include <linux/sched.h> #include <linux/key-type.h> -static inline __attribute__((format(printf, 1, 2))) -void no_printk(const char *fmt, ...) -{ -} - #ifdef __KDEBUG #define kenter(FMT, ...) \ printk(KERN_DEBUG "==> %s("FMT")\n", __func__, ##__VA_ARGS__) ^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 6/6] MN10300: Use no_printk() for disabled gdbstub debugging functions 2010-08-12 15:54 [PATCH 1/6] MN10300: Fix RTC routines David Howells ` (3 preceding siblings ...) 2010-08-12 15:54 ` [PATCH 5/6] Add a dummy printk function for the maintenance of unused printks David Howells @ 2010-08-12 15:55 ` David Howells 4 siblings, 0 replies; 6+ messages in thread From: David Howells @ 2010-08-12 15:55 UTC (permalink / raw) To: torvalds, akpm; +Cc: linux-am33-list, linux-kernel, David Howells Use no_printk() for disabled gdbstub debugging functions to maintain side effect checking. Signed-off-by: David Howells <dhowells@redhat.com> --- arch/mn10300/include/asm/gdb-stub.h | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/mn10300/include/asm/gdb-stub.h b/arch/mn10300/include/asm/gdb-stub.h index 556cce9..41ed267 100644 --- a/arch/mn10300/include/asm/gdb-stub.h +++ b/arch/mn10300/include/asm/gdb-stub.h @@ -157,25 +157,25 @@ void gdbstub_printk(const char *fmt, ...) #ifdef CONFIG_GDBSTUB_DEBUG_ENTRY #define gdbstub_entry(FMT, ...) gdbstub_printk(FMT, ##__VA_ARGS__) #else -#define gdbstub_entry(FMT, ...) ({ 0; }) +#define gdbstub_entry(FMT, ...) no_printk(FMT, ##__VA_ARGS__) #endif #ifdef CONFIG_GDBSTUB_DEBUG_PROTOCOL #define gdbstub_proto(FMT, ...) gdbstub_printk(FMT, ##__VA_ARGS__) #else -#define gdbstub_proto(FMT, ...) ({ 0; }) +#define gdbstub_proto(FMT, ...) no_printk(FMT, ##__VA_ARGS__) #endif #ifdef CONFIG_GDBSTUB_DEBUG_IO #define gdbstub_io(FMT, ...) gdbstub_printk(FMT, ##__VA_ARGS__) #else -#define gdbstub_io(FMT, ...) ({ 0; }) +#define gdbstub_io(FMT, ...) no_printk(FMT, ##__VA_ARGS__) #endif #ifdef CONFIG_GDBSTUB_DEBUG_BREAKPOINT #define gdbstub_bkpt(FMT, ...) gdbstub_printk(FMT, ##__VA_ARGS__) #else -#define gdbstub_bkpt(FMT, ...) ({ 0; }) +#define gdbstub_bkpt(FMT, ...) no_printk(FMT, ##__VA_ARGS__) #endif #endif /* !__ASSEMBLY__ */ ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2010-08-12 15:55 UTC | newest] Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2010-08-12 15:54 [PATCH 1/6] MN10300: Fix RTC routines David Howells 2010-08-12 15:54 ` [PATCH 2/6] MN10300: Fix size_t and ssize_t David Howells 2010-08-12 15:54 ` [PATCH 3/6] MN10300: Permit .GCC-command-line sections David Howells 2010-08-12 15:54 ` [PATCH 4/6] MN10300: Don't try and #include <linux/slab.h> in lib/inflate.c from bootloader David Howells 2010-08-12 15:54 ` [PATCH 5/6] Add a dummy printk function for the maintenance of unused printks David Howells 2010-08-12 15:55 ` [PATCH 6/6] MN10300: Use no_printk() for disabled gdbstub debugging functions David Howells
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®