* [PATCH 01/15] frv: __user infrastructure
@ 2006-06-19 12:24 David Howells
2006-06-19 12:24 ` [PATCH 02/15] frv: basic __iomem annotations David Howells
` (13 more replies)
0 siblings, 14 replies; 16+ messages in thread
From: David Howells @ 2006-06-19 12:24 UTC (permalink / raw)
To: torvalds, akpm, viro; +Cc: linux-kernel
From: Al Viro <viro@zeniv.linux.org.uk>
Add general annotations to the FRV arch for sparse.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-Off-By: David Howells <dhowells@redhat.com>
---
arch/frv/kernel/uaccess.c | 6 ++--
include/asm-frv/uaccess.h | 64 ++++++++++++++++++++++++++-------------------
2 files changed, 40 insertions(+), 30 deletions(-)
diff --git a/arch/frv/kernel/uaccess.c b/arch/frv/kernel/uaccess.c
index 9b751c0..9fb771a 100644
--- a/arch/frv/kernel/uaccess.c
+++ b/arch/frv/kernel/uaccess.c
@@ -17,7 +17,7 @@ #include <asm/uaccess.h>
/*
* copy a null terminated string from userspace
*/
-long strncpy_from_user(char *dst, const char *src, long count)
+long strncpy_from_user(char *dst, const char __user *src, long count)
{
unsigned long max;
char *p, ch;
@@ -70,9 +70,9 @@ EXPORT_SYMBOL(strncpy_from_user);
*
* Return 0 on exception, a value greater than N if too long
*/
-long strnlen_user(const char *src, long count)
+long strnlen_user(const char __user *src, long count)
{
- const char *p;
+ const char __user *p;
long err = 0;
char ch;
diff --git a/include/asm-frv/uaccess.h b/include/asm-frv/uaccess.h
index a1d1404..3d90e10 100644
--- a/include/asm-frv/uaccess.h
+++ b/include/asm-frv/uaccess.h
@@ -22,7 +22,7 @@ #include <asm/sections.h>
#define HAVE_ARCH_UNMAPPED_AREA /* we decide where to put mmaps */
-#define __ptr(x) ((unsigned long *)(x))
+#define __ptr(x) ((unsigned long __force *)(x))
#define VERIFY_READ 0
#define VERIFY_WRITE 1
@@ -64,7 +64,7 @@ #endif
#define __range_ok(addr,size) ___range_ok((unsigned long) (addr), (unsigned long) (size))
-#define access_ok(type,addr,size) (__range_ok((addr), (size)) == 0)
+#define access_ok(type,addr,size) (__range_ok((void __user *)(addr), (size)) == 0)
#define __access_ok(addr,size) (__range_ok((addr), (size)) == 0)
/*
@@ -97,6 +97,7 @@ ({ \
int __pu_err = 0; \
\
typeof(*(ptr)) __pu_val = (x); \
+ __chk_user_ptr(ptr); \
\
switch (sizeof (*(ptr))) { \
case 1: \
@@ -120,7 +121,7 @@ ({ \
#define put_user(x, ptr) \
({ \
- typeof(&*ptr) _p = (ptr); \
+ typeof(*(ptr)) __user *_p = (ptr); \
int _e; \
\
_e = __range_ok(_p, sizeof(*_p)); \
@@ -175,33 +176,44 @@ #endif
*/
#define __get_user(x, ptr) \
({ \
- typeof(*(ptr)) __gu_val = 0; \
int __gu_err = 0; \
+ __chk_user_ptr(ptr); \
\
switch (sizeof(*(ptr))) { \
- case 1: \
- __get_user_asm(__gu_err, *(u8*)&__gu_val, ptr, "ub", "=r"); \
+ case 1: { \
+ unsigned char __gu_val; \
+ __get_user_asm(__gu_err, __gu_val, ptr, "ub", "=r"); \
+ (x) = *(__force __typeof__(*(ptr)) *) &__gu_val; \
break; \
- case 2: \
- __get_user_asm(__gu_err, *(u16*)&__gu_val, ptr, "uh", "=r"); \
+ } \
+ case 2: { \
+ unsigned short __gu_val; \
+ __get_user_asm(__gu_err, __gu_val, ptr, "uh", "=r"); \
+ (x) = *(__force __typeof__(*(ptr)) *) &__gu_val; \
break; \
- case 4: \
- __get_user_asm(__gu_err, *(u32*)&__gu_val, ptr, "", "=r"); \
+ } \
+ case 4: { \
+ unsigned int __gu_val; \
+ __get_user_asm(__gu_err, __gu_val, ptr, "", "=r"); \
+ (x) = *(__force __typeof__(*(ptr)) *) &__gu_val; \
break; \
- case 8: \
- __get_user_asm(__gu_err, *(u64*)&__gu_val, ptr, "d", "=e"); \
+ } \
+ case 8: { \
+ unsigned long long __gu_val; \
+ __get_user_asm(__gu_err, __gu_val, ptr, "d", "=e"); \
+ (x) = *(__force __typeof__(*(ptr)) *) &__gu_val; \
break; \
+ } \
default: \
__gu_err = __get_user_bad(); \
break; \
} \
- (x) = __gu_val; \
__gu_err; \
})
#define get_user(x, ptr) \
({ \
- typeof(&*ptr) _p = (ptr); \
+ const typeof(*(ptr)) __user *_p = (ptr);\
int _e; \
\
_e = __range_ok(_p, sizeof(*_p)); \
@@ -248,19 +260,20 @@ #endif
/*
*
*/
+#define ____force(x) (__force void *)(void __user *)(x)
#ifdef CONFIG_MMU
extern long __memset_user(void *dst, unsigned long count);
extern long __memcpy_user(void *dst, const void *src, unsigned long count);
-#define clear_user(dst,count) __memset_user((dst), (count))
-#define __copy_from_user_inatomic(to, from, n) __memcpy_user((to), (from), (n))
-#define __copy_to_user_inatomic(to, from, n) __memcpy_user((to), (from), (n))
+#define clear_user(dst,count) __memset_user(____force(dst), (count))
+#define __copy_from_user_inatomic(to, from, n) __memcpy_user((to), ____force(from), (n))
+#define __copy_to_user_inatomic(to, from, n) __memcpy_user(____force(to), (from), (n))
#else
-#define clear_user(dst,count) (memset((dst), 0, (count)), 0)
-#define __copy_from_user_inatomic(to, from, n) (memcpy((to), (from), (n)), 0)
-#define __copy_to_user_inatomic(to, from, n) (memcpy((to), (from), (n)), 0)
+#define clear_user(dst,count) (memset(____force(dst), 0, (count)), 0)
+#define __copy_from_user_inatomic(to, from, n) (memcpy((to), ____force(from), (n)), 0)
+#define __copy_to_user_inatomic(to, from, n) (memcpy(____force(to), (from), (n)), 0)
#endif
@@ -278,7 +291,7 @@ __copy_from_user(void *to, const void __
return __copy_from_user_inatomic(to, from, n);
}
-static inline long copy_from_user(void *to, const void *from, unsigned long n)
+static inline long copy_from_user(void *to, const void __user *from, unsigned long n)
{
unsigned long ret = n;
@@ -291,16 +304,13 @@ static inline long copy_from_user(void *
return ret;
}
-static inline long copy_to_user(void *to, const void *from, unsigned long n)
+static inline long copy_to_user(void __user *to, const void *from, unsigned long n)
{
return likely(__access_ok(to, n)) ? __copy_to_user(to, from, n) : n;
}
-#define copy_to_user_ret(to,from,n,retval) ({ if (copy_to_user(to,from,n)) return retval; })
-#define copy_from_user_ret(to,from,n,retval) ({ if (copy_from_user(to,from,n)) return retval; })
-
-extern long strncpy_from_user(char *dst, const char *src, long count);
-extern long strnlen_user(const char *src, long count);
+extern long strncpy_from_user(char *dst, const char __user *src, long count);
+extern long strnlen_user(const char __user *src, long count);
#define strlen_user(str) strnlen_user(str, 32767)
^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH 02/15] frv: basic __iomem annotations
2006-06-19 12:24 [PATCH 01/15] frv: __user infrastructure David Howells
@ 2006-06-19 12:24 ` David Howells
2006-06-19 12:24 ` [PATCH 03/15] frv: signal annotations David Howells
` (12 subsequent siblings)
13 siblings, 0 replies; 16+ messages in thread
From: David Howells @ 2006-06-19 12:24 UTC (permalink / raw)
To: torvalds, akpm, viro; +Cc: linux-kernel
From: Al Viro <viro@zeniv.linux.org.uk>
Add annotations to the FRV I/O handling functions for sparse.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-Off-By: David Howells <dhowells@redhat.com>
---
arch/frv/mm/kmap.c | 6 +++---
include/asm-frv/io.h | 38 +++++++++++++++++++-------------------
include/asm-frv/mb-regs.h | 27 +++++++++++++++++++--------
3 files changed, 41 insertions(+), 30 deletions(-)
diff --git a/arch/frv/mm/kmap.c b/arch/frv/mm/kmap.c
index c54f18e..40b62c5 100644
--- a/arch/frv/mm/kmap.c
+++ b/arch/frv/mm/kmap.c
@@ -31,15 +31,15 @@ #undef DEBUG
* Map some physical address range into the kernel address space.
*/
-void *__ioremap(unsigned long physaddr, unsigned long size, int cacheflag)
+void __iomem *__ioremap(unsigned long physaddr, unsigned long size, int cacheflag)
{
- return (void *)physaddr;
+ return (void __iomem *)physaddr;
}
/*
* Unmap a ioremap()ed region again
*/
-void iounmap(void *addr)
+void iounmap(void volatile __iomem *addr)
{
}
diff --git a/include/asm-frv/io.h b/include/asm-frv/io.h
index 01247cb..0c18453 100644
--- a/include/asm-frv/io.h
+++ b/include/asm-frv/io.h
@@ -41,13 +41,13 @@ static inline unsigned long _swapl(unsig
//#define __iormb() asm volatile("membar")
//#define __iowmb() asm volatile("membar")
-#define __raw_readb(addr) __builtin_read8((void *) (addr))
-#define __raw_readw(addr) __builtin_read16((void *) (addr))
-#define __raw_readl(addr) __builtin_read32((void *) (addr))
+#define __raw_readb __builtin_read8
+#define __raw_readw __builtin_read16
+#define __raw_readl __builtin_read32
-#define __raw_writeb(datum, addr) __builtin_write8((void *) (addr), datum)
-#define __raw_writew(datum, addr) __builtin_write16((void *) (addr), datum)
-#define __raw_writel(datum, addr) __builtin_write32((void *) (addr), datum)
+#define __raw_writeb(datum, addr) __builtin_write8(addr, datum)
+#define __raw_writew(datum, addr) __builtin_write16(addr, datum)
+#define __raw_writel(datum, addr) __builtin_write32(addr, datum)
static inline void io_outsb(unsigned int addr, const void *buf, int len)
{
@@ -129,12 +129,12 @@ static inline void memcpy_toio(volatile
static inline uint8_t inb(unsigned long addr)
{
- return __builtin_read8((void *)addr);
+ return __builtin_read8((void __iomem *)addr);
}
static inline uint16_t inw(unsigned long addr)
{
- uint16_t ret = __builtin_read16((void *)addr);
+ uint16_t ret = __builtin_read16((void __iomem *)addr);
if (__is_PCI_IO(addr))
ret = _swapw(ret);
@@ -144,7 +144,7 @@ static inline uint16_t inw(unsigned long
static inline uint32_t inl(unsigned long addr)
{
- uint32_t ret = __builtin_read32((void *)addr);
+ uint32_t ret = __builtin_read32((void __iomem *)addr);
if (__is_PCI_IO(addr))
ret = _swapl(ret);
@@ -154,21 +154,21 @@ static inline uint32_t inl(unsigned long
static inline void outb(uint8_t datum, unsigned long addr)
{
- __builtin_write8((void *)addr, datum);
+ __builtin_write8((void __iomem *)addr, datum);
}
static inline void outw(uint16_t datum, unsigned long addr)
{
if (__is_PCI_IO(addr))
datum = _swapw(datum);
- __builtin_write16((void *)addr, datum);
+ __builtin_write16((void __iomem *)addr, datum);
}
static inline void outl(uint32_t datum, unsigned long addr)
{
if (__is_PCI_IO(addr))
datum = _swapl(datum);
- __builtin_write32((void *)addr, datum);
+ __builtin_write32((void __iomem *)addr, datum);
}
#define inb_p(addr) inb(addr)
@@ -190,12 +190,12 @@ #define IO_SPACE_LIMIT 0xffffffff
static inline uint8_t readb(const volatile void __iomem *addr)
{
- return __builtin_read8((volatile uint8_t __force *) addr);
+ return __builtin_read8((__force void volatile __iomem *) addr);
}
static inline uint16_t readw(const volatile void __iomem *addr)
{
- uint16_t ret = __builtin_read16((volatile uint16_t __force *)addr);
+ uint16_t ret = __builtin_read16((__force void volatile __iomem *)addr);
if (__is_PCI_MEM(addr))
ret = _swapw(ret);
@@ -204,7 +204,7 @@ static inline uint16_t readw(const volat
static inline uint32_t readl(const volatile void __iomem *addr)
{
- uint32_t ret = __builtin_read32((volatile uint32_t __force *)addr);
+ uint32_t ret = __builtin_read32((__force void volatile __iomem *)addr);
if (__is_PCI_MEM(addr))
ret = _swapl(ret);
@@ -218,7 +218,7 @@ #define readl_relaxed readl
static inline void writeb(uint8_t datum, volatile void __iomem *addr)
{
- __builtin_write8((volatile uint8_t __force *) addr, datum);
+ __builtin_write8(addr, datum);
if (__is_PCI_MEM(addr))
__flush_PCI_writes();
}
@@ -228,7 +228,7 @@ static inline void writew(uint16_t datum
if (__is_PCI_MEM(addr))
datum = _swapw(datum);
- __builtin_write16((volatile uint16_t __force *) addr, datum);
+ __builtin_write16(addr, datum);
if (__is_PCI_MEM(addr))
__flush_PCI_writes();
}
@@ -238,7 +238,7 @@ static inline void writel(uint32_t datum
if (__is_PCI_MEM(addr))
datum = _swapl(datum);
- __builtin_write32((volatile uint32_t __force *) addr, datum);
+ __builtin_write32(addr, datum);
if (__is_PCI_MEM(addr))
__flush_PCI_writes();
}
@@ -272,7 +272,7 @@ static inline void __iomem *ioremap_full
return __ioremap(physaddr, size, IOMAP_FULL_CACHING);
}
-extern void iounmap(void __iomem *addr);
+extern void iounmap(void volatile __iomem *addr);
static inline void __iomem *ioport_map(unsigned long port, unsigned int nr)
{
diff --git a/include/asm-frv/mb-regs.h b/include/asm-frv/mb-regs.h
index 93fa732..219e5f9 100644
--- a/include/asm-frv/mb-regs.h
+++ b/include/asm-frv/mb-regs.h
@@ -16,6 +16,17 @@ #include <asm/cpu-irqs.h>
#include <asm/sections.h>
#include <asm/mem-layout.h>
+#ifndef __ASSEMBLY__
+/* gcc builtins, annotated */
+
+unsigned long __builtin_read8(volatile void __iomem *);
+unsigned long __builtin_read16(volatile void __iomem *);
+unsigned long __builtin_read32(volatile void __iomem *);
+void __builtin_write8(volatile void __iomem *, unsigned char);
+void __builtin_write16(volatile void __iomem *, unsigned short);
+void __builtin_write32(volatile void __iomem *, unsigned long);
+#endif
+
#define __region_IO KERNEL_IO_START /* the region from 0xe0000000 to 0xffffffff has suitable
* protection laid over the top for use in memory-mapped
* I/O
@@ -59,7 +70,7 @@ #define __region_PCI_IO (__region_CS2 +
#define __region_PCI_MEM (__region_CS2 + 0x08000000UL)
#define __flush_PCI_writes() \
do { \
- __builtin_write8((volatile void *) __region_PCI_MEM, 0); \
+ __builtin_write8((volatile void __iomem *) __region_PCI_MEM, 0); \
} while(0)
#define __is_PCI_IO(addr) \
@@ -83,15 +94,15 @@ #ifdef CONFIG_MB93090_MB00
#define __set_LEDS(X) \
do { \
if (mb93090_mb00_detected) \
- __builtin_write32((void *) __addr_LEDS(), ~(X)); \
+ __builtin_write32((void __iomem *) __addr_LEDS(), ~(X)); \
} while (0)
#else
#define __set_LEDS(X)
#endif
#define __addr_LCD() (__region_CS2 + 0x01200008UL)
-#define __get_LCD(B) __builtin_read32((volatile void *) (B))
-#define __set_LCD(B,X) __builtin_write32((volatile void *) (B), (X))
+#define __get_LCD(B) __builtin_read32((volatile void __iomem *) (B))
+#define __set_LCD(B,X) __builtin_write32((volatile void __iomem *) (B), (X))
#define LCD_D 0x000000ff /* LCD data bus */
#define LCD_RW 0x00000100 /* LCD R/W signal */
@@ -161,11 +172,11 @@ #define __get_CLKSW() 0UL
#define __get_CLKIN() 66000000UL
#define __addr_LEDS() (__region_CS2 + 0x00000023UL)
-#define __set_LEDS(X) __builtin_write8((volatile void *) __addr_LEDS(), (X))
+#define __set_LEDS(X) __builtin_write8((volatile void __iomem *) __addr_LEDS(), (X))
#define __addr_FPGATR() (__region_CS2 + 0x00000030UL)
-#define __set_FPGATR(X) __builtin_write32((volatile void *) __addr_FPGATR(), (X))
-#define __get_FPGATR() __builtin_read32((volatile void *) __addr_FPGATR())
+#define __set_FPGATR(X) __builtin_write32((volatile void __iomem *) __addr_FPGATR(), (X))
+#define __get_FPGATR() __builtin_read32((volatile void __iomem *) __addr_FPGATR())
#define MB93093_FPGA_FPGATR_AUDIO_CLK 0x00000003
@@ -180,7 +191,7 @@ #define MB93093_FPGA_FPGATR_AUDIO_CLK_02
#define MB93093_FPGA_SWR_PUSHSWMASK (0x1F<<26)
#define MB93093_FPGA_SWR_PUSHSW4 (1<<29)
-#define __addr_FPGA_SWR ((volatile void *)(__region_CS2 + 0x28UL))
+#define __addr_FPGA_SWR ((volatile void __iomem *)(__region_CS2 + 0x28UL))
#define __get_FPGA_PUSHSW1_5() (__builtin_read32(__addr_FPGA_SWR) & MB93093_FPGA_SWR_PUSHSWMASK)
^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH 03/15] frv: signal annotations
2006-06-19 12:24 [PATCH 01/15] frv: __user infrastructure David Howells
2006-06-19 12:24 ` [PATCH 02/15] frv: basic __iomem annotations David Howells
@ 2006-06-19 12:24 ` David Howells
2006-06-19 12:24 ` [PATCH 04/15] frv: sysctl __user annotations David Howells
` (11 subsequent siblings)
13 siblings, 0 replies; 16+ messages in thread
From: David Howells @ 2006-06-19 12:24 UTC (permalink / raw)
To: torvalds, akpm, viro; +Cc: linux-kernel
From: Al Viro <viro@zeniv.linux.org.uk>
Add annotations to the FRV signal handling for sparse.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-Off-By: David Howells <dhowells@redhat.com>
---
arch/frv/kernel/signal.c | 20 ++++++++++----------
include/asm-frv/signal.h | 6 +++---
2 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/arch/frv/kernel/signal.c b/arch/frv/kernel/signal.c
index 679c1d5..dd5e6fd 100644
--- a/arch/frv/kernel/signal.c
+++ b/arch/frv/kernel/signal.c
@@ -98,7 +98,7 @@ int sys_sigaltstack(const stack_t __user
struct sigframe
{
- void (*pretcode)(void);
+ __sigrestore_t pretcode;
int sig;
struct sigcontext sc;
unsigned long extramask[_NSIG_WORDS-1];
@@ -107,10 +107,10 @@ struct sigframe
struct rt_sigframe
{
- void (*pretcode)(void);
+ __sigrestore_t pretcode;
int sig;
- struct siginfo *pinfo;
- void *puc;
+ struct siginfo __user *pinfo;
+ void __user *puc;
struct siginfo info;
struct ucontext uc;
uint32_t retcode[2];
@@ -284,7 +284,7 @@ static int setup_frame(int sig, struct k
* setlos #__NR_sigreturn,gr7
* tira gr0,0
*/
- if (__put_user((void (*)(void))frame->retcode, &frame->pretcode) ||
+ if (__put_user((__sigrestore_t)frame->retcode, &frame->pretcode) ||
__put_user(0x8efc0000|__NR_sigreturn, &frame->retcode[0]) ||
__put_user(0xc0700000, &frame->retcode[1]))
goto give_sigsegv;
@@ -300,7 +300,7 @@ static int setup_frame(int sig, struct k
if (get_personality & FDPIC_FUNCPTRS) {
struct fdpic_func_descriptor __user *funcptr =
- (struct fdpic_func_descriptor *) ka->sa.sa_handler;
+ (struct fdpic_func_descriptor __user *) ka->sa.sa_handler;
__get_user(__frame->pc, &funcptr->text);
__get_user(__frame->gr15, &funcptr->GOT);
} else {
@@ -359,8 +359,8 @@ static int setup_rt_frame(int sig, struc
/* Create the ucontext. */
if (__put_user(0, &frame->uc.uc_flags) ||
- __put_user(0, &frame->uc.uc_link) ||
- __put_user((void*)current->sas_ss_sp, &frame->uc.uc_stack.ss_sp) ||
+ __put_user(NULL, &frame->uc.uc_link) ||
+ __put_user((void __user *)current->sas_ss_sp, &frame->uc.uc_stack.ss_sp) ||
__put_user(sas_ss_flags(__frame->sp), &frame->uc.uc_stack.ss_flags) ||
__put_user(current->sas_ss_size, &frame->uc.uc_stack.ss_size))
goto give_sigsegv;
@@ -382,7 +382,7 @@ static int setup_rt_frame(int sig, struc
* setlos #__NR_sigreturn,gr7
* tira gr0,0
*/
- if (__put_user((void (*)(void))frame->retcode, &frame->pretcode) ||
+ if (__put_user((__sigrestore_t)frame->retcode, &frame->pretcode) ||
__put_user(0x8efc0000|__NR_rt_sigreturn, &frame->retcode[0]) ||
__put_user(0xc0700000, &frame->retcode[1]))
goto give_sigsegv;
@@ -398,7 +398,7 @@ static int setup_rt_frame(int sig, struc
__frame->gr9 = (unsigned long) &frame->info;
if (get_personality & FDPIC_FUNCPTRS) {
- struct fdpic_func_descriptor *funcptr =
+ struct fdpic_func_descriptor __user *funcptr =
(struct fdpic_func_descriptor __user *) ka->sa.sa_handler;
__get_user(__frame->pc, &funcptr->text);
__get_user(__frame->gr15, &funcptr->GOT);
diff --git a/include/asm-frv/signal.h b/include/asm-frv/signal.h
index 6736689..dcc1b35 100644
--- a/include/asm-frv/signal.h
+++ b/include/asm-frv/signal.h
@@ -114,13 +114,13 @@ struct old_sigaction {
__sighandler_t sa_handler;
old_sigset_t sa_mask;
unsigned long sa_flags;
- void (*sa_restorer)(void);
+ __sigrestore_t sa_restorer;
};
struct sigaction {
__sighandler_t sa_handler;
unsigned long sa_flags;
- void (*sa_restorer)(void);
+ __sigrestore_t sa_restorer;
sigset_t sa_mask; /* mask last for extensibility */
};
@@ -146,7 +146,7 @@ #define sa_sigaction _u._sa_sigaction
#endif /* __KERNEL__ */
typedef struct sigaltstack {
- void *ss_sp;
+ void __user *ss_sp;
int ss_flags;
size_t ss_size;
} stack_t;
^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH 04/15] frv: sysctl __user annotations
2006-06-19 12:24 [PATCH 01/15] frv: __user infrastructure David Howells
2006-06-19 12:24 ` [PATCH 02/15] frv: basic __iomem annotations David Howells
2006-06-19 12:24 ` [PATCH 03/15] frv: signal annotations David Howells
@ 2006-06-19 12:24 ` David Howells
2006-06-19 12:24 ` [PATCH 05/15] frv: binfmt_elf_fdpic " David Howells
` (10 subsequent siblings)
13 siblings, 0 replies; 16+ messages in thread
From: David Howells @ 2006-06-19 12:24 UTC (permalink / raw)
To: torvalds, akpm, viro; +Cc: linux-kernel
From: Al Viro <viro@zeniv.linux.org.uk>
Add __user annotations to FRV-specific sysctl stuff.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-Off-By: David Howells <dhowells@redhat.com>
---
arch/frv/kernel/pm.c | 40 ++++++++++++++++++++--------------------
arch/frv/kernel/sysctl.c | 4 ++--
2 files changed, 22 insertions(+), 22 deletions(-)
diff --git a/arch/frv/kernel/pm.c b/arch/frv/kernel/pm.c
index f0b8fff..43ce28a 100644
--- a/arch/frv/kernel/pm.c
+++ b/arch/frv/kernel/pm.c
@@ -137,7 +137,7 @@ #define CTL_PM_CMODE 2
#define CTL_PM_P0 4
#define CTL_PM_CM 5
-static int user_atoi(char *ubuf, size_t len)
+static int user_atoi(char __user *ubuf, size_t len)
{
char buf[16];
unsigned long ret;
@@ -159,7 +159,7 @@ static int user_atoi(char *ubuf, size_t
* Send us to sleep.
*/
static int sysctl_pm_do_suspend(ctl_table *ctl, int write, struct file *filp,
- void *buffer, size_t *lenp, loff_t *fpos)
+ void __user *buffer, size_t *lenp, loff_t *fpos)
{
int retval, mode;
@@ -215,7 +215,7 @@ #endif
static int cmode_procctl(ctl_table *ctl, int write, struct file *filp,
- void *buffer, size_t *lenp, loff_t *fpos)
+ void __user *buffer, size_t *lenp, loff_t *fpos)
{
int new_cmode;
@@ -227,9 +227,9 @@ static int cmode_procctl(ctl_table *ctl,
return try_set_cmode(new_cmode)?:*lenp;
}
-static int cmode_sysctl(ctl_table *table, int *name, int nlen,
- void *oldval, size_t *oldlenp,
- void *newval, size_t newlen, void **context)
+static int cmode_sysctl(ctl_table *table, int __user *name, int nlen,
+ void __user *oldval, size_t __user *oldlenp,
+ void __user *newval, size_t newlen, void **context)
{
if (oldval && oldlenp) {
size_t oldlen;
@@ -240,7 +240,7 @@ static int cmode_sysctl(ctl_table *table
if (oldlen != sizeof(int))
return -EINVAL;
- if (put_user(clock_cmode_current, (unsigned int *)oldval) ||
+ if (put_user(clock_cmode_current, (unsigned __user *)oldval) ||
put_user(sizeof(int), oldlenp))
return -EFAULT;
}
@@ -250,7 +250,7 @@ static int cmode_sysctl(ctl_table *table
if (newlen != sizeof(int))
return -EINVAL;
- if (get_user(new_cmode, (int *)newval))
+ if (get_user(new_cmode, (int __user *)newval))
return -EFAULT;
return try_set_cmode(new_cmode)?:1;
@@ -318,7 +318,7 @@ #endif
}
static int p0_procctl(ctl_table *ctl, int write, struct file *filp,
- void *buffer, size_t *lenp, loff_t *fpos)
+ void __user *buffer, size_t *lenp, loff_t *fpos)
{
int new_p0;
@@ -330,9 +330,9 @@ static int p0_procctl(ctl_table *ctl, in
return try_set_p0(new_p0)?:*lenp;
}
-static int p0_sysctl(ctl_table *table, int *name, int nlen,
- void *oldval, size_t *oldlenp,
- void *newval, size_t newlen, void **context)
+static int p0_sysctl(ctl_table *table, int __user *name, int nlen,
+ void __user *oldval, size_t __user *oldlenp,
+ void __user *newval, size_t newlen, void **context)
{
if (oldval && oldlenp) {
size_t oldlen;
@@ -343,7 +343,7 @@ static int p0_sysctl(ctl_table *table, i
if (oldlen != sizeof(int))
return -EINVAL;
- if (put_user(clock_p0_current, (unsigned int *)oldval) ||
+ if (put_user(clock_p0_current, (unsigned __user *)oldval) ||
put_user(sizeof(int), oldlenp))
return -EFAULT;
}
@@ -353,7 +353,7 @@ static int p0_sysctl(ctl_table *table, i
if (newlen != sizeof(int))
return -EINVAL;
- if (get_user(new_p0, (int *)newval))
+ if (get_user(new_p0, (int __user *)newval))
return -EFAULT;
return try_set_p0(new_p0)?:1;
@@ -362,7 +362,7 @@ static int p0_sysctl(ctl_table *table, i
}
static int cm_procctl(ctl_table *ctl, int write, struct file *filp,
- void *buffer, size_t *lenp, loff_t *fpos)
+ void __user *buffer, size_t *lenp, loff_t *fpos)
{
int new_cm;
@@ -374,9 +374,9 @@ static int cm_procctl(ctl_table *ctl, in
return try_set_cm(new_cm)?:*lenp;
}
-static int cm_sysctl(ctl_table *table, int *name, int nlen,
- void *oldval, size_t *oldlenp,
- void *newval, size_t newlen, void **context)
+static int cm_sysctl(ctl_table *table, int __user *name, int nlen,
+ void __user *oldval, size_t __user *oldlenp,
+ void __user *newval, size_t newlen, void **context)
{
if (oldval && oldlenp) {
size_t oldlen;
@@ -387,7 +387,7 @@ static int cm_sysctl(ctl_table *table, i
if (oldlen != sizeof(int))
return -EINVAL;
- if (put_user(clock_cm_current, (unsigned int *)oldval) ||
+ if (put_user(clock_cm_current, (unsigned __user *)oldval) ||
put_user(sizeof(int), oldlenp))
return -EFAULT;
}
@@ -397,7 +397,7 @@ static int cm_sysctl(ctl_table *table, i
if (newlen != sizeof(int))
return -EINVAL;
- if (get_user(new_cm, (int *)newval))
+ if (get_user(new_cm, (int __user *)newval))
return -EFAULT;
return try_set_cm(new_cm)?:1;
diff --git a/arch/frv/kernel/sysctl.c b/arch/frv/kernel/sysctl.c
index 408b0f3..b908863 100644
--- a/arch/frv/kernel/sysctl.c
+++ b/arch/frv/kernel/sysctl.c
@@ -49,7 +49,7 @@ static void frv_change_dcache_mode(unsig
* handle requests to dynamically switch the write caching mode delivered by /proc
*/
static int procctl_frv_cachemode(ctl_table *table, int write, struct file *filp,
- void *buffer, size_t *lenp, loff_t *ppos)
+ void __user *buffer, size_t *lenp, loff_t *ppos)
{
unsigned long hsr0;
char buff[8];
@@ -123,7 +123,7 @@ static int procctl_frv_cachemode(ctl_tab
*/
#ifdef CONFIG_MMU
static int procctl_frv_pin_cxnr(ctl_table *table, int write, struct file *filp,
- void *buffer, size_t *lenp, loff_t *ppos)
+ void __user *buffer, size_t *lenp, loff_t *ppos)
{
pid_t pid;
char buff[16], *p;
^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH 05/15] frv: binfmt_elf_fdpic __user annotations
2006-06-19 12:24 [PATCH 01/15] frv: __user infrastructure David Howells
` (2 preceding siblings ...)
2006-06-19 12:24 ` [PATCH 04/15] frv: sysctl __user annotations David Howells
@ 2006-06-19 12:24 ` David Howells
2006-06-19 12:24 ` [PATCH 06/15] frv: misc " David Howells
` (9 subsequent siblings)
13 siblings, 0 replies; 16+ messages in thread
From: David Howells @ 2006-06-19 12:24 UTC (permalink / raw)
To: torvalds, akpm, viro; +Cc: linux-kernel
From: Al Viro <viro@zeniv.linux.org.uk>
Add __user annotations to binfmt_elf_fdpic.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-Off-By: David Howells <dhowells@redhat.com>
---
fs/binfmt_elf_fdpic.c | 26 +++++++++++++-------------
1 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/fs/binfmt_elf_fdpic.c b/fs/binfmt_elf_fdpic.c
index a2e48c9..eba4e23 100644
--- a/fs/binfmt_elf_fdpic.c
+++ b/fs/binfmt_elf_fdpic.c
@@ -435,9 +435,10 @@ static int create_elf_fdpic_tables(struc
struct elf_fdpic_params *interp_params)
{
unsigned long sp, csp, nitems;
- elf_caddr_t *argv, *envp;
+ elf_caddr_t __user *argv, *envp;
size_t platform_len = 0, len;
- char *k_platform, *u_platform, *p;
+ char *k_platform;
+ char __user *u_platform, *p;
long hwcap;
int loop;
@@ -462,12 +463,11 @@ #endif
if (k_platform) {
platform_len = strlen(k_platform) + 1;
sp -= platform_len;
+ u_platform = (char __user *) sp;
if (__copy_to_user(u_platform, k_platform, platform_len) != 0)
return -EFAULT;
}
- u_platform = (char *) sp;
-
#if defined(__i386__) && defined(CONFIG_SMP)
/* in some cases (e.g. Hyper-Threading), we want to avoid L1 evictions
* by the processes running on the same package. One thing we can do
@@ -490,7 +490,7 @@ #endif
sp = (sp - len) & ~7UL;
exec_params->map_addr = sp;
- if (copy_to_user((void *) sp, exec_params->loadmap, len) != 0)
+ if (copy_to_user((void __user *) sp, exec_params->loadmap, len) != 0)
return -EFAULT;
current->mm->context.exec_fdpic_loadmap = (unsigned long) sp;
@@ -501,7 +501,7 @@ #endif
sp = (sp - len) & ~7UL;
interp_params->map_addr = sp;
- if (copy_to_user((void *) sp, interp_params->loadmap, len) != 0)
+ if (copy_to_user((void __user *) sp, interp_params->loadmap, len) != 0)
return -EFAULT;
current->mm->context.interp_fdpic_loadmap = (unsigned long) sp;
@@ -527,7 +527,7 @@ #endif
/* put the ELF interpreter info on the stack */
#define NEW_AUX_ENT(nr, id, val) \
do { \
- struct { unsigned long _id, _val; } *ent = (void *) csp; \
+ struct { unsigned long _id, _val; } __user *ent = (void __user *) csp; \
__put_user((id), &ent[nr]._id); \
__put_user((val), &ent[nr]._val); \
} while (0)
@@ -564,13 +564,13 @@ #undef NEW_AUX_ENT
/* allocate room for argv[] and envv[] */
csp -= (bprm->envc + 1) * sizeof(elf_caddr_t);
- envp = (elf_caddr_t *) csp;
+ envp = (elf_caddr_t __user *) csp;
csp -= (bprm->argc + 1) * sizeof(elf_caddr_t);
- argv = (elf_caddr_t *) csp;
+ argv = (elf_caddr_t __user *) csp;
/* stack argc */
csp -= sizeof(unsigned long);
- __put_user(bprm->argc, (unsigned long *) csp);
+ __put_user(bprm->argc, (unsigned long __user *) csp);
BUG_ON(csp != sp);
@@ -581,7 +581,7 @@ #else
current->mm->arg_start = current->mm->start_stack - (MAX_ARG_PAGES * PAGE_SIZE - bprm->p);
#endif
- p = (char *) current->mm->arg_start;
+ p = (char __user *) current->mm->arg_start;
for (loop = bprm->argc; loop > 0; loop--) {
__put_user((elf_caddr_t) p, argv++);
len = strnlen_user(p, PAGE_SIZE * MAX_ARG_PAGES);
@@ -1025,7 +1025,7 @@ static int elf_fdpic_map_file_by_direct_
/* clear the bit between beginning of mapping and beginning of PT_LOAD */
if (prot & PROT_WRITE && disp > 0) {
kdebug("clear[%d] ad=%lx sz=%lx", loop, maddr, disp);
- clear_user((void *) maddr, disp);
+ clear_user((void __user *) maddr, disp);
maddr += disp;
}
@@ -1059,7 +1059,7 @@ #ifdef CONFIG_MMU
if (prot & PROT_WRITE && excess1 > 0) {
kdebug("clear[%d] ad=%lx sz=%lx",
loop, maddr + phdr->p_filesz, excess1);
- clear_user((void *) maddr + phdr->p_filesz, excess1);
+ clear_user((void __user *) maddr + phdr->p_filesz, excess1);
}
#else
^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH 06/15] frv: misc __user annotations
2006-06-19 12:24 [PATCH 01/15] frv: __user infrastructure David Howells
` (3 preceding siblings ...)
2006-06-19 12:24 ` [PATCH 05/15] frv: binfmt_elf_fdpic " David Howells
@ 2006-06-19 12:24 ` David Howells
2006-06-19 12:24 ` [PATCH 07/15] frv: misc sparse annotations David Howells
` (8 subsequent siblings)
13 siblings, 0 replies; 16+ messages in thread
From: David Howells @ 2006-06-19 12:24 UTC (permalink / raw)
To: torvalds, akpm, viro; +Cc: linux-kernel
From: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-Off-By: David Howells <dhowells@redhat.com>
---
arch/frv/kernel/irq.c | 6 +++---
arch/frv/kernel/process.c | 2 +-
arch/frv/kernel/sys_frv.c | 2 +-
include/asm-frv/checksum.h | 2 +-
4 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/arch/frv/kernel/irq.c b/arch/frv/kernel/irq.c
index 11fa326..8b112b3 100644
--- a/arch/frv/kernel/irq.c
+++ b/arch/frv/kernel/irq.c
@@ -625,7 +625,7 @@ static struct proc_dir_entry * irq_dir [
#define HEX_DIGITS 8
-static unsigned int parse_hex_value (const char *buffer,
+static unsigned int parse_hex_value (const char __user *buffer,
unsigned long count, unsigned long *ret)
{
unsigned char hexnum [HEX_DIGITS];
@@ -672,7 +672,7 @@ static int prof_cpu_mask_read_proc (char
return sprintf (page, "%08lx\n", *mask);
}
-static int prof_cpu_mask_write_proc (struct file *file, const char *buffer,
+static int prof_cpu_mask_write_proc (struct file *file, const char __user *buffer,
unsigned long count, void *data)
{
unsigned long *mask = (unsigned long *) data, full_count = count, err;
@@ -711,7 +711,7 @@ void init_irq_proc (void)
int i;
/* create /proc/irq */
- root_irq_dir = proc_mkdir("irq", 0);
+ root_irq_dir = proc_mkdir("irq", NULL);
/* create /proc/irq/prof_cpu_mask */
entry = create_proc_entry("prof_cpu_mask", 0600, root_irq_dir);
diff --git a/arch/frv/kernel/process.c b/arch/frv/kernel/process.c
index 0fff8a6..489e6c4 100644
--- a/arch/frv/kernel/process.c
+++ b/arch/frv/kernel/process.c
@@ -246,7 +246,7 @@ int copy_thread(int nr, unsigned long cl
/*
* sys_execve() executes a new program.
*/
-asmlinkage int sys_execve(char *name, char **argv, char **envp)
+asmlinkage int sys_execve(char __user *name, char __user * __user *argv, char __user * __user *envp)
{
int error;
char * filename;
diff --git a/arch/frv/kernel/sys_frv.c b/arch/frv/kernel/sys_frv.c
index 931aa6d..c4d4348 100644
--- a/arch/frv/kernel/sys_frv.c
+++ b/arch/frv/kernel/sys_frv.c
@@ -32,7 +32,7 @@ #include <asm/ipc.h>
* sys_pipe() is the normal C calling standard for creating
* a pipe. It's not the way unix traditionally does this, though.
*/
-asmlinkage long sys_pipe(unsigned long * fildes)
+asmlinkage long sys_pipe(unsigned long __user * fildes)
{
int fd[2];
int error;
diff --git a/include/asm-frv/checksum.h b/include/asm-frv/checksum.h
index 10236f6..42bf0db 100644
--- a/include/asm-frv/checksum.h
+++ b/include/asm-frv/checksum.h
@@ -43,7 +43,7 @@ unsigned int csum_partial_copy(const cha
* here even more important to align src and dst on a 32-bit (or even
* better 64-bit) boundary
*/
-extern unsigned int csum_partial_copy_from_user(const char *src, char *dst,
+extern unsigned int csum_partial_copy_from_user(const char __user *src, char *dst,
int len, int sum, int *csum_err);
#define csum_partial_copy_nocheck(src, dst, len, sum) \
^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH 07/15] frv: misc sparse annotations
2006-06-19 12:24 [PATCH 01/15] frv: __user infrastructure David Howells
` (4 preceding siblings ...)
2006-06-19 12:24 ` [PATCH 06/15] frv: misc " David Howells
@ 2006-06-19 12:24 ` David Howells
2006-06-19 12:25 ` [PATCH 08/15] frv: wrong syscall David Howells
` (7 subsequent siblings)
13 siblings, 0 replies; 16+ messages in thread
From: David Howells @ 2006-06-19 12:24 UTC (permalink / raw)
To: torvalds, akpm, viro; +Cc: linux-kernel
From: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-Off-By: David Howells <dhowells@redhat.com>
---
arch/frv/kernel/irq-routing.c | 8 ++++----
arch/frv/mb93090-mb00/pci-irq.c | 10 +++++-----
include/asm-frv/highmem.h | 2 +-
3 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/arch/frv/kernel/irq-routing.c b/arch/frv/kernel/irq-routing.c
index d4776d1..b90b70a 100644
--- a/arch/frv/kernel/irq-routing.c
+++ b/arch/frv/kernel/irq-routing.c
@@ -112,7 +112,7 @@ struct irq_source frv_cpuuart[2] = {
#define __CPUUART(X, A) \
[X] = { \
.muxname = "uart", \
- .muxdata = (volatile void __iomem *) A, \
+ .muxdata = (volatile void __iomem *)(unsigned long)A,\
.irqmask = 1 << IRQ_CPU_UART##X, \
.doirq = frv_cpuuart_doirq, \
}
@@ -136,7 +136,7 @@ struct irq_source frv_cpudma[8] = {
#define __CPUDMA(X, A) \
[X] = { \
.muxname = "dma", \
- .muxdata = (volatile void __iomem *) A, \
+ .muxdata = (volatile void __iomem *)(unsigned long)A,\
.irqmask = 1 << IRQ_CPU_DMA##X, \
.doirq = frv_cpudma_doirq, \
}
@@ -164,7 +164,7 @@ struct irq_source frv_cputimer[3] = {
#define __CPUTIMER(X) \
[X] = { \
.muxname = "timer", \
- .muxdata = 0, \
+ .muxdata = NULL, \
.irqmask = 1 << IRQ_CPU_TIMER##X, \
.doirq = frv_cputimer_doirq, \
}
@@ -187,7 +187,7 @@ struct irq_source frv_cpuexternal[8] = {
#define __CPUEXTERNAL(X) \
[X] = { \
.muxname = "ext", \
- .muxdata = 0, \
+ .muxdata = NULL, \
.irqmask = 1 << IRQ_CPU_EXTERNAL##X, \
.doirq = frv_cpuexternal_doirq, \
}
diff --git a/arch/frv/mb93090-mb00/pci-irq.c b/arch/frv/mb93090-mb00/pci-irq.c
index c4a1144..45ae39d 100644
--- a/arch/frv/mb93090-mb00/pci-irq.c
+++ b/arch/frv/mb93090-mb00/pci-irq.c
@@ -32,11 +32,11 @@ #include "pci-frv.h"
*/
static const uint8_t __initdata pci_bus0_irq_routing[32][4] = {
- [0 ] { IRQ_FPGA_MB86943_PCI_INTA },
- [16] { IRQ_FPGA_RTL8029_INTA },
- [17] { IRQ_FPGA_PCI_INTC, IRQ_FPGA_PCI_INTD, IRQ_FPGA_PCI_INTA, IRQ_FPGA_PCI_INTB },
- [18] { IRQ_FPGA_PCI_INTB, IRQ_FPGA_PCI_INTC, IRQ_FPGA_PCI_INTD, IRQ_FPGA_PCI_INTA },
- [19] { IRQ_FPGA_PCI_INTA, IRQ_FPGA_PCI_INTB, IRQ_FPGA_PCI_INTC, IRQ_FPGA_PCI_INTD },
+ [0 ] = { IRQ_FPGA_MB86943_PCI_INTA },
+ [16] = { IRQ_FPGA_RTL8029_INTA },
+ [17] = { IRQ_FPGA_PCI_INTC, IRQ_FPGA_PCI_INTD, IRQ_FPGA_PCI_INTA, IRQ_FPGA_PCI_INTB },
+ [18] = { IRQ_FPGA_PCI_INTB, IRQ_FPGA_PCI_INTC, IRQ_FPGA_PCI_INTD, IRQ_FPGA_PCI_INTA },
+ [19] = { IRQ_FPGA_PCI_INTA, IRQ_FPGA_PCI_INTB, IRQ_FPGA_PCI_INTC, IRQ_FPGA_PCI_INTD },
};
void __init pcibios_irq_init(void)
diff --git a/include/asm-frv/highmem.h b/include/asm-frv/highmem.h
index 295f74a..399e043 100644
--- a/include/asm-frv/highmem.h
+++ b/include/asm-frv/highmem.h
@@ -135,7 +135,7 @@ static inline void *kmap_atomic(struct p
default:
BUG();
- return 0;
+ return NULL;
}
}
^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH 08/15] frv: wrong syscall
2006-06-19 12:24 [PATCH 01/15] frv: __user infrastructure David Howells
` (5 preceding siblings ...)
2006-06-19 12:24 ` [PATCH 07/15] frv: misc sparse annotations David Howells
@ 2006-06-19 12:25 ` David Howells
2006-06-19 12:25 ` [PATCH 09/15] ext2 XIP won't build without MMU David Howells
` (6 subsequent siblings)
13 siblings, 0 replies; 16+ messages in thread
From: David Howells @ 2006-06-19 12:25 UTC (permalink / raw)
To: torvalds, akpm, viro; +Cc: linux-kernel
From: Al Viro <viro@zeniv.linux.org.uk>
The FRV arch should use fstatat64 not newfstatat.
Signed-Off-By: David Howells <dhowells@redhat.com>
---
arch/frv/kernel/entry.S | 2 +-
include/asm-frv/unistd.h | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/frv/kernel/entry.S b/arch/frv/kernel/entry.S
index a9b5952..81d94e4 100644
--- a/arch/frv/kernel/entry.S
+++ b/arch/frv/kernel/entry.S
@@ -1474,7 +1474,7 @@ sys_call_table:
.long sys_mknodat
.long sys_fchownat
.long sys_futimesat
- .long sys_newfstatat /* 300 */
+ .long sys_fstatat64 /* 300 */
.long sys_unlinkat
.long sys_renameat
.long sys_linkat
diff --git a/include/asm-frv/unistd.h b/include/asm-frv/unistd.h
index 2662a3e..dec80c1 100644
--- a/include/asm-frv/unistd.h
+++ b/include/asm-frv/unistd.h
@@ -306,7 +306,7 @@ #define __NR_mkdirat 296
#define __NR_mknodat 297
#define __NR_fchownat 298
#define __NR_futimesat 299
-#define __NR_newfstatat 300
+#define __NR_fstatat64 300
#define __NR_unlinkat 301
#define __NR_renameat 302
#define __NR_linkat 303
^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH 09/15] ext2 XIP won't build without MMU
2006-06-19 12:24 [PATCH 01/15] frv: __user infrastructure David Howells
` (6 preceding siblings ...)
2006-06-19 12:25 ` [PATCH 08/15] frv: wrong syscall David Howells
@ 2006-06-19 12:25 ` David Howells
2006-06-19 12:25 ` [PATCH 10/15] frv: initrd is grossly broken on frv (never built) David Howells
` (5 subsequent siblings)
13 siblings, 0 replies; 16+ messages in thread
From: David Howells @ 2006-06-19 12:25 UTC (permalink / raw)
To: torvalds, akpm, viro; +Cc: linux-kernel
From: Al Viro <viro@zeniv.linux.org.uk>
Disable Ext2 XIP if the kernel is configured in no-MMU mode as the former won't
build.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-Off-By: David Howells <dhowells@redhat.com>
---
fs/Kconfig | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/fs/Kconfig b/fs/Kconfig
index f9b5842..ab69a1e 100644
--- a/fs/Kconfig
+++ b/fs/Kconfig
@@ -53,7 +53,7 @@ config EXT2_FS_SECURITY
config EXT2_FS_XIP
bool "Ext2 execute in place support"
- depends on EXT2_FS
+ depends on EXT2_FS && MMU
help
Execute in place can be used on memory-backed block devices. If you
enable this option, you can select to mount block devices which are
^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH 10/15] frv: initrd is grossly broken on frv (never built)
2006-06-19 12:24 [PATCH 01/15] frv: __user infrastructure David Howells
` (7 preceding siblings ...)
2006-06-19 12:25 ` [PATCH 09/15] ext2 XIP won't build without MMU David Howells
@ 2006-06-19 12:25 ` David Howells
2006-06-19 12:25 ` [PATCH 11/15] frv: NULL noise removal in frv xchg() David Howells
` (4 subsequent siblings)
13 siblings, 0 replies; 16+ messages in thread
From: David Howells @ 2006-06-19 12:25 UTC (permalink / raw)
To: torvalds, akpm, viro; +Cc: linux-kernel
From: Al Viro <viro@zeniv.linux.org.uk>
The FRV arch doesn't currently support initrd, so it should be disabled
automatically for the moment.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-Off-By: David Howells <dhowells@redhat.com>
---
drivers/block/Kconfig | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/drivers/block/Kconfig b/drivers/block/Kconfig
index ae0949b..93d9474 100644
--- a/drivers/block/Kconfig
+++ b/drivers/block/Kconfig
@@ -402,6 +402,7 @@ config BLK_DEV_RAM_SIZE
config BLK_DEV_INITRD
bool "Initial RAM filesystem and RAM disk (initramfs/initrd) support"
+ depends on BROKEN || !FRV
help
The initial RAM filesystem is a ramfs which is loaded by the
boot loader (loadlin or lilo) and that is mounted as root
^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH 11/15] frv: NULL noise removal in frv xchg()
2006-06-19 12:24 [PATCH 01/15] frv: __user infrastructure David Howells
` (8 preceding siblings ...)
2006-06-19 12:25 ` [PATCH 10/15] frv: initrd is grossly broken on frv (never built) David Howells
@ 2006-06-19 12:25 ` David Howells
2006-06-19 12:25 ` [PATCH 12/15] frv: ieee1394 is borken on frv David Howells
` (3 subsequent siblings)
13 siblings, 0 replies; 16+ messages in thread
From: David Howells @ 2006-06-19 12:25 UTC (permalink / raw)
To: torvalds, akpm, viro; +Cc: linux-kernel
From: Al Viro <viro@zeniv.linux.org.uk>
Clean up the FRV arch's xchg() function.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-Off-By: David Howells <dhowells@redhat.com>
---
include/asm-frv/atomic.h | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/asm-frv/atomic.h b/include/asm-frv/atomic.h
index 5d9f84b..68a8e8d 100644
--- a/include/asm-frv/atomic.h
+++ b/include/asm-frv/atomic.h
@@ -228,7 +228,7 @@ ({ \
break; \
\
default: \
- __xg_orig = 0; \
+ __xg_orig = (__typeof__(__xg_orig))0; \
asm volatile("break"); \
break; \
} \
@@ -248,7 +248,7 @@ ({ \
switch (sizeof(__xg_orig)) { \
case 4: __xg_orig = (__typeof__(*(ptr))) __xchg_32((uint32_t) x, __xg_ptr); break; \
default: \
- __xg_orig = 0; \
+ __xg_orig = (__typeof__(__xg_orig))0; \
asm volatile("break"); \
break; \
} \
^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH 12/15] frv: ieee1394 is borken on frv
2006-06-19 12:24 [PATCH 01/15] frv: __user infrastructure David Howells
` (9 preceding siblings ...)
2006-06-19 12:25 ` [PATCH 11/15] frv: NULL noise removal in frv xchg() David Howells
@ 2006-06-19 12:25 ` David Howells
2006-06-19 12:25 ` [PATCH 13/15] frv: Add missing qualifier to memcpy_fromio() prototype David Howells
` (2 subsequent siblings)
13 siblings, 0 replies; 16+ messages in thread
From: David Howells @ 2006-06-19 12:25 UTC (permalink / raw)
To: torvalds, akpm, viro; +Cc: linux-kernel
From: Al Viro <viro@zeniv.linux.org.uk>
The ieee1394 assumes it may make direct use of ->count in the semaphore
structure.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-Off-By: David Howells <dhowells@redhat.com>
---
drivers/ieee1394/Kconfig | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/ieee1394/Kconfig b/drivers/ieee1394/Kconfig
index 39142e2..aac5cb2 100644
--- a/drivers/ieee1394/Kconfig
+++ b/drivers/ieee1394/Kconfig
@@ -4,7 +4,7 @@ menu "IEEE 1394 (FireWire) support"
config IEEE1394
tristate "IEEE 1394 (FireWire) support"
- depends on PCI || BROKEN
+ depends on (PCI || BROKEN) && (BROKEN || !FRV)
select NET
help
IEEE 1394 describes a high performance serial bus, which is also
^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH 13/15] frv: Add missing qualifier to memcpy_fromio() prototype
2006-06-19 12:24 [PATCH 01/15] frv: __user infrastructure David Howells
` (10 preceding siblings ...)
2006-06-19 12:25 ` [PATCH 12/15] frv: ieee1394 is borken on frv David Howells
@ 2006-06-19 12:25 ` David Howells
2006-06-19 12:25 ` [PATCH 14/15] frv: trivial cleanups in frv_ksyms.c David Howells
2006-06-19 12:25 ` [PATCH 15/15] frv: clean frv unistd.h David Howells
13 siblings, 0 replies; 16+ messages in thread
From: David Howells @ 2006-06-19 12:25 UTC (permalink / raw)
To: torvalds, akpm, viro; +Cc: linux-kernel
From: Al Viro <viro@zeniv.linux.org.uk>
The memcpy_fromio() function should have a const qualifier on its source
pointer.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-Off-By: David Howells <dhowells@redhat.com>
---
include/asm-frv/io.h | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/include/asm-frv/io.h b/include/asm-frv/io.h
index 0c18453..58c8f5b 100644
--- a/include/asm-frv/io.h
+++ b/include/asm-frv/io.h
@@ -117,7 +117,7 @@ static inline void memset_io(volatile vo
memset((void __force *) addr, val, count);
}
-static inline void memcpy_fromio(void *dst, volatile void __iomem *src, int count)
+static inline void memcpy_fromio(void *dst, const volatile void __iomem *src, int count)
{
memcpy(dst, (void __force *) src, count);
}
^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH 14/15] frv: trivial cleanups in frv_ksyms.c
2006-06-19 12:24 [PATCH 01/15] frv: __user infrastructure David Howells
` (11 preceding siblings ...)
2006-06-19 12:25 ` [PATCH 13/15] frv: Add missing qualifier to memcpy_fromio() prototype David Howells
@ 2006-06-19 12:25 ` David Howells
2006-06-19 12:25 ` [PATCH 15/15] frv: clean frv unistd.h David Howells
13 siblings, 0 replies; 16+ messages in thread
From: David Howells @ 2006-06-19 12:25 UTC (permalink / raw)
To: torvalds, akpm, viro; +Cc: linux-kernel
From: Al Viro <viro@zeniv.linux.org.uk>
Remove duplicate EXPORT_SYMBOL annotations from the FRV arch.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-Off-By: David Howells <dhowells@redhat.com>
---
arch/frv/kernel/frv_ksyms.c | 18 ------------------
1 files changed, 0 insertions(+), 18 deletions(-)
diff --git a/arch/frv/kernel/frv_ksyms.c b/arch/frv/kernel/frv_ksyms.c
index 0f273a7..dee637f 100644
--- a/arch/frv/kernel/frv_ksyms.c
+++ b/arch/frv/kernel/frv_ksyms.c
@@ -26,16 +26,6 @@ extern long __memset_user(void *dst, con
EXPORT_SYMBOL(__ioremap);
EXPORT_SYMBOL(iounmap);
-EXPORT_SYMBOL(strnlen);
-EXPORT_SYMBOL(strrchr);
-EXPORT_SYMBOL(strstr);
-EXPORT_SYMBOL(strchr);
-EXPORT_SYMBOL(strcat);
-EXPORT_SYMBOL(strlen);
-EXPORT_SYMBOL(strcmp);
-EXPORT_SYMBOL(strncmp);
-EXPORT_SYMBOL(strncpy);
-
EXPORT_SYMBOL(ip_fast_csum);
#if 0
@@ -44,8 +34,6 @@ EXPORT_SYMBOL(local_bh_count);
#endif
EXPORT_SYMBOL(kernel_thread);
-EXPORT_SYMBOL(enable_irq);
-EXPORT_SYMBOL(disable_irq);
EXPORT_SYMBOL(__res_bus_clock_speed_HZ);
EXPORT_SYMBOL(__page_offset);
EXPORT_SYMBOL(__memcpy_user);
@@ -62,18 +50,12 @@ #endif
EXPORT_SYMBOL(__debug_bug_trap);
-/* Networking helper routines. */
-EXPORT_SYMBOL(csum_partial_copy);
-
/* The following are special because they're not called
explicitly (the C compiler generates them). Fortunately,
their interface isn't gonna change any time soon now, so
it's OK to leave it out of version control. */
EXPORT_SYMBOL(memcpy);
EXPORT_SYMBOL(memset);
-EXPORT_SYMBOL(memcmp);
-EXPORT_SYMBOL(memscan);
-EXPORT_SYMBOL(memmove);
EXPORT_SYMBOL(__outsl_ns);
EXPORT_SYMBOL(__insl_ns);
^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH 15/15] frv: clean frv unistd.h
2006-06-19 12:24 [PATCH 01/15] frv: __user infrastructure David Howells
` (12 preceding siblings ...)
2006-06-19 12:25 ` [PATCH 14/15] frv: trivial cleanups in frv_ksyms.c David Howells
@ 2006-06-19 12:25 ` David Howells
2006-06-19 16:00 ` David Woodhouse
13 siblings, 1 reply; 16+ messages in thread
From: David Howells @ 2006-06-19 12:25 UTC (permalink / raw)
To: torvalds, akpm, viro; +Cc: linux-kernel
From: Al Viro <viro@zeniv.linux.org.uk>
Remove _syscall invocations that aren't used in the kernel.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-Off-By: David Howells <dhowells@redhat.com>
---
include/asm-frv/unistd.h | 17 -----------------
1 files changed, 0 insertions(+), 17 deletions(-)
diff --git a/include/asm-frv/unistd.h b/include/asm-frv/unistd.h
index dec80c1..af0f5dd 100644
--- a/include/asm-frv/unistd.h
+++ b/include/asm-frv/unistd.h
@@ -458,24 +458,7 @@ #include <asm/ptrace.h>
* some others too.
*/
#define __NR__exit __NR_exit
-static inline _syscall0(int,pause)
-static inline _syscall0(int,sync)
-static inline _syscall0(pid_t,setsid)
-static inline _syscall3(int,write,int,fd,const char *,buf,off_t,count)
-static inline _syscall3(int,read,int,fd,char *,buf,off_t,count)
-static inline _syscall3(off_t,lseek,int,fd,off_t,offset,int,count)
-static inline _syscall1(int,dup,int,fd)
static inline _syscall3(int,execve,const char *,file,char **,argv,char **,envp)
-static inline _syscall3(int,open,const char *,file,int,flag,int,mode)
-static inline _syscall1(int,close,int,fd)
-static inline _syscall1(int,_exit,int,exitcode)
-static inline _syscall3(pid_t,waitpid,pid_t,pid,int *,wait_stat,int,options)
-static inline _syscall1(int,delete_module,const char *,name)
-
-static inline pid_t wait(int * wait_stat)
-{
- return waitpid(-1,wait_stat,0);
-}
#endif
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH 15/15] frv: clean frv unistd.h
2006-06-19 12:25 ` [PATCH 15/15] frv: clean frv unistd.h David Howells
@ 2006-06-19 16:00 ` David Woodhouse
0 siblings, 0 replies; 16+ messages in thread
From: David Woodhouse @ 2006-06-19 16:00 UTC (permalink / raw)
To: David Howells; +Cc: viro, linux-kernel
On Mon, 2006-06-19 at 13:25 +0100, David Howells wrote:
> From: Al Viro <viro@zeniv.linux.org.uk>
>
> Remove _syscall invocations that aren't used in the kernel.
>
> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
> Signed-Off-By: David Howells <dhowells@redhat.com>
In that case, you might as well remove the definitions of _syscall0,
_syscall1, etc. too. Nothing uses them now at all, does it?
--
dwmw2
^ permalink raw reply [flat|nested] 16+ messages in thread
end of thread, other threads:[~2006-06-19 16:00 UTC | newest]
Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-06-19 12:24 [PATCH 01/15] frv: __user infrastructure David Howells
2006-06-19 12:24 ` [PATCH 02/15] frv: basic __iomem annotations David Howells
2006-06-19 12:24 ` [PATCH 03/15] frv: signal annotations David Howells
2006-06-19 12:24 ` [PATCH 04/15] frv: sysctl __user annotations David Howells
2006-06-19 12:24 ` [PATCH 05/15] frv: binfmt_elf_fdpic " David Howells
2006-06-19 12:24 ` [PATCH 06/15] frv: misc " David Howells
2006-06-19 12:24 ` [PATCH 07/15] frv: misc sparse annotations David Howells
2006-06-19 12:25 ` [PATCH 08/15] frv: wrong syscall David Howells
2006-06-19 12:25 ` [PATCH 09/15] ext2 XIP won't build without MMU David Howells
2006-06-19 12:25 ` [PATCH 10/15] frv: initrd is grossly broken on frv (never built) David Howells
2006-06-19 12:25 ` [PATCH 11/15] frv: NULL noise removal in frv xchg() David Howells
2006-06-19 12:25 ` [PATCH 12/15] frv: ieee1394 is borken on frv David Howells
2006-06-19 12:25 ` [PATCH 13/15] frv: Add missing qualifier to memcpy_fromio() prototype David Howells
2006-06-19 12:25 ` [PATCH 14/15] frv: trivial cleanups in frv_ksyms.c David Howells
2006-06-19 12:25 ` [PATCH 15/15] frv: clean frv unistd.h David Howells
2006-06-19 16:00 ` David Woodhouse
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®