[PATCH] Remove the macro get_personality
From: WANG Cong <[EMAIL PROTECTED]> Date: Sun, 24 Feb 2008 12:09:03 +0800 Subject: [PATCH] Remove the macro get_personality Remove the macro get_personality, use ->personality instead. Cc: Ingo Molnar <[EMAIL PROTECTED]> Cc: Christoph Hellwig <[EMAIL PROTECTED] Cc: Alexey Dobriyan <[EMAIL PROTECTED]> Cc: David Howells <[EMAIL PROTECTED]> Cc: Bryan Wu <[EMAIL PROTECTED]> Signed-off-by: WANG Cong <[EMAIL PROTECTED]> --- arch/blackfin/kernel/signal.c |2 +- arch/frv/kernel/signal.c |4 ++-- include/linux/personality.h |4 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/arch/blackfin/kernel/signal.c b/arch/blackfin/kernel/signal.c index 5564c95..e8d3869 100644 --- a/arch/blackfin/kernel/signal.c +++ b/arch/blackfin/kernel/signal.c @@ -224,7 +224,7 @@ setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t * info, /* Set up registers for signal handler */ wrusp((unsigned long)frame); - if (get_personality & FDPIC_FUNCPTRS) { + if (current->personality & FDPIC_FUNCPTRS) { struct fdpic_func_descriptor __user *funcptr = (struct fdpic_func_descriptor *) ka->sa.sa_handler; __get_user(regs->pc, &funcptr->text); diff --git a/arch/frv/kernel/signal.c b/arch/frv/kernel/signal.c index d64bcaf..3bdb368 100644 --- a/arch/frv/kernel/signal.c +++ b/arch/frv/kernel/signal.c @@ -297,7 +297,7 @@ static int setup_frame(int sig, struct k_sigaction *ka, sigset_t *set) __frame->lr = (unsigned long) &frame->retcode; __frame->gr8 = sig; - if (get_personality & FDPIC_FUNCPTRS) { + if (current->personality & FDPIC_FUNCPTRS) { struct fdpic_func_descriptor __user *funcptr = (struct fdpic_func_descriptor __user *) ka->sa.sa_handler; __get_user(__frame->pc, &funcptr->text); @@ -396,7 +396,7 @@ static int setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, __frame->gr8 = sig; __frame->gr9 = (unsigned long) &frame->info; - if (get_personality & FDPIC_FUNCPTRS) { + if (current->personality & FDPIC_FUNCPTRS) { struct fdpic_func_descriptor __user *funcptr = (struct fdpic_func_descriptor __user *) ka->sa.sa_handler; __get_user(__frame->pc, &funcptr->text); diff --git a/include/linux/personality.h b/include/linux/personality.h index 012cd55..a84e9ff 100644 --- a/include/linux/personality.h +++ b/include/linux/personality.h @@ -105,10 +105,6 @@ struct exec_domain { */ #define personality(pers) (pers & PER_MASK) -/* - * Personality of the currently running process. - */ -#define get_personality(current->personality) /* * Change personality of the currently running process. -- 1.5.3.8 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 00/16] (Resend) Use get_personality()
From: Andrew Morton <[EMAIL PROTECTED]> Subject: Re: [PATCH 00/16] (Resend) Use get_personality() Date: Sat, 23 Feb 2008 11:16:29 -0800 Message-ID: <[EMAIL PROTECTED]> > On Sat, 23 Feb 2008 13:37:31 -0500 Christoph Hellwig <[EMAIL PROTECTED]> > wrote: > > > On Sat, Feb 23, 2008 at 12:27:10PM +0300, Alexey Dobriyan wrote: > > > > Use get_personality() can hide the task_struct internals a bit. > > > > > > ->personality is going to become something less trivial? > > > Sorry, but you sound like C++ people writing tons of pointless get/set > > > wrappers. And your get_personality() is worse -- C++ would write it as > > > > > > current->personality() > > > > > > and again, even here, it's immediately visible that current task is > > > involved, not some other task. > > > > Yes, completely agreement. While I might have introduced this gem > > back then it is entirely stupid if you think about it. Please send > > patches to kill get_personality and just use current->personality > > instead. > > > > yup. > > We'll generally only add wrappers of this form if we need to provide > alternative implementations, or if we expect that we shall do so in the > future. > Ok. I will send a patch to remove it. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 08/16] x86: use get_personality()
From: Ingo Molnar <[EMAIL PROTECTED]> Subject: Re: [PATCH 08/16] x86: use get_personality() Date: Sat, 23 Feb 2008 11:19:54 +0100 Message-ID: <[EMAIL PROTECTED]> > > * Ingo Molnar <[EMAIL PROTECTED]> wrote: > > > * WANG Cong <[EMAIL PROTECTED]> wrote: > > > > > Use get_personality() macro instead of explicit reference for x86 > > > code. > > > > thanks, applied. > > randconfig testing found the following build failures: > > arch/x86/kernel/process_64.c: In function 'do_arch_prctl': > arch/x86/kernel/process_64.c:836: error: called object > 'get_current()->personality' is not a function > arch/x86/kernel/process_64.c:862: error: called object > 'get_current()->personality' is not a function > > so i dropped the patch again. Config attached. > > Ingo Sorry that I didn't mention that this patch should be applied _after_ [patch 01/16], since in [patch 01/16] I made the macro get_personality like a function. Sorry for this. Just wait after [patch 01/16] is applied. Thanks. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 00/16] (Resend) Use get_personality()
From: Alexey Dobriyan <[EMAIL PROTECTED]> Subject: Re: [PATCH 00/16] (Resend) Use get_personality() Date: Sat, 23 Feb 2008 12:27:10 +0300 Message-ID: <[EMAIL PROTECTED]> > On Sat, Feb 23, 2008 at 04:59:44PM +0800, WANG Cong wrote: > > From: Alexey Dobriyan <[EMAIL PROTECTED]> > > Subject: Re: [PATCH 00/16] (Resend) Use get_personality() > > > > On Sat, Feb 23, 2008 at 04:14:03PM +0800, WANG Cong wrote: > > > > This patchset makes the macro get_personality function alike > > > > and teaches code to use get_personality() instead of explicit > > > > reference. > > > > > > > > [I am sorry if you've received multiple copied of this, since > > > > my git-send-email doesn't work well. ] > > > > > > Yes, but why? "current->personality" is way more understandable than > > > your macro because task subject to dereference is very visible. > > > > Use get_personality() can hide the task_struct internals a bit. > > ->personality is going to become something less trivial? > Sorry, but you sound like C++ people writing tons of pointless get/set > wrappers. And your get_personality() is worse -- C++ would write it as > > current->personality() > > and again, even here, it's immediately visible that current task is > involved, not some other task. > Can't get_personality() mean getting the personality of current task? Or you want a more generic macro like this? #define get_task_personality(tsk) ((tsk)->personality) No, that is _too_ generic. Look at the code, (nearly) all references to 'personality' are via 'current'. So get_personality() is enough. I am not a fan of C++, I know that sometimes the get/set method in C++ is really a bit pointless, but, of course, *not* all the times. Regards. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 00/16] (Resend) Use get_personality()
From: Alexey Dobriyan <[EMAIL PROTECTED]> Subject: Re: [PATCH 00/16] (Resend) Use get_personality() Date: Sat, 23 Feb 2008 11:51:01 +0300 Message-ID: <[EMAIL PROTECTED]> > On Sat, Feb 23, 2008 at 04:14:03PM +0800, WANG Cong wrote: > > This patchset makes the macro get_personality function alike > > and teaches code to use get_personality() instead of explicit > > reference. > > > > [I am sorry if you've received multiple copied of this, since > > my git-send-email doesn't work well. ] > > Yes, but why? "current->personality" is way more understandable than > your macro because task subject to dereference is very visible. Use get_personality() can hide the task_struct internals a bit. And I don't think using the macro to access it is less understandable. Since 'current' won't be NULL, whether the dereference is visible is not important. Regards. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 15/16] mn10300: use get_personality()
Use get_personality() macro instead of explicit reference for mn10300 code. Signed-off-by: WANG Cong <[EMAIL PROTECTED]> Cc: David Howells <[EMAIL PROTECTED]> Cc: [EMAIL PROTECTED] --- include/asm-mn10300/page.h |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/include/asm-mn10300/page.h b/include/asm-mn10300/page.h index 124971b..fc6e9fb 100644 --- a/include/asm-mn10300/page.h +++ b/include/asm-mn10300/page.h @@ -123,7 +123,7 @@ static inline int get_order(unsigned long size) #define VM_DATA_DEFAULT_FLAGS \ (VM_READ | VM_WRITE | \ - ((current->personality & READ_IMPLIES_EXEC) ? VM_EXEC : 0) | \ + ((get_personality() & READ_IMPLIES_EXEC) ? VM_EXEC : 0) | \ VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC) #endif /* __KERNEL__ */ -- 1.5.3.8 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 16/16] kernel: use get_personality()
Use get_personality() macro instead of explicit reference. Signed-off-by: WANG Cong <[EMAIL PROTECTED]> Cc: Christoph Hellwig <[EMAIL PROTECTED]> --- kernel/exec_domain.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/exec_domain.c b/kernel/exec_domain.c index a9e6bad..056ba23 100644 --- a/kernel/exec_domain.c +++ b/kernel/exec_domain.c @@ -192,11 +192,11 @@ get_exec_domain_list(char *page) asmlinkage long sys_personality(u_long personality) { - u_long old = current->personality; + u_long old = get_personality(); if (personality != 0x) { set_personality(personality); - if (current->personality != personality) + if (get_personality() != personality) return -EINVAL; } -- 1.5.3.8 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 13/16] alpha: use get_personality()
Use get_personality() macro instead of explicit reference for alpha code. Signed-off-by: WANG Cong <[EMAIL PROTECTED]> Cc: Richard Henderson <[EMAIL PROTECTED]> --- arch/alpha/kernel/osf_sys.c |6 +++--- include/asm-alpha/processor.h |4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/arch/alpha/kernel/osf_sys.c b/arch/alpha/kernel/osf_sys.c index 8c71daf..df825a4 100644 --- a/arch/alpha/kernel/osf_sys.c +++ b/arch/alpha/kernel/osf_sys.c @@ -1266,7 +1266,7 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr, unsigned long limit; /* "32 bit" actually means 31 bit, since pointers sign extend. */ - if (current->personality & ADDR_LIMIT_32BIT) + if (get_personality() & ADDR_LIMIT_32BIT) limit = 0x8000; else limit = TASK_SIZE; @@ -1327,7 +1327,7 @@ osf_fix_iov_len(const struct iovec __user *iov, unsigned long count) asmlinkage ssize_t osf_readv(unsigned long fd, const struct iovec __user * vector, unsigned long count) { - if (unlikely(personality(current->personality) == PER_OSF4)) + if (unlikely(personality(get_personality()) == PER_OSF4)) if (osf_fix_iov_len(vector, count)) return -EFAULT; return sys_readv(fd, vector, count); @@ -1336,7 +1336,7 @@ osf_readv(unsigned long fd, const struct iovec __user * vector, unsigned long co asmlinkage ssize_t osf_writev(unsigned long fd, const struct iovec __user * vector, unsigned long count) { - if (unlikely(personality(current->personality) == PER_OSF4)) + if (unlikely(personality(get_personality()) == PER_OSF4)) if (osf_fix_iov_len(vector, count)) return -EFAULT; return sys_writev(fd, vector, count); diff --git a/include/asm-alpha/processor.h b/include/asm-alpha/processor.h index 94afe58..6c164b9 100644 --- a/include/asm-alpha/processor.h +++ b/include/asm-alpha/processor.h @@ -21,7 +21,7 @@ #define TASK_SIZE (0x400UL) #define STACK_TOP \ - (current->personality & ADDR_LIMIT_32BIT ? 0x8000 : 0x0012000UL) + (get_personality() & ADDR_LIMIT_32BIT ? 0x8000 : 0x0012000UL) #define STACK_TOP_MAX 0x0012000UL @@ -29,7 +29,7 @@ * space during mmap's. */ #define TASK_UNMAPPED_BASE \ - ((current->personality & ADDR_LIMIT_32BIT) ? 0x4000 : TASK_SIZE / 2) + ((get_personality() & ADDR_LIMIT_32BIT) ? 0x4000 : TASK_SIZE / 2) typedef struct { unsigned long seg; -- 1.5.3.8 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 14/16] frv: use get_personality()
Use get_personality() macro instead of explicit reference for frv code. Signed-off-by: WANG Cong <[EMAIL PROTECTED]> Cc: David Howells <[EMAIL PROTECTED]> --- include/asm-frv/page.h |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/include/asm-frv/page.h b/include/asm-frv/page.h index c2c1e89..6c5c4db 100644 --- a/include/asm-frv/page.h +++ b/include/asm-frv/page.h @@ -69,7 +69,7 @@ extern unsigned long max_pfn; #ifdef CONFIG_MMU #define VM_DATA_DEFAULT_FLAGS \ (VM_READ | VM_WRITE | \ - ((current->personality & READ_IMPLIES_EXEC) ? VM_EXEC : 0 ) | \ + ((get_personality() & READ_IMPLIES_EXEC) ? VM_EXEC : 0 ) | \ VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC) #endif -- 1.5.3.8 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 11/16] mips: use get_personality()
Use get_personality() macro instead of explicit reference for mips code. Signed-off-by: WANG Cong <[EMAIL PROTECTED]> Cc: Ralf Baechle <[EMAIL PROTECTED]> --- arch/mips/kernel/linux32.c |4 ++-- arch/mips/kernel/process.c |4 ++-- include/asm-mips/elf.h |2 +- include/asm-mips/namei.h |2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/arch/mips/kernel/linux32.c b/arch/mips/kernel/linux32.c index 65af3cc..e5b7671 100644 --- a/arch/mips/kernel/linux32.c +++ b/arch/mips/kernel/linux32.c @@ -446,7 +446,7 @@ asmlinkage long sys32_newuname(struct new_utsname __user * name) ret = -EFAULT; up_read(&uts_sem); - if (current->personality == PER_LINUX32 && !ret) + if (get_personality() == PER_LINUX32 && !ret) if (copy_to_user(name->machine, "mips\0\0\0", 8)) ret = -EFAULT; @@ -457,7 +457,7 @@ asmlinkage int sys32_personality(unsigned long personality) { int ret; personality &= 0x; - if (personality(current->personality) == PER_LINUX32 && + if (personality(get_personality()) == PER_LINUX32 && personality == PER_LINUX) personality = PER_LINUX32; ret = sys_personality(personality); diff --git a/arch/mips/kernel/process.c b/arch/mips/kernel/process.c index 2c09a44..dc7486c 100644 --- a/arch/mips/kernel/process.c +++ b/arch/mips/kernel/process.c @@ -126,7 +126,7 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long usp, childregs->regs[7] = 0; /* Clear error flag */ #if defined(CONFIG_BINFMT_IRIX) - if (current->personality != PER_LINUX) { + if (get_personality() != PER_LINUX) { /* Under IRIX things are a little different. */ childregs->regs[3] = 1; regs->regs[3] = 0; @@ -471,7 +471,7 @@ out: */ unsigned long arch_align_stack(unsigned long sp) { - if (!(current->personality & ADDR_NO_RANDOMIZE) && randomize_va_space) + if (!(get_personality() & ADDR_NO_RANDOMIZE) && randomize_va_space) sp -= get_random_int() & ~PAGE_MASK; return sp & ALMASK; diff --git a/include/asm-mips/elf.h b/include/asm-mips/elf.h index f69f7ac..c07f464 100644 --- a/include/asm-mips/elf.h +++ b/include/asm-mips/elf.h @@ -308,7 +308,7 @@ do { \ \ if (ibcs2) \ set_personality(PER_SVR4); \ - else if (current->personality != PER_LINUX32) \ + else if (get_personality() != PER_LINUX32) \ set_personality(PER_LINUX); \ } while (0) diff --git a/include/asm-mips/namei.h b/include/asm-mips/namei.h index c94d12d..18ab9eb 100644 --- a/include/asm-mips/namei.h +++ b/include/asm-mips/namei.h @@ -9,7 +9,7 @@ static inline char *__emul_prefix(void) { - switch (current->personality) { + switch (get_personality()) { case PER_IRIX32: case PER_IRIXN32: case PER_IRIX64: -- 1.5.3.8 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 12/16] ia64: use get_personality()
Use get_personality() macro instead of explicit reference for ia64 code. Signed-off-by: WANG Cong <[EMAIL PROTECTED]> Cc: Tony Luck <[EMAIL PROTECTED]> --- arch/ia64/ia32/sys_ia32.c |2 +- arch/ia64/mm/init.c |2 +- include/asm-ia64/fcntl.h |2 +- include/asm-ia64/namei.h |2 +- include/asm-ia64/page.h |2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/arch/ia64/ia32/sys_ia32.c b/arch/ia64/ia32/sys_ia32.c index d025a22..a91273f 100644 --- a/arch/ia64/ia32/sys_ia32.c +++ b/arch/ia64/ia32/sys_ia32.c @@ -2265,7 +2265,7 @@ sys32_personality (unsigned int personality) { long ret; - if (current->personality == PER_LINUX32 && personality == PER_LINUX) + if (get_personality() == PER_LINUX32 && personality == PER_LINUX) personality = PER_LINUX32; ret = sys_personality(personality); if (ret == PER_LINUX32) diff --git a/arch/ia64/mm/init.c b/arch/ia64/mm/init.c index 25aef62..f5641bb 100644 --- a/arch/ia64/mm/init.c +++ b/arch/ia64/mm/init.c @@ -139,7 +139,7 @@ ia64_init_addr_space (void) } /* map NaT-page at address zero to speed up speculative dereferencing of NULL: */ - if (!(current->personality & MMAP_PAGE_ZERO)) { + if (!(get_personality() & MMAP_PAGE_ZERO)) { vma = kmem_cache_zalloc(vm_area_cachep, GFP_KERNEL); if (vma) { vma->vm_mm = current->mm; diff --git a/include/asm-ia64/fcntl.h b/include/asm-ia64/fcntl.h index 1dd275d..e8acf85 100644 --- a/include/asm-ia64/fcntl.h +++ b/include/asm-ia64/fcntl.h @@ -6,7 +6,7 @@ */ #define force_o_largefile()\ - (personality(current->personality) != PER_LINUX32) + (personality(get_personality()) != PER_LINUX32) #include diff --git a/include/asm-ia64/namei.h b/include/asm-ia64/namei.h index 78e7680..da38e5c 100644 --- a/include/asm-ia64/namei.h +++ b/include/asm-ia64/namei.h @@ -14,7 +14,7 @@ static inline char * __emul_prefix (void) { - switch (current->personality) { + switch (get_personality()) { case PER_LINUX32: return EMUL_PREFIX_LINUX_IA32; default: diff --git a/include/asm-ia64/page.h b/include/asm-ia64/page.h index 4999a6c..287e53b 100644 --- a/include/asm-ia64/page.h +++ b/include/asm-ia64/page.h @@ -224,7 +224,7 @@ get_order (unsigned long size) #define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | \ VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC |\ -(((current->personality & READ_IMPLIES_EXEC) != 0) \ +(((get_personality() & READ_IMPLIES_EXEC) != 0)\ ? VM_EXEC : 0)) #endif /* _ASM_IA64_PAGE_H */ -- 1.5.3.8 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 10/16] s390: use get_personality()
Use get_personality() macro instead of explicit reference for s390 code. Signed-off-by: WANG Cong <[EMAIL PROTECTED]> Cc: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] --- arch/s390/kernel/binfmt_elf32.c |2 +- arch/s390/kernel/sys_s390.c |4 ++-- arch/s390/mm/mmap.c |2 +- include/asm-s390/elf.h |2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/arch/s390/kernel/binfmt_elf32.c b/arch/s390/kernel/binfmt_elf32.c index 3e1c315..6a55911 100644 --- a/arch/s390/kernel/binfmt_elf32.c +++ b/arch/s390/kernel/binfmt_elf32.c @@ -78,7 +78,7 @@ do { \ if (ibcs2) \ set_personality(PER_SVR4); \ - else if (current->personality != PER_LINUX32) \ + else if (get_personality() != PER_LINUX32) \ set_personality(PER_LINUX); \ set_thread_flag(TIF_31BIT); \ } while (0) diff --git a/arch/s390/kernel/sys_s390.c b/arch/s390/kernel/sys_s390.c index fefee99..f8371fe 100644 --- a/arch/s390/kernel/sys_s390.c +++ b/arch/s390/kernel/sys_s390.c @@ -215,7 +215,7 @@ asmlinkage long s390x_newuname(struct new_utsname __user *name) { int ret = sys_newuname(name); - if (current->personality == PER_LINUX32 && !ret) { + if (get_personality() == PER_LINUX32 && !ret) { ret = copy_to_user(name->machine, "s390\0\0\0\0", 8); if (ret) ret = -EFAULT; } @@ -226,7 +226,7 @@ asmlinkage long s390x_personality(unsigned long personality) { int ret; - if (current->personality == PER_LINUX32 && personality == PER_LINUX) + if (get_personality() == PER_LINUX32 && personality == PER_LINUX) personality = PER_LINUX32; ret = sys_personality(personality); if (ret == PER_LINUX32) diff --git a/arch/s390/mm/mmap.c b/arch/s390/mm/mmap.c index 5932a82..f5bf304 100644 --- a/arch/s390/mm/mmap.c +++ b/arch/s390/mm/mmap.c @@ -59,7 +59,7 @@ static inline int mmap_is_legacy(void) return 1; #endif return sysctl_legacy_va_layout || - (current->personality & ADDR_COMPAT_LAYOUT) || + (get_personality() & ADDR_COMPAT_LAYOUT) || current->signal->rlim[RLIMIT_STACK].rlim_cur == RLIM_INFINITY; } diff --git a/include/asm-s390/elf.h b/include/asm-s390/elf.h index b3ac262..18482d3 100644 --- a/include/asm-s390/elf.h +++ b/include/asm-s390/elf.h @@ -202,7 +202,7 @@ extern char elf_platform[]; do { \ if (ibcs2) \ set_personality(PER_SVR4); \ - else if (current->personality != PER_LINUX32) \ + else if (get_personality() != PER_LINUX32) \ set_personality(PER_LINUX); \ clear_thread_flag(TIF_31BIT); \ } while (0) -- 1.5.3.8 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 08/16] x86: use get_personality()
Use get_personality() macro instead of explicit reference for x86 code. Signed-off-by: WANG Cong <[EMAIL PROTECTED]> Cc: Ingo Molnar <[EMAIL PROTECTED]> --- arch/x86/ia32/sys_ia32.c |6 +++--- arch/x86/kernel/process_32.c |2 +- arch/x86/kernel/process_64.c |2 +- arch/x86/kernel/sys_x86_64.c |2 +- arch/x86/mm/mmap.c |2 +- include/asm-x86/page.h |2 +- include/asm-x86/processor.h |2 +- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/arch/x86/ia32/sys_ia32.c b/arch/x86/ia32/sys_ia32.c index abf71d2..80e7431 100644 --- a/arch/x86/ia32/sys_ia32.c +++ b/arch/x86/ia32/sys_ia32.c @@ -666,7 +666,7 @@ asmlinkage long sys32_personality(unsigned long personality) { int ret; - if (personality(current->personality) == PER_LINUX32 && + if (personality(get_personality()) == PER_LINUX32 && personality == PER_LINUX) personality = PER_LINUX32; ret = sys_personality(personality); @@ -744,7 +744,7 @@ asmlinkage long sys32_olduname(struct oldold_utsname __user *name) __OLD_UTS_LEN); err |= __put_user(0, name->version+__OLD_UTS_LEN); - if (personality(current->personality) == PER_LINUX32) + if (personality(get_personality()) == PER_LINUX32) arch = "i686"; err |= __copy_to_user(&name->machine, arch, strlen(arch) + 1); @@ -765,7 +765,7 @@ long sys32_uname(struct old_utsname __user *name) down_read(&uts_sem); err = copy_to_user(name, utsname(), sizeof(*name)); up_read(&uts_sem); - if (personality(current->personality) == PER_LINUX32) + if (personality(get_personality()) == PER_LINUX32) err |= copy_to_user(&name->machine, "i686", 5); return err ? -EFAULT : 0; diff --git a/arch/x86/kernel/process_32.c b/arch/x86/kernel/process_32.c index a7d50a5..c4992fc 100644 --- a/arch/x86/kernel/process_32.c +++ b/arch/x86/kernel/process_32.c @@ -837,7 +837,7 @@ unsigned long get_wchan(struct task_struct *p) unsigned long arch_align_stack(unsigned long sp) { - if (!(current->personality & ADDR_NO_RANDOMIZE) && randomize_va_space) + if (!(get_personality() & ADDR_NO_RANDOMIZE) && randomize_va_space) sp -= get_random_int() % 8192; return sp & ~0xf; } diff --git a/arch/x86/kernel/process_64.c b/arch/x86/kernel/process_64.c index b0cc8f0..8223f3f 100644 --- a/arch/x86/kernel/process_64.c +++ b/arch/x86/kernel/process_64.c @@ -915,7 +915,7 @@ long sys_arch_prctl(int code, unsigned long addr) unsigned long arch_align_stack(unsigned long sp) { - if (!(current->personality & ADDR_NO_RANDOMIZE) && randomize_va_space) + if (!(get_personality() & ADDR_NO_RANDOMIZE) && randomize_va_space) sp -= get_random_int() % 8192; return sp & ~0xf; } diff --git a/arch/x86/kernel/sys_x86_64.c b/arch/x86/kernel/sys_x86_64.c index bd802a5..0b7548b 100644 --- a/arch/x86/kernel/sys_x86_64.c +++ b/arch/x86/kernel/sys_x86_64.c @@ -247,7 +247,7 @@ asmlinkage long sys_uname(struct new_utsname __user * name) down_read(&uts_sem); err = copy_to_user(name, utsname(), sizeof (*name)); up_read(&uts_sem); - if (personality(current->personality) == PER_LINUX32) + if (personality(get_personality()) == PER_LINUX32) err |= copy_to_user(&name->machine, "i686", 5); return err ? -EFAULT : 0; } diff --git a/arch/x86/mm/mmap.c b/arch/x86/mm/mmap.c index 56fe712..f299d64 100644 --- a/arch/x86/mm/mmap.c +++ b/arch/x86/mm/mmap.c @@ -55,7 +55,7 @@ static int mmap_is_ia32(void) static int mmap_is_legacy(void) { - if (current->personality & ADDR_COMPAT_LAYOUT) + if (get_personality() & ADDR_COMPAT_LAYOUT) return 1; if (current->signal->rlim[RLIMIT_STACK].rlim_cur == RLIM_INFINITY) diff --git a/include/asm-x86/page.h b/include/asm-x86/page.h index 1cb7c51..fd90c7a 100644 --- a/include/asm-x86/page.h +++ b/include/asm-x86/page.h @@ -42,7 +42,7 @@ #define PAGE_OFFSET((unsigned long)__PAGE_OFFSET) #define VM_DATA_DEFAULT_FLAGS \ - (((current->personality & READ_IMPLIES_EXEC) ? VM_EXEC : 0 ) | \ + (((get_personality() & READ_IMPLIES_EXEC) ? VM_EXEC : 0 ) | \ VM_READ | VM_WRITE | VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC) diff --git a/include/asm-x86/processor.h b/include/asm-x86/processor.h index 45a2f0a..c426dc1 100644 --- a/include/asm-x86/processor.h +++ b/include/asm-x86/processor.h @@ -791,7 +791,7 @@ extern unsigned long thread_saved_pc(struct task_struct *tsk); /* This decides where the kernel will search for a free chunk of vm * space during mmap's. */ -#defi
[PATCH 09/16] um: use get_personality()
Use get_personality() macro instead of explicit reference for uml code. Signed-off-by: WANG Cong <[EMAIL PROTECTED]> Cc: Jeff Dike <[EMAIL PROTECTED]> --- arch/um/kernel/process.c |2 +- arch/um/sys-x86_64/syscalls.c |2 +- include/asm-um/vm-flags-i386.h |2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/um/kernel/process.c b/arch/um/kernel/process.c index fc50d2f..91e0a84 100644 --- a/arch/um/kernel/process.c +++ b/arch/um/kernel/process.c @@ -405,7 +405,7 @@ int singlestepping(void * t) #ifndef arch_align_stack unsigned long arch_align_stack(unsigned long sp) { - if (!(current->personality & ADDR_NO_RANDOMIZE) && randomize_va_space) + if (!(get_personality() & ADDR_NO_RANDOMIZE) && randomize_va_space) sp -= get_random_int() % 8192; return sp & ~0xf; } diff --git a/arch/um/sys-x86_64/syscalls.c b/arch/um/sys-x86_64/syscalls.c index f1199fd..cf7b61e 100644 --- a/arch/um/sys-x86_64/syscalls.c +++ b/arch/um/sys-x86_64/syscalls.c @@ -20,7 +20,7 @@ asmlinkage long sys_uname64(struct new_utsname __user * name) err = copy_to_user(name, utsname(), sizeof (*name)); up_read(&uts_sem); - if (personality(current->personality) == PER_LINUX32) + if (personality(get_personality()) == PER_LINUX32) err |= copy_to_user(&name->machine, "i686", 5); return err ? -EFAULT : 0; diff --git a/include/asm-um/vm-flags-i386.h b/include/asm-um/vm-flags-i386.h index e0d24c5..c30e0f6 100644 --- a/include/asm-um/vm-flags-i386.h +++ b/include/asm-um/vm-flags-i386.h @@ -8,7 +8,7 @@ #define VM_DATA_DEFAULT_FLAGS \ (VM_READ | VM_WRITE | \ - ((current->personality & READ_IMPLIES_EXEC) ? VM_EXEC : 0 ) | \ + ((get_personality() & READ_IMPLIES_EXEC) ? VM_EXEC : 0 ) | \ VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC) #endif -- 1.5.3.8 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 06/16] sparc(64): use get_personality()
Use get_personality() macro and other two tiny improvements. Signed-off-by: WANG Cong <[EMAIL PROTECTED]> Cc: David Miller <[EMAIL PROTECTED]> Cc: William L. Irwin <[EMAIL PROTECTED]> Cc: [EMAIL PROTECTED] --- arch/sparc/kernel/signal.c |2 +- arch/sparc64/kernel/signal32.c |2 +- arch/sparc64/kernel/sys_sparc.c |6 +++--- include/asm-sparc/namei.h |2 +- include/asm-sparc64/elf.h |2 +- include/asm-sparc64/namei.h |2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/arch/sparc/kernel/signal.c b/arch/sparc/kernel/signal.c index 9994cac..0464874 100644 --- a/arch/sparc/kernel/signal.c +++ b/arch/sparc/kernel/signal.c @@ -1010,7 +1010,7 @@ asmlinkage void do_signal(struct pt_regs * regs, unsigned long orig_i0, int rest #ifdef SVR4_SIGNAL_BROKEN int svr4_signal = 0; #else - int svr4_signal = current->personality == PER_SVR4; + int svr4_signal = (get_personality() == PER_SVR4); #endif cookie.restart_syscall = restart_syscall; diff --git a/arch/sparc64/kernel/signal32.c b/arch/sparc64/kernel/signal32.c index 8c1c121..e3bc993 100644 --- a/arch/sparc64/kernel/signal32.c +++ b/arch/sparc64/kernel/signal32.c @@ -1270,7 +1270,7 @@ void do_signal32(sigset_t *oldset, struct pt_regs * regs, struct signal_deliver_cookie cookie; struct k_sigaction ka; int signr; - int svr4_signal = current->personality == PER_SVR4; + int svr4_signal = (get_personality() == PER_SVR4); cookie.restart_syscall = restart_syscall; cookie.orig_i0 = orig_i0; diff --git a/arch/sparc64/kernel/sys_sparc.c b/arch/sparc64/kernel/sys_sparc.c index 134d801..3813ec7 100644 --- a/arch/sparc64/kernel/sys_sparc.c +++ b/arch/sparc64/kernel/sys_sparc.c @@ -372,7 +372,7 @@ void arch_pick_mmap_layout(struct mm_struct *mm) * bit is set, or if the expected stack growth is unlimited: */ if (!test_thread_flag(TIF_32BIT) || - (current->personality & ADDR_COMPAT_LAYOUT) || + (get_personality() & ADDR_COMPAT_LAYOUT) || current->signal->rlim[RLIMIT_STACK].rlim_cur == RLIM_INFINITY || sysctl_legacy_va_layout) { mm->mmap_base = TASK_UNMAPPED_BASE + random_factor; @@ -518,7 +518,7 @@ asmlinkage long sparc64_newuname(struct new_utsname __user *name) { int ret = sys_newuname(name); - if (current->personality == PER_LINUX32 && !ret) { + if (get_personality() == PER_LINUX32 && !ret) { ret = (copy_to_user(name->machine, "sparc\0\0", 8) ? -EFAULT : 0); } @@ -529,7 +529,7 @@ asmlinkage long sparc64_personality(unsigned long personality) { int ret; - if (current->personality == PER_LINUX32 && + if (get_personality() == PER_LINUX32 && personality == PER_LINUX) personality = PER_LINUX32; ret = sys_personality(personality); diff --git a/include/asm-sparc/namei.h b/include/asm-sparc/namei.h index f2461e8..b87f621 100644 --- a/include/asm-sparc/namei.h +++ b/include/asm-sparc/namei.h @@ -13,7 +13,7 @@ static inline char * __emul_prefix(void) { - switch (current->personality) { + switch (get_personality()) { case PER_SUNOS: return SPARC_BSD_EMUL; case PER_SVR4: diff --git a/include/asm-sparc64/elf.h b/include/asm-sparc64/elf.h index 11c8e68..2140dbe 100644 --- a/include/asm-sparc64/elf.h +++ b/include/asm-sparc64/elf.h @@ -211,7 +211,7 @@ do {unsigned long new_flags = current_thread_info()->flags; \ /* flush_thread will update pgd cache */\ if (ibcs2) \ set_personality(PER_SVR4); \ - else if (current->personality != PER_LINUX32) \ + else if (get_personality() != PER_LINUX32) \ set_personality(PER_LINUX); \ } while (0) diff --git a/include/asm-sparc64/namei.h b/include/asm-sparc64/namei.h index ccda19e..e6a1dd9 100644 --- a/include/asm-sparc64/namei.h +++ b/include/asm-sparc64/namei.h @@ -13,7 +13,7 @@ static inline char * __emul_prefix(void) { - switch (current->personality) { + switch (get_personality()) { case PER_SUNOS: return SPARC_BSD_EMUL; case PER_SVR4: -- 1.5.3.8 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 07/16] arm: use get_personality()
Use get_personality() macro instead of explicit reference for arm code. Signed-off-by: WANG Cong <[EMAIL PROTECTED]> Cc: Russell King <[EMAIL PROTECTED]> --- arch/arm/kernel/traps.c |4 ++-- include/asm-arm/namei.h |2 +- include/asm-arm/processor.h |4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/arch/arm/kernel/traps.c b/arch/arm/kernel/traps.c index 5595fdd..975faaf 100644 --- a/arch/arm/kernel/traps.c +++ b/arch/arm/kernel/traps.c @@ -381,8 +381,8 @@ static int bad_syscall(int n, struct pt_regs *regs) struct thread_info *thread = current_thread_info(); siginfo_t info; - if (current->personality != PER_LINUX && - current->personality != PER_LINUX_32BIT && + if (get_personality() != PER_LINUX && + get_personality() != PER_LINUX_32BIT && thread->exec_domain->handler) { thread->exec_domain->handler(n, regs); return regs->ARM_r0; diff --git a/include/asm-arm/namei.h b/include/asm-arm/namei.h index a402d3b..c55dc87 100644 --- a/include/asm-arm/namei.h +++ b/include/asm-arm/namei.h @@ -14,7 +14,7 @@ static inline char *__emul_prefix(void) { - switch (current->personality) { + switch (get_personality()) { case PER_BSD: return ARM_BSD_EMUL; default: diff --git a/include/asm-arm/processor.h b/include/asm-arm/processor.h index bd8029e..7f040b4 100644 --- a/include/asm-arm/processor.h +++ b/include/asm-arm/processor.h @@ -23,7 +23,7 @@ #include #ifdef __KERNEL__ -#define STACK_TOP ((current->personality == PER_LINUX_32BIT) ? \ +#define STACK_TOP ((get_personality() == PER_LINUX_32BIT) ? \ TASK_SIZE : TASK_SIZE_26) #define STACK_TOP_MAX TASK_SIZE #endif @@ -65,7 +65,7 @@ struct thread_struct { unsigned long *stack = (unsigned long *)sp; \ set_fs(USER_DS);\ memzero(regs->uregs, sizeof(regs->uregs)); \ - if (current->personality & ADDR_LIMIT_32BIT)\ + if (get_personality() & ADDR_LIMIT_32BIT) \ regs->ARM_cpsr = USR_MODE; \ else\ regs->ARM_cpsr = USR26_MODE;\ -- 1.5.3.8 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 05/16] parisc: use get_personality()
Use get_personality() macro instead of explicit reference for parisc code. Signed-off-by: WANG Cong <[EMAIL PROTECTED]> Cc: Kyle McMartin <[EMAIL PROTECTED]> Cc: Matthew Wilcox <[EMAIL PROTECTED]> --- arch/parisc/kernel/sys_parisc.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/parisc/kernel/sys_parisc.c b/arch/parisc/kernel/sys_parisc.c index 4f58921..1515ced 100644 --- a/arch/parisc/kernel/sys_parisc.c +++ b/arch/parisc/kernel/sys_parisc.c @@ -259,7 +259,7 @@ long parisc_personality(unsigned long personality) { long err; - if (personality(current->personality) == PER_LINUX32 + if (personality(get_personality()) == PER_LINUX32 && personality == PER_LINUX) personality = PER_LINUX32; @@ -275,7 +275,7 @@ long parisc_newuname(struct new_utsname __user *name) int err = sys_newuname(name); #ifdef CONFIG_COMPAT - if (!err && personality(current->personality) == PER_LINUX32) { + if (!err && personality(get_personality()) == PER_LINUX32) { if (__put_user(0, name->machine + 6) || __put_user(0, name->machine + 7)) err = -EFAULT; -- 1.5.3.8 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 03/16] fs: use get_personality()
Use get_personality() macro instead of explicit reference. Signed-off-by: WANG Cong <[EMAIL PROTECTED]> Cc: Alexander Viro <[EMAIL PROTECTED]> --- fs/binfmt_elf.c |6 +++--- fs/compat.c |6 +++--- fs/select.c |6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c index 41a958a..1b5803f 100644 --- a/fs/binfmt_elf.c +++ b/fs/binfmt_elf.c @@ -516,7 +516,7 @@ static unsigned long randomize_stack_top(unsigned long stack_top) unsigned int random_variable = 0; if ((current->flags & PF_RANDOMIZE) && - !(current->personality & ADDR_NO_RANDOMIZE)) { + !(get_personality() & ADDR_NO_RANDOMIZE)) { random_variable = get_random_int() & STACK_RND_MASK; random_variable <<= PAGE_SHIFT; } @@ -744,7 +744,7 @@ static int load_elf_binary(struct linux_binprm *bprm, struct pt_regs *regs) if (elf_read_implies_exec(loc->elf_ex, executable_stack)) current->personality |= READ_IMPLIES_EXEC; - if (!(current->personality & ADDR_NO_RANDOMIZE) && randomize_va_space) + if (!(get_personality() & ADDR_NO_RANDOMIZE) && randomize_va_space) current->flags |= PF_RANDOMIZE; arch_pick_mmap_layout(current->mm); @@ -969,7 +969,7 @@ static int load_elf_binary(struct linux_binprm *bprm, struct pt_regs *regs) arch_randomize_brk(current->mm); #endif - if (current->personality & MMAP_PAGE_ZERO) { + if (get_personality() & MMAP_PAGE_ZERO) { /* Why this, you ask??? Well SVr4 maps page 0 as read-only, and some applications "depend" upon this behavior. Since we do not have the power to recompile these, we diff --git a/fs/compat.c b/fs/compat.c index 2ce4456..eefe23b 100644 --- a/fs/compat.c +++ b/fs/compat.c @@ -1610,7 +1610,7 @@ asmlinkage long compat_sys_select(int n, compat_ulong_t __user *inp, if (tvp) { struct compat_timeval rtv; - if (current->personality & STICKY_TIMEOUTS) + if (get_personality() & STICKY_TIMEOUTS) goto sticky; rtv.tv_usec = jiffies_to_usecs(do_div((*(u64*)&timeout), HZ)); rtv.tv_sec = timeout; @@ -1685,7 +1685,7 @@ asmlinkage long compat_sys_pselect7(int n, compat_ulong_t __user *inp, if (tsp) { struct compat_timespec rts; - if (current->personality & STICKY_TIMEOUTS) + if (get_personality() & STICKY_TIMEOUTS) goto sticky; rts.tv_sec = timeout / HZ; @@ -1800,7 +1800,7 @@ asmlinkage long compat_sys_ppoll(struct pollfd __user *ufds, if (tsp && timeout >= 0) { struct compat_timespec rts; - if (current->personality & STICKY_TIMEOUTS) + if (get_personality() & STICKY_TIMEOUTS) goto sticky; /* Yes, we know it's actually an s64, but it's also positive. */ rts.tv_nsec = jiffies_to_usecs(do_div((*(u64*)&timeout), HZ)) * diff --git a/fs/select.c b/fs/select.c index 5633fe9..6041e24 100644 --- a/fs/select.c +++ b/fs/select.c @@ -401,7 +401,7 @@ asmlinkage long sys_select(int n, fd_set __user *inp, fd_set __user *outp, if (tvp) { struct timeval rtv; - if (current->personality & STICKY_TIMEOUTS) + if (get_personality() & STICKY_TIMEOUTS) goto sticky; rtv.tv_usec = jiffies_to_usecs(do_div((*(u64*)&timeout), HZ)); rtv.tv_sec = timeout; @@ -467,7 +467,7 @@ asmlinkage long sys_pselect7(int n, fd_set __user *inp, fd_set __user *outp, if (tsp) { struct timespec rts; - if (current->personality & STICKY_TIMEOUTS) + if (get_personality() & STICKY_TIMEOUTS) goto sticky; rts.tv_nsec = jiffies_to_usecs(do_div((*(u64*)&timeout), HZ)) * 1000; @@ -814,7 +814,7 @@ asmlinkage long sys_ppoll(struct pollfd __user *ufds, unsigned int nfds, if (tsp && timeout >= 0) { struct timespec rts; - if (current->personality & STICKY_TIMEOUTS) + if (get_personality() & STICKY_TIMEOUTS) goto sticky; /* Yes, we know it's actually an s64, but it's also positive. */ rts.tv_nsec = jiffies_to_usecs(do_div((*(u64*)&timeout), HZ)) * -- 1.5.3.8 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 04/16] powerpc: use get_personality()
Use get_personality() macro instead of explicit reference for powerpc code. Signed-off-by: WANG Cong <[EMAIL PROTECTED]> Cc: Christoph Hellwig <[EMAIL PROTECTED]> Cc: Paul Mackerras <[EMAIL PROTECTED]> --- arch/powerpc/kernel/syscalls.c |4 ++-- arch/powerpc/mm/mmap.c |2 +- include/asm-powerpc/elf.h |2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/powerpc/kernel/syscalls.c b/arch/powerpc/kernel/syscalls.c index 3b1d5dd..4b910b8 100644 --- a/arch/powerpc/kernel/syscalls.c +++ b/arch/powerpc/kernel/syscalls.c @@ -228,7 +228,7 @@ long ppc64_personality(unsigned long personality) { long ret; - if (personality(current->personality) == PER_LINUX32 + if (personality(get_personality()) == PER_LINUX32 && personality == PER_LINUX) personality = PER_LINUX32; ret = sys_personality(personality); @@ -239,7 +239,7 @@ long ppc64_personality(unsigned long personality) #endif #ifdef CONFIG_PPC64 -#define OVERRIDE_MACHINE(personality(current->personality) == PER_LINUX32) +#define OVERRIDE_MACHINE(personality(get_personality()) == PER_LINUX32) #else #define OVERRIDE_MACHINE0 #endif diff --git a/arch/powerpc/mm/mmap.c b/arch/powerpc/mm/mmap.c index 86010fc..92a9e45 100644 --- a/arch/powerpc/mm/mmap.c +++ b/arch/powerpc/mm/mmap.c @@ -54,7 +54,7 @@ static inline int mmap_is_legacy(void) if (!test_thread_flag(TIF_32BIT)) return 1; - if (current->personality & ADDR_COMPAT_LAYOUT) + if (get_personality() & ADDR_COMPAT_LAYOUT) return 1; if (current->signal->rlim[RLIMIT_STACK].rlim_cur == RLIM_INFINITY) diff --git a/include/asm-powerpc/elf.h b/include/asm-powerpc/elf.h index 9080d85..d9e7bff 100644 --- a/include/asm-powerpc/elf.h +++ b/include/asm-powerpc/elf.h @@ -256,7 +256,7 @@ do { \ set_thread_flag(TIF_ABI_PENDING); \ else\ clear_thread_flag(TIF_ABI_PENDING); \ - if (personality(current->personality) != PER_LINUX32) \ + if (personality(get_personality()) != PER_LINUX32) \ set_personality(PER_LINUX); \ } while (0) /* -- 1.5.3.8 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 02/16] mm: use get_personality()
Use get_personality() macro instead of explicit reference for mm/ code. Signed-off-by: WANG Cong <[EMAIL PROTECTED]> Cc: Christoph Hellwig <[EMAIL PROTECTED]> Cc: Christoph Lameter <[EMAIL PROTECTED]> --- mm/mmap.c |2 +- mm/mprotect.c |2 +- mm/nommu.c|4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/mm/mmap.c b/mm/mmap.c index a32d28c..42d647f 100644 --- a/mm/mmap.c +++ b/mm/mmap.c @@ -910,7 +910,7 @@ unsigned long do_mmap_pgoff(struct file * file, unsigned long addr, * (the exception is when the underlying filesystem is noexec * mounted, in which case we dont add PROT_EXEC.) */ - if ((prot & PROT_READ) && (current->personality & READ_IMPLIES_EXEC)) + if ((prot & PROT_READ) && (get_personality() & READ_IMPLIES_EXEC)) if (!(file && (file->f_path.mnt->mnt_flags & MNT_NOEXEC))) prot |= PROT_EXEC; diff --git a/mm/mprotect.c b/mm/mprotect.c index 4de5468..620b8db 100644 --- a/mm/mprotect.c +++ b/mm/mprotect.c @@ -237,7 +237,7 @@ sys_mprotect(unsigned long start, size_t len, unsigned long prot) /* * Does the application expect PROT_READ to imply PROT_EXEC: */ - if ((prot & PROT_READ) && (current->personality & READ_IMPLIES_EXEC)) + if ((prot & PROT_READ) && (get_personality() & READ_IMPLIES_EXEC)) prot |= PROT_EXEC; vm_flags = calc_vm_prot_bits(prot); diff --git a/mm/nommu.c b/mm/nommu.c index 5d8ae08..a1c6162 100644 --- a/mm/nommu.c +++ b/mm/nommu.c @@ -665,7 +665,7 @@ static int validate_mmap_request(struct file *file, } else if ((prot & PROT_READ) && !(prot & PROT_EXEC)) { /* handle implication of PROT_EXEC by PROT_READ */ - if (current->personality & READ_IMPLIES_EXEC) { + if (get_personality() & READ_IMPLIES_EXEC) { if (capabilities & BDI_CAP_EXEC_MAP) prot |= PROT_EXEC; } @@ -686,7 +686,7 @@ static int validate_mmap_request(struct file *file, /* handle PROT_EXEC implication by PROT_READ */ if ((prot & PROT_READ) && - (current->personality & READ_IMPLIES_EXEC)) + (get_personality() & READ_IMPLIES_EXEC)) prot |= PROT_EXEC; } -- 1.5.3.8 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 01/16] Make the macro get_personality function-like.
This patch makes the macro get_personality function-like. Signed-off-by: WANG Cong <[EMAIL PROTECTED]> Cc: Christoph Hellwig <[EMAIL PROTECTED]> Cc: Bryan Wu <[EMAIL PROTECTED]> Cc: David Howells <[EMAIL PROTECTED]> --- arch/blackfin/kernel/signal.c |2 +- arch/frv/kernel/signal.c |4 ++-- include/linux/personality.h |2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/blackfin/kernel/signal.c b/arch/blackfin/kernel/signal.c index 5564c95..f3ef4ee 100644 --- a/arch/blackfin/kernel/signal.c +++ b/arch/blackfin/kernel/signal.c @@ -224,7 +224,7 @@ setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t * info, /* Set up registers for signal handler */ wrusp((unsigned long)frame); - if (get_personality & FDPIC_FUNCPTRS) { + if (get_personality() & FDPIC_FUNCPTRS) { struct fdpic_func_descriptor __user *funcptr = (struct fdpic_func_descriptor *) ka->sa.sa_handler; __get_user(regs->pc, &funcptr->text); diff --git a/arch/frv/kernel/signal.c b/arch/frv/kernel/signal.c index d64bcaf..7e4405d 100644 --- a/arch/frv/kernel/signal.c +++ b/arch/frv/kernel/signal.c @@ -297,7 +297,7 @@ static int setup_frame(int sig, struct k_sigaction *ka, sigset_t *set) __frame->lr = (unsigned long) &frame->retcode; __frame->gr8 = sig; - if (get_personality & FDPIC_FUNCPTRS) { + if (get_personality() & FDPIC_FUNCPTRS) { struct fdpic_func_descriptor __user *funcptr = (struct fdpic_func_descriptor __user *) ka->sa.sa_handler; __get_user(__frame->pc, &funcptr->text); @@ -396,7 +396,7 @@ static int setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, __frame->gr8 = sig; __frame->gr9 = (unsigned long) &frame->info; - if (get_personality & FDPIC_FUNCPTRS) { + if (get_personality() & FDPIC_FUNCPTRS) { struct fdpic_func_descriptor __user *funcptr = (struct fdpic_func_descriptor __user *) ka->sa.sa_handler; __get_user(__frame->pc, &funcptr->text); diff --git a/include/linux/personality.h b/include/linux/personality.h index 012cd55..1891b31 100644 --- a/include/linux/personality.h +++ b/include/linux/personality.h @@ -108,7 +108,7 @@ struct exec_domain { /* * Personality of the currently running process. */ -#define get_personality(current->personality) +#define get_personality() (current->personality) /* * Change personality of the currently running process. -- 1.5.3.8 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 00/16] (Resend) Use get_personality()
This patchset makes the macro get_personality function alike and teaches code to use get_personality() instead of explicit reference. [I am sorry if you've received multiple copied of this, since my git-send-email doesn't work well. ] Signed-off-by: WANG Cong <[EMAIL PROTECTED]> -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 09/16] um: use get_personality()
From: Jeff Dike <[EMAIL PROTECTED]> Subject: Re: [PATCH 09/16] um: use get_personality() Date: Wed, 20 Feb 2008 11:27:34 -0500 Message-ID: <[EMAIL PROTECTED]> > On Wed, Feb 20, 2008 at 07:19:13PM +0800, WANG Cong wrote: > > Signed-off-by: WANG Cong <[EMAIL PROTECTED]> > > Looks good - you should add some sort of changelog though. > Thanks, Jeff. It seems that you're the only one who received this patchset of mine. And I found that lkml.org didn't receive these neither. ;( I don't know if Andrew received all of them, if not, I must resend. Regards. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[Patch]net/xfrm/xfrm_state.c: replace timer with delayed_work
Also suggested by Herbert Xu, using workqueue is better than timer for net/xfrm/xfrm_state.c, so replace them with delayed_work. Note that, this patch is not fully tested, just compile and run as a whole on an Intel Core Duo matchine. So should be in -mm first. Signed-off-by: WANG Cong <[EMAIL PROTECTED]> Cc: Herbert Xu <[EMAIL PROTECTED]> Cc: David Miller <[EMAIL PROTECTED]> --- diff --git a/include/net/xfrm.h b/include/net/xfrm.h index ac72116..ff718b4 100644 --- a/include/net/xfrm.h +++ b/include/net/xfrm.h @@ -188,14 +188,14 @@ struct xfrm_state u32 replay_maxage; u32 replay_maxdiff; - /* Replay detection notification timer */ - struct timer_list rtimer; + /* Replay detection notification delayed work */ + struct delayed_work rwork; /* Statistics */ struct xfrm_stats stats; struct xfrm_lifetime_cur curlft; - struct timer_list timer; + struct delayed_work work; /* Last used time */ unsigned long lastused; diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c index 7ba65e8..e0511c9 100644 --- a/net/xfrm/xfrm_state.c +++ b/net/xfrm/xfrm_state.c @@ -379,8 +379,8 @@ static void xfrm_put_mode(struct xfrm_mode *mode) static void xfrm_state_gc_destroy(struct xfrm_state *x) { - del_timer_sync(&x->timer); - del_timer_sync(&x->rtimer); + cancel_delayed_work_sync(&x->work); + cancel_delayed_work_sync(&x->rwork); kfree(x->aalg); kfree(x->ealg); kfree(x->calg); @@ -423,9 +423,10 @@ static inline unsigned long make_jiffies(long secs) return secs*HZ; } -static void xfrm_timer_handler(unsigned long data) +static void xfrm_work_handler(struct work_struct *w) { - struct xfrm_state *x = (struct xfrm_state*)data; + struct xfrm_state *x = + container_of((struct delayed_work *)w, struct xfrm_state, work); unsigned long now = get_seconds(); long next = LONG_MAX; int warn = 0; @@ -476,7 +477,7 @@ static void xfrm_timer_handler(unsigned long data) km_state_expired(x, 0, 0); resched: if (next != LONG_MAX) - mod_timer(&x->timer, jiffies + make_jiffies(next)); + schedule_delayed_work(&x->work, make_jiffies(next)); goto out; @@ -499,7 +500,7 @@ out: spin_unlock(&x->lock); } -static void xfrm_replay_timer_handler(unsigned long data); +static void xfrm_replay_work_handler(struct work_struct *); struct xfrm_state *xfrm_state_alloc(void) { @@ -513,9 +514,8 @@ struct xfrm_state *xfrm_state_alloc(void) INIT_HLIST_NODE(&x->bydst); INIT_HLIST_NODE(&x->bysrc); INIT_HLIST_NODE(&x->byspi); - setup_timer(&x->timer, xfrm_timer_handler, (unsigned long)x); - setup_timer(&x->rtimer, xfrm_replay_timer_handler, - (unsigned long)x); + INIT_DELAYED_WORK(&x->work, xfrm_work_handler); + INIT_DELAYED_WORK(&x->rwork, xfrm_replay_work_handler); x->curlft.add_time = get_seconds(); x->lft.soft_byte_limit = XFRM_INF; x->lft.soft_packet_limit = XFRM_INF; @@ -851,8 +851,7 @@ xfrm_state_find(xfrm_address_t *daddr, xfrm_address_t *saddr, hlist_add_head(&x->byspi, xfrm_state_byspi+h); } x->lft.hard_add_expires_seconds = sysctl_xfrm_acq_expires; - x->timer.expires = jiffies + sysctl_xfrm_acq_expires*HZ; - add_timer(&x->timer); + schedule_delayed_work(&x->work, sysctl_xfrm_acq_expires*HZ); xfrm_state_num++; xfrm_hash_grow_check(x->bydst.next != NULL); } else { @@ -923,9 +922,9 @@ static void __xfrm_state_insert(struct xfrm_state *x) hlist_add_head(&x->byspi, xfrm_state_byspi+h); } - mod_timer(&x->timer, jiffies + HZ); + schedule_delayed_work(&x->work, HZ); if (x->replay_maxage) - mod_timer(&x->rtimer, jiffies + x->replay_maxage); + schedule_delayed_work(&x->rwork, x->replay_maxage); wake_up(&km_waitq); @@ -1034,8 +1033,7 @@ static struct xfrm_state *__find_acq_core(unsigned short family, u8 mode, u32 re x->props.reqid = reqid; x->lft.hard_add_expires_seconds = sysctl_xfrm_acq_expires; xfrm_state_hold(x); - x->timer.expires = jiffies + sysctl_xfrm_acq_expires*HZ; - add_timer(&x->timer); + schedule_dela
[Patch]net/xfrm/xfrm_policy.c: replace timer with delayed_work
As suggested by Herbert, using workqueue is better than timer for net/xfrm/xfrm_policy.c, so replace them with delayed_work. Note that, this patch is not fully tested, just compile and run as a whole on an Intel Core Duo matchine. So should be in -mm first. Signed-off-by: WANG Cong <[EMAIL PROTECTED]> Cc: Herbert Xu <[EMAIL PROTECTED]> Cc: David Miller <[EMAIL PROTECTED]> --- diff --git a/include/net/xfrm.h b/include/net/xfrm.h index ac72116..53f4794 100644 --- a/include/net/xfrm.h +++ b/include/net/xfrm.h @@ -430,7 +430,7 @@ struct xfrm_policy /* This lock only affects elements except for entry. */ rwlock_tlock; atomic_trefcnt; - struct timer_list timer; + struct delayed_work work; u32 priority; u32 index; diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c index 47219f9..58066f0 100644 --- a/net/xfrm/xfrm_policy.c +++ b/net/xfrm/xfrm_policy.c @@ -126,9 +126,10 @@ static inline unsigned long make_jiffies(long secs) return secs*HZ; } -static void xfrm_policy_timer(unsigned long data) +static void xfrm_policy_worker(struct work_struct *w) { - struct xfrm_policy *xp = (struct xfrm_policy*)data; + struct xfrm_policy *xp = + container_of((struct delayed_work *)w, struct xfrm_policy, work); unsigned long now = get_seconds(); long next = LONG_MAX; int warn = 0; @@ -181,7 +182,7 @@ static void xfrm_policy_timer(unsigned long data) if (warn) km_policy_expired(xp, dir, 0, 0); if (next != LONG_MAX && - !mod_timer(&xp->timer, jiffies + make_jiffies(next))) + !schedule_delayed_work(&xp->work, make_jiffies(next))) xfrm_pol_hold(xp); out: @@ -208,12 +209,11 @@ struct xfrm_policy *xfrm_policy_alloc(gfp_t gfp) policy = kzalloc(sizeof(struct xfrm_policy), gfp); if (policy) { + INIT_DELAYED_WORK(&policy->work, xfrm_policy_worker); INIT_HLIST_NODE(&policy->bydst); INIT_HLIST_NODE(&policy->byidx); rwlock_init(&policy->lock); atomic_set(&policy->refcnt, 1); - setup_timer(&policy->timer, xfrm_policy_timer, - (unsigned long)policy); } return policy; } @@ -227,7 +227,7 @@ void xfrm_policy_destroy(struct xfrm_policy *policy) BUG_ON(policy->bundles); - if (del_timer(&policy->timer)) + if (cancel_delayed_work(&policy->work)) BUG(); security_xfrm_policy_free(policy); @@ -244,7 +244,7 @@ static void xfrm_policy_gc_kill(struct xfrm_policy *policy) dst_free(dst); } - if (del_timer(&policy->timer)) + if (cancel_delayed_work(&policy->work)) atomic_dec(&policy->refcnt); if (atomic_read(&policy->refcnt) > 1) @@ -566,7 +566,7 @@ int xfrm_policy_insert(int dir, struct xfrm_policy *policy, int excl) hlist_add_head(&policy->byidx, xfrm_policy_byidx+idx_hash(policy->index)); policy->curlft.add_time = get_seconds(); policy->curlft.use_time = 0; - if (!mod_timer(&policy->timer, jiffies + HZ)) + if (!schedule_delayed_work(&policy->work, HZ)) xfrm_pol_hold(policy); write_unlock_bh(&xfrm_policy_lock); -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [Patch] Fix shadowed variables in fs/binfmt_elf.c
From: Andrew Morton <[EMAIL PROTECTED]> Subject: Re: [Patch] Fix shadowed variables in fs/binfmt_elf.c Date: Fri, 15 Feb 2008 12:34:59 -0800 Message-ID: <[EMAIL PROTECTED]> > On Fri, 15 Feb 2008 21:58:02 +0800 (CST) > WANG Cong <[EMAIL PROTECTED]> wrote: > > > > > Fix these sparse warings: > > fs/binfmt_elf.c:1749:29: warning: symbol 'tmp' shadows an earlier one > > fs/binfmt_elf.c:1734:28: originally declared here > > fs/binfmt_elf.c:2009:26: warning: symbol 'vma' shadows an earlier one > > fs/binfmt_elf.c:1892:24: originally declared here > > > > Signed-off-by: WANG Cong <[EMAIL PROTECTED]> > > > > --- > > diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c > > index 41a958a..6562563 100644 > > --- a/fs/binfmt_elf.c > > +++ b/fs/binfmt_elf.c > > @@ -1746,11 +1746,11 @@ static int fill_note_info(struct elfhdr *elf, int > > phdrs, > > while_each_thread(g, p); > > rcu_read_unlock(); > > list_for_each(t, &info->thread_list) { > > - struct elf_thread_status *tmp; > > + struct elf_thread_status *temp; > > int sz; > > > > - tmp = list_entry(t, struct elf_thread_status, list); > > - sz = elf_dump_thread_status(signr, tmp); > > + temp = list_entry(t, struct elf_thread_status, list); > > + sz = elf_dump_thread_status(signr, temp); > > info->thread_status_size += sz; > > } > > } > > `tmp' is an awful identifier, and renaming it to "temp" hardly improves it. > Please take any opportunity to fix this sort of thing. > > I chose "ets" which is a bit weird but once one understand what it means, > it makes the code much easier to follow. > > Also used the same local for both loops. There seems little point in > instantiating a second one. I agree. The first 'tmp' you showed is really not good, 'ets' is better. Thanks, Andrew! -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[Patch] arch/um/kernel/um_arch.c: some small improvements
Make some small improvements for arch/um/kernel/um_arch.c. Signed-off-by: WANG Cong <[EMAIL PROTECTED]> Cc: Jeff Dike <[EMAIL PROTECTED]> --- diff --git a/arch/um/kernel/um_arch.c b/arch/um/kernel/um_arch.c index a6c1dd1..56deed6 100644 --- a/arch/um/kernel/um_arch.c +++ b/arch/um/kernel/um_arch.c @@ -115,7 +115,7 @@ static int have_root __initdata = 0; /* Set in uml_mem_setup and modified in linux_main */ long long physmem_size = 32 * 1024 * 1024; -static char *usage_string = +static const char *usage_string = "User Mode Linux v%s\n" " available at http://user-mode-linux.sourceforge.net/\n\n";; @@ -202,7 +202,7 @@ static void __init uml_checksetup(char *line, int *add) p = &__uml_setup_start; while (p < &__uml_setup_end) { - int n; + size_t n; n = strlen(p->str); if (!strncmp(line, p->str, n) && p->setup_func(line + n, add)) @@ -258,7 +258,8 @@ int __init linux_main(int argc, char **argv) { unsigned long avail, diff; unsigned long virtmem_size, max_physmem; - unsigned int i, add; + unsigned int i; + int add; char * mode; for (i = 1; i < argc; i++) { -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[Patch] Fix shadowed variables in fs/binfmt_elf.c
Fix these sparse warings: fs/binfmt_elf.c:1749:29: warning: symbol 'tmp' shadows an earlier one fs/binfmt_elf.c:1734:28: originally declared here fs/binfmt_elf.c:2009:26: warning: symbol 'vma' shadows an earlier one fs/binfmt_elf.c:1892:24: originally declared here Signed-off-by: WANG Cong <[EMAIL PROTECTED]> --- diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c index 41a958a..6562563 100644 --- a/fs/binfmt_elf.c +++ b/fs/binfmt_elf.c @@ -1746,11 +1746,11 @@ static int fill_note_info(struct elfhdr *elf, int phdrs, while_each_thread(g, p); rcu_read_unlock(); list_for_each(t, &info->thread_list) { - struct elf_thread_status *tmp; + struct elf_thread_status *temp; int sz; - tmp = list_entry(t, struct elf_thread_status, list); - sz = elf_dump_thread_status(signr, tmp); + temp = list_entry(t, struct elf_thread_status, list); + sz = elf_dump_thread_status(signr, temp); info->thread_status_size += sz; } } @@ -2006,10 +2006,10 @@ static int elf_core_dump(long signr, struct pt_regs *regs, struct file *file, un for (addr = vma->vm_start; addr < end; addr += PAGE_SIZE) { struct page *page; - struct vm_area_struct *vma; + struct vm_area_struct *tmp_vma; if (get_user_pages(current, current->mm, addr, 1, 0, 1, - &page, &vma) <= 0) { + &page, &tmp_vma) <= 0) { DUMP_SEEK(PAGE_SIZE); } else { if (page == ZERO_PAGE(0)) { @@ -2019,7 +2019,7 @@ static int elf_core_dump(long signr, struct pt_regs *regs, struct file *file, un } } else { void *kaddr; - flush_cache_page(vma, addr, + flush_cache_page(tmp_vma, addr, page_to_pfn(page)); kaddr = kmap(page); if ((size += PAGE_SIZE) > limit || -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[Patch] Fix shadowed variables in kernel/posix-cpu-timers.c
Fix sparse warnings like this: kernel/posix-cpu-timers.c:1090:25: warning: symbol 't' shadows an earlier one kernel/posix-cpu-timers.c:1058:21: originally declared here Signed-off-by: WANG Cong <[EMAIL PROTECTED]> Cc: Thomas Gleixner <[EMAIL PROTECTED]> --- diff --git a/kernel/posix-cpu-timers.c b/kernel/posix-cpu-timers.c index 2eae91f..ae5c6c1 100644 --- a/kernel/posix-cpu-timers.c +++ b/kernel/posix-cpu-timers.c @@ -1087,45 +1087,45 @@ static void check_process_timers(struct task_struct *tsk, maxfire = 20; prof_expires = cputime_zero; while (!list_empty(timers)) { - struct cpu_timer_list *t = list_first_entry(timers, + struct cpu_timer_list *tl = list_first_entry(timers, struct cpu_timer_list, entry); - if (!--maxfire || cputime_lt(ptime, t->expires.cpu)) { - prof_expires = t->expires.cpu; + if (!--maxfire || cputime_lt(ptime, tl->expires.cpu)) { + prof_expires = tl->expires.cpu; break; } - t->firing = 1; - list_move_tail(&t->entry, firing); + tl->firing = 1; + list_move_tail(&tl->entry, firing); } ++timers; maxfire = 20; virt_expires = cputime_zero; while (!list_empty(timers)) { - struct cpu_timer_list *t = list_first_entry(timers, + struct cpu_timer_list *tl = list_first_entry(timers, struct cpu_timer_list, entry); - if (!--maxfire || cputime_lt(utime, t->expires.cpu)) { - virt_expires = t->expires.cpu; + if (!--maxfire || cputime_lt(utime, tl->expires.cpu)) { + virt_expires = tl->expires.cpu; break; } - t->firing = 1; - list_move_tail(&t->entry, firing); + tl->firing = 1; + list_move_tail(&tl->entry, firing); } ++timers; maxfire = 20; sched_expires = 0; while (!list_empty(timers)) { - struct cpu_timer_list *t = list_first_entry(timers, + struct cpu_timer_list *tl = list_first_entry(timers, struct cpu_timer_list, entry); - if (!--maxfire || sum_sched_runtime < t->expires.sched) { - sched_expires = t->expires.sched; + if (!--maxfire || sum_sched_runtime < tl->expires.sched) { + sched_expires = tl->expires.sched; break; } - t->firing = 1; - list_move_tail(&t->entry, firing); + tl->firing = 1; + list_move_tail(&tl->entry, firing); } /* -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[-mm Patch] arch/um/kernel/initrd.c: fix a missed conversion specifier
Fix a missed conversion specifier of a printk in arch/um/kernel/initrd.c. Signed-off-by: WANG Cong <[EMAIL PROTECTED]> Cc: Jeff Dike <[EMAIL PROTECTED]> --- Index: linux/arch/um/kernel/initrd.c === --- linux.orig/arch/um/kernel/initrd.c +++ linux/arch/um/kernel/initrd.c @@ -32,7 +32,7 @@ static int __init read_initrd(void) * ask for no memory. */ if (size == 0) { - printk(KERN_ERR "\"%\" is a zero-size initrd\n"); + printk(KERN_ERR "\"%s\" is a zero-size initrd\n", initrd); return 0; } -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[-mm Patch] arch/um/kernel/mem.c: fix a shadowed variable
Fix a shadowed variable in arch/um/kernel/mem.c, since there is a global variable has the same name. Cc: Jeff Dike <[EMAIL PROTECTED]> Signed-off-by: WANG Cong <[EMAIL PROTECTED]> --- Index: linux/arch/um/kernel/mem.c === --- linux.orig/arch/um/kernel/mem.c +++ linux/arch/um/kernel/mem.c @@ -299,7 +299,7 @@ void show_mem(void) { int pfn, total = 0, reserved = 0; int shared = 0, cached = 0; - int highmem = 0; + int high_mem = 0; struct page *page; printk(KERN_INFO "Mem-info:\n"); @@ -311,7 +311,7 @@ void show_mem(void) page = pfn_to_page(pfn); total++; if (PageHighMem(page)) - highmem++; + high_mem++; if (PageReserved(page)) reserved++; else if (PageSwapCache(page)) @@ -320,7 +320,7 @@ void show_mem(void) shared += page_count(page) - 1; } printk(KERN_INFO "%d pages of RAM\n", total); - printk(KERN_INFO "%d pages of HIGHMEM\n", highmem); + printk(KERN_INFO "%d pages of HIGHMEM\n", high_mem); printk(KERN_INFO "%d reserved pages\n", reserved); printk(KERN_INFO "%d pages shared\n", shared); printk(KERN_INFO "%d pages swap cached\n", cached); -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [Patch] mm: fix a section mismatch warning
On Thu, Jan 31, 2008 at 07:38:53PM +0100, Sam Ravnborg wrote: >Hi WANG. > >On Fri, Feb 01, 2008 at 01:25:17AM +0800, WANG Cong wrote: >> >> This patch fix this mismatch warning from mm: >> >> WARNING: vmlinux.o(.meminit.text+0x37f): Section mismatch in reference from >> the function free_area_init_core() to the function .init.text:setup_usemap() >> modpost: Found 1 section mismatch(es). >> >> Cc: Sam Ravnborg <[EMAIL PROTECTED]> >> Signed-off-by: WANG Cong <[EMAIL PROTECTED]> >> >> --- >> >> diff --git a/mm/page_alloc.c b/mm/page_alloc.c >> index b2838c2..8a9ae3c 100644 >> --- a/mm/page_alloc.c >> +++ b/mm/page_alloc.c >> @@ -3321,7 +3321,7 @@ static inline int pageblock_default_order(unsigned int >> order) >> * - mark all memory queues empty >> * - clear the memory bitmaps >> */ >> -static void __meminit free_area_init_core(struct pglist_data *pgdat, >> +static void __init free_area_init_core(struct pglist_data *pgdat, >> unsigned long *zones_size, unsigned long *zholes_size) >> { >> enum zone_type j; >> @@ -3445,7 +3445,7 @@ static void __init_refok alloc_node_mem_map(struct >> pglist_data *pgdat) >> #endif /* CONFIG_FLAT_NODE_MEM_MAP */ >> } >> >> -void __meminit free_area_init_node(int nid, struct pglist_data *pgdat, >> +void __init free_area_init_node(int nid, struct pglist_data *pgdat, >This change make me a bit unnerved. HAve you checked all callers? >I simple grep shows 46 hits in the tree. I use cscope to do the check. ;) free_area_init_node is the only caller of free_area_init_core, but free_area_init_node has more than one callers that didn't mark __init/__meminit. > >It is always good to explain why the change you do is OK, >for no other reasons than to show you really thought it through. OK. Thanks. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [Patch] include/asm-generic/tlb.h: fix a missing header
On Thu, Jan 31, 2008 at 02:08:31PM -0800, Christoph Lameter wrote: >On Thu, 31 Jan 2008, WANG Cong wrote: > >> index 6ce9f3a..4ebbe15 100644 >> --- a/include/asm-generic/tlb.h >> +++ b/include/asm-generic/tlb.h >> @@ -16,6 +16,7 @@ >> #include >> #include >> #include >> +#include > >Please also remove the #include . It should have been >part of >a patch >reversal. Please ignore this patch, since Ingo already had the same one. Thanks! -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[Patch] mm: fix a section mismatch warning
This patch fix this mismatch warning from mm: WARNING: vmlinux.o(.meminit.text+0x37f): Section mismatch in reference from the function free_area_init_core() to the function .init.text:setup_usemap() modpost: Found 1 section mismatch(es). Cc: Sam Ravnborg <[EMAIL PROTECTED]> Signed-off-by: WANG Cong <[EMAIL PROTECTED]> --- diff --git a/mm/page_alloc.c b/mm/page_alloc.c index b2838c2..8a9ae3c 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -3321,7 +3321,7 @@ static inline int pageblock_default_order(unsigned int order) * - mark all memory queues empty * - clear the memory bitmaps */ -static void __meminit free_area_init_core(struct pglist_data *pgdat, +static void __init free_area_init_core(struct pglist_data *pgdat, unsigned long *zones_size, unsigned long *zholes_size) { enum zone_type j; @@ -3445,7 +3445,7 @@ static void __init_refok alloc_node_mem_map(struct pglist_data *pgdat) #endif /* CONFIG_FLAT_NODE_MEM_MAP */ } -void __meminit free_area_init_node(int nid, struct pglist_data *pgdat, +void __init free_area_init_node(int nid, struct pglist_data *pgdat, unsigned long *zones_size, unsigned long node_start_pfn, unsigned long *zholes_size) { -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [git pull] x86 arch updates for v2.6.25
On Thu, Jan 31, 2008 at 05:15:23PM +0100, Ingo Molnar wrote: > >* Adrian Bunk <[EMAIL PROTECTED]> wrote: > >> On Thu, Jan 31, 2008 at 05:00:33PM +0100, Ingo Molnar wrote: >> > >> > * Adrian Bunk <[EMAIL PROTECTED]> wrote: >> > >> > > You tested x86 but broke more than half a dozen other archtectures, >> > > with at least 3 different commits breaking other architectures. >> > >> > Note that all known breakages are fixed in current -git, except for the >> > s390 problem that Martin/Nick posted the fix. >> >> What about the breakages caused by commit >> a5a19c63f4e55e32dc0bc3d936d7f94793d8b380 (this commit broke the >> defconfig compilation on at least avr32, blackfin, sh, sparc and uml)? > >the patch below fixes that. > I just send the same patch[1] minutes ago. ;-) 1. http://lkml.org/lkml/2008/1/31/223 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[git Patch] UML: a build error fix
This patch fixed this error: arch/um/kernel/skas/syscall.c: In function 'handle_syscall': arch/um/kernel/skas/syscall.c:33: error: 'NR_syscalls' undeclared (first use in this function) arch/um/kernel/skas/syscall.c:33: error: (Each undeclared identifier is reported only once arch/um/kernel/skas/syscall.c:33: error: for each function it appears in.) make[2]: *** [arch/um/kernel/skas/syscall.o] Error 1 make[1]: *** [arch/um/kernel/skas] Error 2 make: *** [arch/um/kernel] Error 2 Cc: Jeff Dike <[EMAIL PROTECTED]> Signed-off-by: WANG Cong <[EMAIL PROTECTED]> --- diff --git a/arch/um/include/sysdep-i386/kernel-offsets.h b/arch/um/include/sysdep-i386/kernel-offsets.h index 5868526..da820d2 100644 --- a/arch/um/include/sysdep-i386/kernel-offsets.h +++ b/arch/um/include/sysdep-i386/kernel-offsets.h @@ -15,7 +15,11 @@ #define OFFSET(sym, str, mem) \ DEFINE(sym, offsetof(struct str, mem)); +static char syscalls[] = { +#include +}; void foo(void) { #include +DEFINE(UM_NR_syscall_max, sizeof(syscalls) - 1); } diff --git a/arch/um/include/sysdep-i386/syscalls.h b/arch/um/include/sysdep-i386/syscalls.h index 57bd79e..fb1fd94 100644 --- a/arch/um/include/sysdep-i386/syscalls.h +++ b/arch/um/include/sysdep-i386/syscalls.h @@ -5,6 +5,7 @@ #include "asm/unistd.h" #include "sysdep/ptrace.h" +#include "kern_constants.h" typedef long syscall_handler_t(struct pt_regs); @@ -23,3 +24,6 @@ extern syscall_handler_t *sys_call_table[]; extern long sys_mmap2(unsigned long addr, unsigned long len, unsigned long prot, unsigned long flags, unsigned long fd, unsigned long pgoff); + +#define NR_syscalls (UM_NR_syscall_max + 1) + -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[Patch] arch/um/include/init.h: Fix missing macro definitions
This patch fixed the following build error in current -git tree. arch/um/kernel/config.c:10: error: expected declaration specifiers or '...' before '.' token ... Cc: Jeff Dike <[EMAIL PROTECTED]> Signed-off-by: WANG Cong <[EMAIL PROTECTED]> --- diff --git a/arch/um/include/init.h b/arch/um/include/init.h index cebc6ca..70982e1 100644 --- a/arch/um/include/init.h +++ b/arch/um/include/init.h @@ -40,6 +40,18 @@ typedef int (*initcall_t)(void); typedef void (*exitcall_t)(void); +#ifndef __section +# define __section(S) __attribute__ ((__section__(#S))) +#endif + +#ifndef __used +#if __GNUC__ == 3 && __GNUC_MINOR__ == 2 +# define __used __attribute__((__unused__)) +#else +# define __used __attribute__((__used__)) +#endif +#endif + /* These are for everybody (although not all archs will actually discard it in modules) */ #define __init __section(.init.text) -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[Patch] include/asm-generic/tlb.h: fix a missing header
This patch fixes this build error in current -git tree: CC kernel/sched.o In file included from include/asm/arch/tlb.h:10, from include/asm/tlb.h:5, from kernel/sched.c:71: include/asm-generic/tlb.h: In function 'tlb_finish_mmu': include/asm-generic/tlb.h:91: error: implicit declaration of function 'check_pgt_cache' make[1]: *** [kernel/sched.o] Error 1 make: *** [kernel] Error 2 Cc: Ingo Molnar <[EMAIL PROTECTED]> Cc: Christoph Lameter <[EMAIL PROTECTED]> Signed-off-by: WANG Cong <[EMAIL PROTECTED]> --- diff --git a/include/asm-generic/tlb.h b/include/asm-generic/tlb.h index 6ce9f3a..4ebbe15 100644 --- a/include/asm-generic/tlb.h +++ b/include/asm-generic/tlb.h @@ -16,6 +16,7 @@ #include #include #include +#include /* * For UP we don't need to worry about TLB flush -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
(Try#3) [Patch] Shut up warnings from files under drivers/
On Sun, Jan 27, 2008 at 10:21:00AM +0100, Sam Ravnborg wrote: >Hi WANG. > >Thanks for chasing these annoying warnings - it is >good to keep the warning level low so we keep >attention when new warnings happens! > >> index d775eb6..eec1624 100644 >> --- a/drivers/video/aty/atyfb_base.c >> +++ b/drivers/video/aty/atyfb_base.c >> @@ -244,7 +244,9 @@ static int atyfb_sync(struct fb_info *info); >> */ >> >> static int aty_init(struct fb_info *info); >> +#if defined(CONFIG_PM) && defined(CONFIG_PCI) >> static void aty_resume_chip(struct fb_info *info); >> +#endif > >It is preferable to have the forward declaration unconditional >to keep the #if/#endif count low. > > >> #endif >> @@ -2709,6 +2711,7 @@ aty_init_exit: >> return -1; >> } >> >> +#if defined(CONFIG_PM) && defined(CONFIG_PCI) >> static void aty_resume_chip(struct fb_info *info) >> { >> struct atyfb_par *par = info->par; >> @@ -2721,6 +2724,7 @@ static void aty_resume_chip(struct fb_info *info) >> if (par->aux_start) >> aty_st_le32(BUS_CNTL, aty_ld_le32(BUS_CNTL, par) | >> BUS_APER_REG_DIS, par); >> } >> +#endif > >Moving the aty_resume_chip() function down just above >atyfb_pci_resume() would put in in the same #if/#endif >block and you can kill the forward declaration too. >Did you try that out? Yes, it works. Here's the updated patch, and I dropped the drivers/char/applicom.c part as Jiri Slaby has better fix. ---> Fix defined-but-not-used warnings from files under drivers/, such as: drivers/video/aty/atyfb_base.c:2713: warning: ‘aty_resume_chip’ defined but not used Compile tests passed. Cc: Jeff Garzik <[EMAIL PROTECTED]> Cc: Greg KH <[EMAIL PROTECTED]> Cc: Sam Ravnborg <[EMAIL PROTECTED]> Cc: Jiri Slaby <[EMAIL PROTECTED]> Signed-off-by: WANG Cong <[EMAIL PROTECTED]> --- diff --git a/drivers/char/synclink.c b/drivers/char/synclink.c index 905d1f5..ae1f565 100644 --- a/drivers/char/synclink.c +++ b/drivers/char/synclink.c @@ -897,7 +897,6 @@ static char *driver_version = "$Revision: 4.38 $"; static int synclink_init_one (struct pci_dev *dev, const struct pci_device_id *ent); -static void synclink_remove_one (struct pci_dev *dev); static struct pci_device_id synclink_pci_tbl[] = { { PCI_VENDOR_ID_MICROGATE, PCI_DEVICE_ID_MICROGATE_USC, PCI_ANY_ID, PCI_ANY_ID, }, @@ -908,6 +907,10 @@ MODULE_DEVICE_TABLE(pci, synclink_pci_tbl); MODULE_LICENSE("GPL"); +static void __devexit synclink_remove_one (struct pci_dev *dev) +{ +} + static struct pci_driver synclink_pci_driver = { .name = "synclink", .id_table = synclink_pci_tbl, @@ -8166,7 +8169,3 @@ static int __devinit synclink_init_one (struct pci_dev *dev, return 0; } -static void __devexit synclink_remove_one (struct pci_dev *dev) -{ -} - diff --git a/drivers/crypto/hifn_795x.c b/drivers/crypto/hifn_795x.c index dfbf24c..f33f82a 100644 --- a/drivers/crypto/hifn_795x.c +++ b/drivers/crypto/hifn_795x.c @@ -2730,7 +2730,7 @@ err_out_disable_pci_device: return err; } -static void hifn_remove(struct pci_dev *pdev) +static void __devexit hifn_remove(struct pci_dev *pdev) { int i; struct hifn_device *dev; diff --git a/drivers/telephony/ixj.c b/drivers/telephony/ixj.c index 49cd979..1549c0b 100644 --- a/drivers/telephony/ixj.c +++ b/drivers/telephony/ixj.c @@ -284,7 +284,7 @@ static int samplerate = 100; module_param(ixjdebug, int, 0); -static struct pci_device_id ixj_pci_tbl[] __devinitdata = { +static struct pci_device_id ixj_pci_tbl[] __used __devinitdata = { { PCI_VENDOR_ID_QUICKNET, PCI_DEVICE_ID_QUICKNET_XJ, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, { } diff --git a/drivers/video/aty/aty128fb.c b/drivers/video/aty/aty128fb.c index cbd3308..4e57fcf 100644 --- a/drivers/video/aty/aty128fb.c +++ b/drivers/video/aty/aty128fb.c @@ -165,7 +165,7 @@ static const char *r128_family[] __devinitdata = { */ static int aty128_probe(struct pci_dev *pdev, const struct pci_device_id *ent); -static void aty128_remove(struct pci_dev *pdev); +static void __devexit aty128_remove(struct pci_dev *pdev); static int aty128_pci_suspend(struct pci_dev *pdev, pm_message_t state); static int aty128_pci_resume(struct pci_dev *pdev); static int aty128_do_resume(struct pci_dev *pdev); diff --git a/drivers/video/aty/atyfb_base.c b/drivers/video/aty/atyfb_base.c index d775eb6..3829f3e 100644 --- a/drivers/video/aty/atyfb_base.c +++ b/drivers/video/aty/atyfb_base.c @@ -244,7 +244,6 @@ static int atyfb_sync(struct fb_info *info); */ static int aty_init(struct fb_info *info); -static void aty_resume_chip
Re: (Updated) [Patch] Shut up warnings from files under drivers/
On Sun, Jan 27, 2008 at 10:21:12AM +0100, Jiri Slaby wrote: >On 01/27/2008 10:08 AM, Jiri Slaby wrote: >>On 01/27/2008 05:15 AM, WANG Cong wrote: >>>Fix defined-but-not-used warnings from files under drivers/, >>>such as: >>> >>>drivers/char/applicom.c:68: warning: ‘applicom_pci_tbl’ defined but >>>not used >>> >>>Compile tests passed. >>> >>>Cc: Jeff Garzik <[EMAIL PROTECTED]> >>>Cc: Greg KH <[EMAIL PROTECTED]> >>>Cc: Sam Ravnborg <[EMAIL PROTECTED]> >>>Signed-off-by: WANG Cong <[EMAIL PROTECTED]> >>> >>>--- >>> >>>diff --git a/drivers/char/applicom.c b/drivers/char/applicom.c >>>index 1f0b752..97171ad 100644 >>>--- a/drivers/char/applicom.c >>>+++ b/drivers/char/applicom.c >>>@@ -65,7 +65,7 @@ static char *applicom_pci_devnames[] = { >>> "PCI2000PFB" >>> }; >>> >>>-static struct pci_device_id applicom_pci_tbl[] = { >>>+static struct pci_device_id applicom_pci_tbl[] __used = { >>> { PCI_VENDOR_ID_APPLICOM, PCI_DEVICE_ID_APPLICOM_PCIGENERIC, >>> PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, >>> { PCI_VENDOR_ID_APPLICOM, PCI_DEVICE_ID_APPLICOM_PCI2000IBS_CAN, >> >>I have probably a better fix with pci_match_id() referencing this array. > >Hmm, checking it one more time persuades me that the best fix ever is to >convert it to probing. David, do you have the card? OK. I will drop this part. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [Patch] drivers/base/core.c: fix a compile error
> >No, that will fix the build error, but die when linking :( > >I'll work on a real fix for this now... > Sorry. I just compiled it since the building process was stopped by another error. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
(Updated) [Patch] Shut up warnings from files under drivers/
>Investigating a bit more I realized that gcc looses the >__used__ attribution due to the prototype. >So there are two correct fixes: >a) move the function up so we do not need the forward > declaration >b) add a __devexit to the forward decalration too. > >I strongly prefer the first version and this is the >correct fix for these cases. > >Do we have a gcc bug here - I did not see a definitive answer in gcc docs? > Here is the updated version. > Fix defined-but-not-used warnings from files under drivers/, such as: drivers/char/applicom.c:68: warning: ‘applicom_pci_tbl’ defined but not used Compile tests passed. Cc: Jeff Garzik <[EMAIL PROTECTED]> Cc: Greg KH <[EMAIL PROTECTED]> Cc: Sam Ravnborg <[EMAIL PROTECTED]> Signed-off-by: WANG Cong <[EMAIL PROTECTED]> --- diff --git a/drivers/char/applicom.c b/drivers/char/applicom.c index 1f0b752..97171ad 100644 --- a/drivers/char/applicom.c +++ b/drivers/char/applicom.c @@ -65,7 +65,7 @@ static char *applicom_pci_devnames[] = { "PCI2000PFB" }; -static struct pci_device_id applicom_pci_tbl[] = { +static struct pci_device_id applicom_pci_tbl[] __used = { { PCI_VENDOR_ID_APPLICOM, PCI_DEVICE_ID_APPLICOM_PCIGENERIC, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, { PCI_VENDOR_ID_APPLICOM, PCI_DEVICE_ID_APPLICOM_PCI2000IBS_CAN, diff --git a/drivers/char/synclink.c b/drivers/char/synclink.c index 905d1f5..ae1f565 100644 --- a/drivers/char/synclink.c +++ b/drivers/char/synclink.c @@ -897,7 +897,6 @@ static char *driver_version = "$Revision: 4.38 $"; static int synclink_init_one (struct pci_dev *dev, const struct pci_device_id *ent); -static void synclink_remove_one (struct pci_dev *dev); static struct pci_device_id synclink_pci_tbl[] = { { PCI_VENDOR_ID_MICROGATE, PCI_DEVICE_ID_MICROGATE_USC, PCI_ANY_ID, PCI_ANY_ID, }, @@ -908,6 +907,10 @@ MODULE_DEVICE_TABLE(pci, synclink_pci_tbl); MODULE_LICENSE("GPL"); +static void __devexit synclink_remove_one (struct pci_dev *dev) +{ +} + static struct pci_driver synclink_pci_driver = { .name = "synclink", .id_table = synclink_pci_tbl, @@ -8166,7 +8169,3 @@ static int __devinit synclink_init_one (struct pci_dev *dev, return 0; } -static void __devexit synclink_remove_one (struct pci_dev *dev) -{ -} - diff --git a/drivers/crypto/hifn_795x.c b/drivers/crypto/hifn_795x.c index dfbf24c..f33f82a 100644 --- a/drivers/crypto/hifn_795x.c +++ b/drivers/crypto/hifn_795x.c @@ -2730,7 +2730,7 @@ err_out_disable_pci_device: return err; } -static void hifn_remove(struct pci_dev *pdev) +static void __devexit hifn_remove(struct pci_dev *pdev) { int i; struct hifn_device *dev; diff --git a/drivers/telephony/ixj.c b/drivers/telephony/ixj.c index 49cd979..1549c0b 100644 --- a/drivers/telephony/ixj.c +++ b/drivers/telephony/ixj.c @@ -284,7 +284,7 @@ static int samplerate = 100; module_param(ixjdebug, int, 0); -static struct pci_device_id ixj_pci_tbl[] __devinitdata = { +static struct pci_device_id ixj_pci_tbl[] __used __devinitdata = { { PCI_VENDOR_ID_QUICKNET, PCI_DEVICE_ID_QUICKNET_XJ, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, { } diff --git a/drivers/video/aty/aty128fb.c b/drivers/video/aty/aty128fb.c index cbd3308..4e57fcf 100644 --- a/drivers/video/aty/aty128fb.c +++ b/drivers/video/aty/aty128fb.c @@ -165,7 +165,7 @@ static const char *r128_family[] __devinitdata = { */ static int aty128_probe(struct pci_dev *pdev, const struct pci_device_id *ent); -static void aty128_remove(struct pci_dev *pdev); +static void __devexit aty128_remove(struct pci_dev *pdev); static int aty128_pci_suspend(struct pci_dev *pdev, pm_message_t state); static int aty128_pci_resume(struct pci_dev *pdev); static int aty128_do_resume(struct pci_dev *pdev); diff --git a/drivers/video/aty/atyfb_base.c b/drivers/video/aty/atyfb_base.c index d775eb6..eec1624 100644 --- a/drivers/video/aty/atyfb_base.c +++ b/drivers/video/aty/atyfb_base.c @@ -244,7 +244,9 @@ static int atyfb_sync(struct fb_info *info); */ static int aty_init(struct fb_info *info); +#if defined(CONFIG_PM) && defined(CONFIG_PCI) static void aty_resume_chip(struct fb_info *info); +#endif #ifdef CONFIG_ATARI static int store_video_par(char *videopar, unsigned char m64_num); #endif @@ -2709,6 +2711,7 @@ aty_init_exit: return -1; } +#if defined(CONFIG_PM) && defined(CONFIG_PCI) static void aty_resume_chip(struct fb_info *info) { struct atyfb_par *par = info->par; @@ -2721,6 +2724,7 @@ static void aty_resume_chip(struct fb_info *info) if (par->aux_start) aty_st_le32(BUS_CNTL, aty_ld_le32(BUS_CNTL, par) | BUS_APER_REG_DIS, par); } +#endif #ifdef CONFIG_ATARI static int __devinit store_video_par(char *video_s
Re: [Patch] Shut up warnings from files under drivers/
On Sat, Jan 26, 2008 at 08:17:17PM +0100, Sam Ravnborg wrote: >On Sat, Jan 26, 2008 at 04:55:58AM -0500, Jeff Garzik wrote: >> WANG Cong wrote: >> >diff --git a/drivers/video/kyro/fbdev.c b/drivers/video/kyro/fbdev.c >> >index acb9370..437ebd0 100644 >> >--- a/drivers/video/kyro/fbdev.c >> >+++ b/drivers/video/kyro/fbdev.c >> >@@ -90,7 +90,9 @@ static int nomtrr __devinitdata = 0; >> > >> > /* PCI driver prototypes */ >> > static int kyrofb_probe(struct pci_dev *pdev, const struct pci_device_id >> > *ent); >> >+#if defined(MODULE) || defined(CONFIG_HOTPLUG) >> > static void kyrofb_remove(struct pci_dev *pdev); >> >+#endif >> > >> > static struct fb_videomode kyro_modedb[] __devinitdata = { >> >{ >> >@@ -754,6 +756,7 @@ out_unmap: >> >return -EINVAL; >> > } >> > >> >+#if defined(MODULE) || defined(CONFIG_HOTPLUG) >> > static void __devexit kyrofb_remove(struct pci_dev *pdev) >> > { >> >struct fb_info *info = pci_get_drvdata(pdev); >> >@@ -783,6 +786,7 @@ static void __devexit kyrofb_remove(struct pci_dev >> >*pdev) >> >pci_set_drvdata(pdev, NULL); >> >framebuffer_release(info); >> > } >> >+#endif >> >> >> Quite strange -- due to __devexit_p() and the __devexit marker, ifdefs >> should not be needed. >> >> I would look into why that isn't working as designed in these cases... > >I checked up on the synclink.c warning. >We have the following code: > >static void synclink_remove_one (struct pci_dev *dev); > >... > >static struct pci_driver synclink_pci_driver = { >.remove = __devexit_p(synclink_remove_one), >}; > >... > >static void __devexit synclink_remove_one (struct pci_dev *dev) >{ >} > >And I double checked the preprocessed source to check >that we applied the __attribute__((__used__)) to the function. Yes. The only macro we used on synclink_remove_one is __devexit. It's defination is: #ifdef CONFIG_HOTPLUG #define __devexit #else #define __devexit __exit #endif And __exit is: #ifdef MODULE #define __exit __attribute__ ((__section__(".exit.text"))) __cold #else #define __exit __attribute_used__ __attribute__ ((__section__(".exit.text"))) __cold #endif So only when !defined(MODULE) && !defined(CONFIG_HOTPLUG), __attribute_used__ is applied. And this case is just that condition, thus this should be a bogus of gcc. > >Investigating a bit more I realized that gcc looses the >__used__ attribution due to the prototype. >So there are two correct fixes: >a) move the function up so we do not need the forward > declaration >b) add a __devexit to the forward decalration too. > >I strongly prefer the first version and this is the >correct fix for these cases. > >Do we have a gcc bug here - I did not see a definitive answer in gcc docs? > Agreed. I will try a). -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: The latest linus tree can't build
On Sat, Jan 26, 2008 at 12:45:14PM +0200, Adrian Bunk wrote: >On Sat, Jan 26, 2008 at 06:38:45PM +0800, WANG Cong wrote: >> >> Hi, Sam! >> >> When I built the latest linus tree, I got this error: >> >> ... >> CC sound/oss/msnd.o >> make[2]: *** No rule to make target `/etc/sound/msndperm.bin', needed by >> `sound/oss/msndperm.c'. Stop. >> make[1]: *** [sound/oss] Error 2 >> make: *** [sound] Error 2 >> >> My .config is just the one I sent to you in another thread. >>... > >It's expected that CONFIG_STANDALONE=n allows configurations that won't >compile. Oh, thank you! -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
The latest linus tree can't build
Hi, Sam! When I built the latest linus tree, I got this error: ... CC sound/oss/msnd.o make[2]: *** No rule to make target `/etc/sound/msndperm.bin', needed by `sound/oss/msndperm.c'. Stop. make[1]: *** [sound/oss] Error 2 make: *** [sound] Error 2 My .config is just the one I sent to you in another thread. Need me to resend it? Regards. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [Patch] Shut up warnings from files under drivers/
> >Looking a bit closer the above is rubbish. >We have: >#if defined(MODULE) || defined(CONFIG_HOTPLUG) >#define __devexit_p(x) x >#else >#define __devexit_p(x) NULL > >so the pointer to the function is used in >both cases. I think in the latter case, 'x' is not used, just as gcc told me. ;) > >Could you drop me the config that produces the warning >and the warning message. > Of course. Attached. Regards. # # Automatically generated make config: don't edit # Linux kernel version: 2.6.24 # Sat Jan 26 10:19:31 2008 # # CONFIG_64BIT is not set CONFIG_X86_32=y # CONFIG_X86_64 is not set CONFIG_X86=y CONFIG_GENERIC_TIME=y CONFIG_GENERIC_CMOS_UPDATE=y CONFIG_CLOCKSOURCE_WATCHDOG=y CONFIG_GENERIC_CLOCKEVENTS=y CONFIG_LOCKDEP_SUPPORT=y CONFIG_STACKTRACE_SUPPORT=y CONFIG_SEMAPHORE_SLEEPERS=y CONFIG_MMU=y CONFIG_ZONE_DMA=y CONFIG_QUICKLIST=y CONFIG_GENERIC_ISA_DMA=y CONFIG_GENERIC_IOMAP=y CONFIG_GENERIC_HWEIGHT=y CONFIG_ARCH_MAY_HAVE_PC_FDC=y CONFIG_DMI=y # CONFIG_RWSEM_GENERIC_SPINLOCK is not set CONFIG_RWSEM_XCHGADD_ALGORITHM=y # CONFIG_ARCH_HAS_ILOG2_U32 is not set # CONFIG_ARCH_HAS_ILOG2_U64 is not set CONFIG_GENERIC_CALIBRATE_DELAY=y # CONFIG_GENERIC_TIME_VSYSCALL is not set CONFIG_ARCH_SUPPORTS_OPROFILE=y # CONFIG_ZONE_DMA32 is not set CONFIG_ARCH_POPULATES_NODE_MAP=y # CONFIG_AUDIT_ARCH is not set CONFIG_GENERIC_HARDIRQS=y CONFIG_GENERIC_IRQ_PROBE=y CONFIG_X86_BIOS_REBOOT=y CONFIG_KTIME_SCALAR=y CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" # # General setup # CONFIG_EXPERIMENTAL=y CONFIG_BROKEN_ON_SMP=y CONFIG_INIT_ENV_ARG_LIMIT=32 CONFIG_LOCALVERSION="" CONFIG_LOCALVERSION_AUTO=y # CONFIG_SYSVIPC is not set CONFIG_BSD_PROCESS_ACCT=y # CONFIG_BSD_PROCESS_ACCT_V3 is not set CONFIG_USER_NS=y # CONFIG_PID_NS is not set CONFIG_IKCONFIG=y CONFIG_IKCONFIG_PROC=y CONFIG_LOG_BUF_SHIFT=14 CONFIG_CGROUPS=y # CONFIG_CGROUP_DEBUG is not set CONFIG_CGROUP_NS=y CONFIG_FAIR_GROUP_SCHED=y CONFIG_FAIR_USER_SCHED=y # CONFIG_FAIR_CGROUP_SCHED is not set CONFIG_CGROUP_CPUACCT=y # CONFIG_SYSFS_DEPRECATED is not set CONFIG_RELAY=y CONFIG_BLK_DEV_INITRD=y CONFIG_INITRAMFS_SOURCE="" CONFIG_CC_OPTIMIZE_FOR_SIZE=y CONFIG_EMBEDDED=y CONFIG_UID16=y # CONFIG_SYSCTL_SYSCALL is not set CONFIG_KALLSYMS=y CONFIG_KALLSYMS_ALL=y CONFIG_KALLSYMS_EXTRA_PASS=y # CONFIG_HOTPLUG is not set CONFIG_PRINTK=y # CONFIG_BUG is not set # CONFIG_ELF_CORE is not set CONFIG_BASE_FULL=y # CONFIG_FUTEX is not set CONFIG_ANON_INODES=y # CONFIG_EPOLL is not set CONFIG_SIGNALFD=y # CONFIG_EVENTFD is not set # CONFIG_SHMEM is not set CONFIG_VM_EVENT_COUNTERS=y CONFIG_SLAB=y # CONFIG_SLUB is not set # CONFIG_SLOB is not set CONFIG_SLABINFO=y CONFIG_TINY_SHMEM=y CONFIG_BASE_SMALL=0 # CONFIG_MODULES is not set # CONFIG_BLOCK is not set CONFIG_PREEMPT_NOTIFIERS=y CONFIG_CLASSIC_RCU=y # CONFIG_PREEMPT_RCU is not set # # Processor type and features # # CONFIG_TICK_ONESHOT is not set # CONFIG_NO_HZ is not set # CONFIG_HIGH_RES_TIMERS is not set CONFIG_GENERIC_CLOCKEVENTS_BUILD=y # CONFIG_SMP is not set CONFIG_X86_PC=y # CONFIG_X86_ELAN is not set # CONFIG_X86_VOYAGER is not set # CONFIG_X86_NUMAQ is not set # CONFIG_X86_SUMMIT is not set # CONFIG_X86_BIGSMP is not set # CONFIG_X86_VISWS is not set # CONFIG_X86_GENERICARCH is not set # CONFIG_X86_ES7000 is not set # CONFIG_X86_VSMP is not set CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y # CONFIG_PARAVIRT_GUEST is not set # CONFIG_M386 is not set # CONFIG_M486 is not set # CONFIG_M586 is not set # CONFIG_M586TSC is not set # CONFIG_M586MMX is not set # CONFIG_M686 is not set # CONFIG_MPENTIUMII is not set # CONFIG_MPENTIUMIII is not set # CONFIG_MPENTIUMM is not set # CONFIG_MPENTIUM4 is not set # CONFIG_MK6 is not set # CONFIG_MK7 is not set CONFIG_MK8=y # CONFIG_MCRUSOE is not set # CONFIG_MEFFICEON is not set # CONFIG_MWINCHIPC6 is not set # CONFIG_MWINCHIP2 is not set # CONFIG_MWINCHIP3D is not set # CONFIG_MGEODEGX1 is not set # CONFIG_MGEODE_LX is not set # CONFIG_MCYRIXIII is not set # CONFIG_MVIAC3_2 is not set # CONFIG_MVIAC7 is not set # CONFIG_MPSC is not set # CONFIG_MCORE2 is not set # CONFIG_GENERIC_CPU is not set # CONFIG_X86_GENERIC is not set CONFIG_X86_CMPXCHG=y CONFIG_X86_L1_CACHE_SHIFT=6 CONFIG_X86_XADD=y CONFIG_X86_WP_WORKS_OK=y CONFIG_X86_INVLPG=y CONFIG_X86_BSWAP=y CONFIG_X86_POPAD_OK=y CONFIG_X86_GOOD_APIC=y CONFIG_X86_INTEL_USERCOPY=y CONFIG_X86_USE_PPRO_CHECKSUM=y CONFIG_X86_TSC=y CONFIG_X86_MINIMUM_CPU_FAMILY=4 CONFIG_HPET_TIMER=y CONFIG_PREEMPT_NONE=y # CONFIG_PREEMPT_VOLUNTARY is not set # CONFIG_PREEMPT is not set CONFIG_RCU_TRACE=y # CONFIG_X86_UP_APIC is not set # CONFIG_X86_MCE is not set CONFIG_VM86=y # CONFIG_TOSHIBA is not set # CONFIG_I8K is not set # CONFIG_X86_REBOOTFIXUPS is not set # CONFIG_MICROCODE is not set # CONFIG_X86_MSR is not set # CONFIG_X86_CPUID is not set # CONFIG_NOHIGHMEM is not set CONFIG_HIGHMEM4G=y # CONFIG_HIGHMEM64G is not set CONFIG_VMSPLIT_3G=y # CONFIG_VMSPLIT_3G_OPT is not set # CONFIG_VMSPLIT_2G is not set # CONFIG_VMSPLIT_2G_OPT is not set
Re: [Patch] Shut up warnings from files under drivers/
On Sat, Jan 26, 2008 at 04:55:58AM -0500, Jeff Garzik wrote: >WANG Cong wrote: >>diff --git a/drivers/video/kyro/fbdev.c b/drivers/video/kyro/fbdev.c >>index acb9370..437ebd0 100644 >>--- a/drivers/video/kyro/fbdev.c >>+++ b/drivers/video/kyro/fbdev.c >>@@ -90,7 +90,9 @@ static int nomtrr __devinitdata = 0; >> >> /* PCI driver prototypes */ >> static int kyrofb_probe(struct pci_dev *pdev, const struct pci_device_id >> *ent); >>+#if defined(MODULE) || defined(CONFIG_HOTPLUG) >> static void kyrofb_remove(struct pci_dev *pdev); >>+#endif >> >> static struct fb_videomode kyro_modedb[] __devinitdata = { >> { >>@@ -754,6 +756,7 @@ out_unmap: >> return -EINVAL; >> } >> >>+#if defined(MODULE) || defined(CONFIG_HOTPLUG) >> static void __devexit kyrofb_remove(struct pci_dev *pdev) >> { >> struct fb_info *info = pci_get_drvdata(pdev); >>@@ -783,6 +786,7 @@ static void __devexit kyrofb_remove(struct pci_dev >>*pdev) >> pci_set_drvdata(pdev, NULL); >> framebuffer_release(info); >> } >>+#endif > > >Quite strange -- due to __devexit_p() and the __devexit marker, ifdefs >should not be needed. > >I would look into why that isn't working as designed in these cases... > For example, the defination of __devexit_p: #if defined(MODULE) || defined(CONFIG_HOTPLUG) #define __devexit_p(x) x #else #define __devexit_p(x) NULL #endif If !(defined(MODULE) || defined(CONFIG_HOTPLUG)), __devexit_p is just a NULL pointer, thus 'x' may be unused although defined. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [Patch] Shut up warnings from files under drivers/
On Sat, Jan 26, 2008 at 10:57:23AM +0100, Sam Ravnborg wrote: >Hi WANG. >On Sat, Jan 26, 2008 at 05:30:07PM +0800, WANG Cong wrote: >> >> Fix two kind of defined-but-not-used warnings. >> >> One is due to defination of MODULE_DEVICE_TABLE, the >> other is due to __devexit_p. The solution is just to >> add proper directives to protect those usages. > >Please include the actual warnings that you fix. > Sure. Such as this one: drivers/char/applicom.c:68: warning: ‘applicom_pci_tbl’ defined but not used Others are similar. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[Patch] Shut up warnings from files under drivers/
Fix two kind of defined-but-not-used warnings. One is due to defination of MODULE_DEVICE_TABLE, the other is due to __devexit_p. The solution is just to add proper directives to protect those usages. Compile tests passed. Cc: Greg KH <[EMAIL PROTECTED]> Signed-off-by: WANG Cong <[EMAIL PROTECTED]> --- diff --git a/drivers/char/applicom.c b/drivers/char/applicom.c index 1f0b752..247bc16 100644 --- a/drivers/char/applicom.c +++ b/drivers/char/applicom.c @@ -65,6 +65,7 @@ static char *applicom_pci_devnames[] = { "PCI2000PFB" }; +#ifdef MODULE static struct pci_device_id applicom_pci_tbl[] = { { PCI_VENDOR_ID_APPLICOM, PCI_DEVICE_ID_APPLICOM_PCIGENERIC, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, @@ -74,6 +75,8 @@ static struct pci_device_id applicom_pci_tbl[] = { PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, { 0 } }; +#endif + MODULE_DEVICE_TABLE(pci, applicom_pci_tbl); MODULE_AUTHOR("David Woodhouse & Applicom International"); diff --git a/drivers/char/synclink.c b/drivers/char/synclink.c index 905d1f5..2009dc9 100644 --- a/drivers/char/synclink.c +++ b/drivers/char/synclink.c @@ -897,7 +897,9 @@ static char *driver_version = "$Revision: 4.38 $"; static int synclink_init_one (struct pci_dev *dev, const struct pci_device_id *ent); +#if defined(MODULE) || defined(CONFIG_HOTPLUG) static void synclink_remove_one (struct pci_dev *dev); +#endif static struct pci_device_id synclink_pci_tbl[] = { { PCI_VENDOR_ID_MICROGATE, PCI_DEVICE_ID_MICROGATE_USC, PCI_ANY_ID, PCI_ANY_ID, }, @@ -8166,7 +8168,8 @@ static int __devinit synclink_init_one (struct pci_dev *dev, return 0; } +#if defined(MODULE) || defined(CONFIG_HOTPLUG) static void __devexit synclink_remove_one (struct pci_dev *dev) { } - +#endif diff --git a/drivers/crypto/hifn_795x.c b/drivers/crypto/hifn_795x.c index 16413e5..635f651 100644 --- a/drivers/crypto/hifn_795x.c +++ b/drivers/crypto/hifn_795x.c @@ -2046,6 +2046,7 @@ static irqreturn_t hifn_interrupt(int irq, void *data) return IRQ_HANDLED; } +#if defined(MODULE) || defined(CONFIG_HOTPLUG) static void hifn_flush(struct hifn_device *dev) { unsigned long flags; @@ -2073,6 +2074,7 @@ static void hifn_flush(struct hifn_device *dev) } spin_unlock_irqrestore(&dev->lock, flags); } +#endif static int hifn_setkey(struct crypto_ablkcipher *cipher, const u8 *key, unsigned int len) @@ -2730,6 +2732,7 @@ err_out_disable_pci_device: return err; } +#if defined(MODULE) || defined(CONFIG_HOTPLUG) static void hifn_remove(struct pci_dev *pdev) { int i; @@ -2767,6 +2770,7 @@ static void hifn_remove(struct pci_dev *pdev) pci_release_regions(pdev); pci_disable_device(pdev); } +#endif static struct pci_device_id hifn_pci_tbl[] = { { PCI_DEVICE(PCI_VENDOR_ID_HIFN, PCI_DEVICE_ID_HIFN_7955) }, diff --git a/drivers/telephony/ixj.c b/drivers/telephony/ixj.c index 49cd979..1877084 100644 --- a/drivers/telephony/ixj.c +++ b/drivers/telephony/ixj.c @@ -284,11 +284,13 @@ static int samplerate = 100; module_param(ixjdebug, int, 0); +#ifdef MODULE static struct pci_device_id ixj_pci_tbl[] __devinitdata = { { PCI_VENDOR_ID_QUICKNET, PCI_DEVICE_ID_QUICKNET_XJ, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, { } }; +#endif MODULE_DEVICE_TABLE(pci, ixj_pci_tbl); diff --git a/drivers/video/aty/aty128fb.c b/drivers/video/aty/aty128fb.c index cbd3308..3a1aa7e 100644 --- a/drivers/video/aty/aty128fb.c +++ b/drivers/video/aty/aty128fb.c @@ -165,7 +165,9 @@ static const char *r128_family[] __devinitdata = { */ static int aty128_probe(struct pci_dev *pdev, const struct pci_device_id *ent); +#if defined(MODULE) || defined(CONFIG_HOTPLUG) static void aty128_remove(struct pci_dev *pdev); +#endif static int aty128_pci_suspend(struct pci_dev *pdev, pm_message_t state); static int aty128_pci_resume(struct pci_dev *pdev); static int aty128_do_resume(struct pci_dev *pdev); @@ -1844,11 +1846,14 @@ error: return; } +#if defined(MODULE) || defined(CONFIG_HOTPLUG) static void aty128_bl_exit(struct backlight_device *bd) { backlight_device_unregister(bd); printk("aty128: Backlight unloaded\n"); } +#endif + #endif /* CONFIG_FB_ATY128_BACKLIGHT */ /* @@ -2125,6 +2130,7 @@ err_free_fb: return -ENODEV; } +#if defined(MODULE) || defined(CONFIG_HOTPLUG) static void __devexit aty128_remove(struct pci_dev *pdev) { struct fb_info *info = pci_get_drvdata(pdev); @@ -2155,6 +2161,7 @@ static void __devexit aty128_remove(struct pci_dev *pdev) pci_resource_len(pdev, 2)); framebuffer_release(info); } +#endif /* MODULE || CONFIG_HOTPLUG */ #endif /* CONFIG_PCI */ diff --git a/drivers/video/aty/atyfb_base.c b/drivers/video/aty/atyfb_base.c index d77
[Patch] drivers/base/core.c: fix a compile error
On Fri, Jan 25, 2008 at 03:24:13PM -0800, Jeremy Fitzhardinge wrote: >Greg KH wrote: >>Ah, sorry, I missed that "note" :( >> >>thanks, >> >>greg 'time to get that make randconfig system up and working' k-h >> > >Here's a config that fails. > Here's one possible fix. Please review. Signed-off-by: WANG Cong <[EMAIL PROTECTED]> --- Index: linux-2.6/include/linux/genhd.h === --- linux-2.6.orig/include/linux/genhd.h +++ linux-2.6/include/linux/genhd.h @@ -12,6 +12,8 @@ #include #include +extern struct device_type part_type; + #ifdef CONFIG_BLOCK #define kobj_to_dev(k) container_of(k, struct device, kobj) @@ -19,7 +21,6 @@ #define dev_to_part(device) container_of(device, struct hd_struct, dev) extern struct device_type disk_type; -extern struct device_type part_type; extern struct kobject *block_depr; extern struct class block_class; -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: Incorrect filename comments in arch/x86/boot
On Tue, Jan 22, 2008 at 12:20:12PM -0800, H. Peter Anvin wrote: >Pavel Machek wrote: >>Hi! >> >>Not sure if this is worth fixing, or if I should just delete those >>comments...? (Or does someone want to do that? ;-). >> Pavel > >I'll take care of it. > Hmm, arch/i386/boot/ is an empty dir. Why not remove it? Only used to put bzImage? Why not choose another dir? Maybe arch/x86/boot/, I think. ;) -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: build #343 issue for v2.6.24-rc8-29-g03bbe08 : Section mismatch: reference to .init.text.1:start_kernel (between 'is386' and 'check_x87')
On Fri, Jan 18, 2008 at 07:47:55PM +0100, Sam Ravnborg wrote: >Hi Wang. >> >> >Following untested patch should fix it. >> >> > >> >> >> >> Still has the same problem. ;( >> >Could you please doublecheck that you applied the patch and modpost is >> >rebuilt. >> >If you continue to see the problem could you send me the config (off-list) >> >and >> >I will fix it. >> >> Sure thing. >> >> I got something like this: >> >> HOSTCC scripts/mod/modpost.o >> HOSTLD scripts/mod/modpost >> >> So modpost was rebuilt. And I am quite sure I had applied your patch. >> >> My .config is just the one provided by Toralf. If you need me to send >> you again, please tell me. > >I took Toralf's original config and did a build of latest mainline kernel. >I got two section mismatch warnings: >WARNING: vmlinux.o(.text+0x14c8): Section mismatch: reference to >.init.data:vsyscall_int80_start (between 'fiddle_vdso' and >'xen_setup_features') >WARNING: vmlinux.o(.text.head+0x247): Section mismatch: reference to >.init.text.1:start_kernel (between 'is386' and 'check_x87') > >Applying the patch I orginally posted fixed the latter of the two. >The first was fixed by declaring fiddle_vdso __init. > >I have tripple chcked that my patch fixes the latter of the two warnings >and it does. So something is different at your place. > >Could you send me the exact warning as you see it. > Sorry. This time the patch is OK. Thanks for your patch! -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: build #343 issue for v2.6.24-rc8-29-g03bbe08 : Section mismatch: reference to .init.text.1:start_kernel (between 'is386' and 'check_x87')
On Fri, Jan 18, 2008 at 02:22:42PM +0100, Sam Ravnborg wrote: >On Fri, Jan 18, 2008 at 08:51:44PM +0800, WANG Cong wrote: >> On Fri, Jan 18, 2008 at 01:46:27PM +0100, Sam Ravnborg wrote: >> >On Fri, Jan 18, 2008 at 08:29:17PM +0800, WANG Cong wrote: >> >> On Fri, Jan 18, 2008 at 01:18:27PM +0100, Toralf Förster wrote: >> >> >Hello, >> >> > >> >> >the build with the attached .config was successful however I got during >> >> >make : >> >> > AS .tmp_kallsyms2.o >> >> > LD vmlinux.o >> >> > MODPOST vmlinux.o >> >> >WARNING: vmlinux.o(.text.head+0x247): Section mismatch: reference to >> >> >.init.text.1:start_kernel (between 'is386' and 'check_x87') >> >> > CHK include/linux/version.h >> >> > HOSTCC scripts/unifdef >> >> > MKDIR include >> >> > >> >> >Does it help / make sense to report such warning ? >> >> > >> >> >The build was made with : >> >> >$> make mrproper && make rndconfig && && make >> >> >oldconfig && make >> >> > >> >> >Here's the config: >> >> >> >> Thanks. You have reported this. ;) >> >> >> >> I can't solve this problem. Let's Cc Rusty and Sam to see >> >> if they can solve this. >> > >> >modpost gets confused by the section named ".init.text.1" - the additional >> >'.1' >> >is unexpected. >> > >> >Following untested patch should fix it. >> > >> >> Still has the same problem. ;( >Could you please doublecheck that you applied the patch and modpost is rebuilt. >If you continue to see the problem could you send me the config (off-list) and >I will fix it. Sure thing. I got something like this: HOSTCC scripts/mod/modpost.o HOSTLD scripts/mod/modpost So modpost was rebuilt. And I am quite sure I had applied your patch. My .config is just the one provided by Toralf. If you need me to send you again, please tell me. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: build #343 issue for v2.6.24-rc8-29-g03bbe08 : Section mismatch: reference to .init.text.1:start_kernel (between 'is386' and 'check_x87')
On Fri, Jan 18, 2008 at 01:46:27PM +0100, Sam Ravnborg wrote: >On Fri, Jan 18, 2008 at 08:29:17PM +0800, WANG Cong wrote: >> On Fri, Jan 18, 2008 at 01:18:27PM +0100, Toralf Förster wrote: >> >Hello, >> > >> >the build with the attached .config was successful however I got during >> >make : >> > AS .tmp_kallsyms2.o >> > LD vmlinux.o >> > MODPOST vmlinux.o >> >WARNING: vmlinux.o(.text.head+0x247): Section mismatch: reference to >> >.init.text.1:start_kernel (between 'is386' and 'check_x87') >> > CHK include/linux/version.h >> > HOSTCC scripts/unifdef >> > MKDIR include >> > >> >Does it help / make sense to report such warning ? >> > >> >The build was made with : >> >$> make mrproper && make rndconfig && && make oldconfig >> >&& make >> > >> >Here's the config: >> >> Thanks. You have reported this. ;) >> >> I can't solve this problem. Let's Cc Rusty and Sam to see >> if they can solve this. > >modpost gets confused by the section named ".init.text.1" - the additional '.1' >is unexpected. > >Following untested patch should fix it. > Still has the same problem. ;( -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: build #343 issue for v2.6.24-rc8-29-g03bbe08 : Section mismatch: reference to .init.text.1:start_kernel (between 'is386' and 'check_x87')
On Fri, Jan 18, 2008 at 01:18:27PM +0100, Toralf Förster wrote: >Hello, > >the build with the attached .config was successful however I got during make : > AS .tmp_kallsyms2.o > LD vmlinux.o > MODPOST vmlinux.o >WARNING: vmlinux.o(.text.head+0x247): Section mismatch: reference to >.init.text.1:start_kernel (between 'is386' and 'check_x87') > CHK include/linux/version.h > HOSTCC scripts/unifdef > MKDIR include > >Does it help / make sense to report such warning ? > >The build was made with : >$> make mrproper && make rndconfig && && make oldconfig && >make > >Here's the config: Thanks. You have reported this. ;) I can't solve this problem. Let's Cc Rusty and Sam to see if they can solve this. Regards. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 1/2] Make kthread_create and kthread_run typesafe
On Fri, Jan 18, 2008 at 11:51:39AM +1100, Rusty Russell wrote: >With a little macro ugliness, we can make kthread_create() and >kthread_run() typesafe: avoid the casts to and from void *. To do >this we use a temporary function pointer which takes the type of the >data as a callback: if the function doesn't match, we get: > > warning: initialization from incompatible pointer type > >It's actually slightly over-strict, since a void * would be compatible >with any function type, but there's only one such case in the kernel >anyway. {snip} >+#define kthread_create(threadfn, data, namefmt...) ({ \ >+ int (*_threadfn)(typeof(data)) = (threadfn);\ >+ __kthread_create((void *)_threadfn, (data), namefmt); \ >+}) >+ >+struct task_struct *__kthread_create(int (*threadfn)(void *data), >+ void *data, >+ const char namefmt[], ...); Rusty, excellent work!! I really like this. It is a good trick, neat and clean. Thanks. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[-mm Patch] uml: fix a building error
This patch fixes this building error: ... drivers/char/mem.c: In function ‘read_mem’: drivers/char/mem.c:136: error: implicit declaration of function ‘unxlate_dev_mem_ptr’ ... Cc: Jeff Dike <[EMAIL PROTECTED]> Signed-off-by: WANG Cong <[EMAIL PROTECTED]> --- Index: linux/include/asm-um/io.h === --- linux.orig/include/asm-um/io.h +++ linux/include/asm-um/io.h @@ -27,6 +27,7 @@ static inline void * phys_to_virt(unsign * access */ #define xlate_dev_mem_ptr(p) __va(p) +#define unxlate_dev_mem_ptr(p, ptr) /* * Convert a virtual cached pointer to an uncached pointer -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[-mm Patch] UML: fix a building error
On Thu, Jan 17, 2008 at 02:35:14AM -0800, Andrew Morton wrote: > >ftp://ftp.kernel.org/pub/linux/kernel/people/akpm/patches/2.6/2.6.24-rc8/2.6.24-rc8-mm1/ > Hi, Andrew! Building uml failed in current -mm tree. ;( The below patch fixes this building error: ... include/asm/arch/system.h:8:22: error: asm/nops.h: No such file or directory ... Cc: Jeff Dike <[EMAIL PROTECTED]> Signed-off-by: WANG Cong <[EMAIL PROTECTED]> --- Index: linux/include/asm-um/nops.h === --- /dev/null +++ linux/include/asm-um/nops.h @@ -0,0 +1,6 @@ +#ifndef __UM_NOPS_H +#define __UM_NOPS_H + +#include "asm/arch/nops.h" + +#endif -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: translations (Re: Kbuild update)
> >ftp://flower.upol.cz/upload/Configure.help > >OK, please, take a look at stuff, Korean guys did 5-6 years ago. One >particular ARM port (S3C2410X) along with an ARM bootloader (vivi) was >done. Yet for some reason official Linux port has another developers, and, >it seems, it was done some time (~1-2 years) later. I glanced at the page. I don't know Korean, but it seems OK. What do you mean by saying this? I can't catch your points. >> I abosutely agree that we should focus on the exsiting bugs of Linux, >> but like Greg's inclusion of some kernel doc translations, this kind >> of work is really helpful to attract some kernel newbies from none >> English-speaking countries. Even we can't make offical efforts, >> the civil work, like TLKTP, is still worthy. >... > >> Believe me, I am leading a local LUG in my college and I found that one >> _big_ reason that why the newbies are afraid of Linux kernel is >> English, instead of the C tricks or low-level programming. > >IMHO, there is so much stuff done, that any brilliant C or whatever-asm >coder *have* to study at least something of it. And, in order to do a >valuable contribution, one must know the work-flow, people *and* English. >This is usually done by reading mailing list *and* archives for quite >some time. This takes time, this takes effort, but this also have huge >impact on intelligence and culture of the `coders'. > >Do you ever have a question about why History exists and is studied on >all levels of education? Same with programming. Without >history-via-English, one have no strong roots, thus base for grow and >flower. I think you've overstated. Translation does _not_ mean avoiding learning English. I agree with what you said above about English. But just as you said, it needs _time_ and translation *is* a good way to help this. I, myself, began to learn computer English by reading the translations of some famous English textbooks, and then reading the original ones. >OTOH, Internet has so much noise and crap all over the place, that >information is very hard to find. It takes much time to sort and see it. >Yet, providing noise generating, like in-tree translations, seems, is a >very easy way around (not taking maintaining in account). Translations can be put in .po files. Thanks. Cong -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [GIT PATCH] Update to Chinese documents
On Thu, Jan 10, 2008 at 12:48:56AM +0800, Bryan Wu wrote: >On Jan 9, 2008 7:54 PM, Sam Ravnborg <[EMAIL PROTECTED]> wrote: >> > > >> > > What is generally seen as a showstopper is the amount of work needed >> > > to do the translation - and keeping it up-to-date. >> > >> > Sure. The key is to have more participants to involve. The work can't >> > be done without a large contributor base. >> >> I already got positive feedback from Bryan Wu and WANG Cong so a Chinese >> translation is well within reach if we get the infrastructure adapted so >> we have better .po files support. >> > >Thanks. >As Leo said, we can host this project in zh-kernel.org and invite some >Chinese developers to boost up the translation. >WANG Cong is good to maintain this, -:)) Yes, I would like to do that work. Thank you. And I will also find some guys here to help me to do this. Please feel free to Cc me if you have any suggestions. Regards. Cong -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: (Try #3) [Patch 2/8] MIPS: Remove 'TOPDIR' from Makefiles
On Fri, Jan 11, 2008 at 06:02:04PM +0100, Sam Ravnborg wrote: >On Fri, Jan 11, 2008 at 02:17:54PM +, Ralf Baechle wrote: >> On Wed, Jan 02, 2008 at 02:21:36PM +0800, WANG Cong wrote: >> >> > >> Shouldn't that use $(LINUXINCLUDE), or $(KBUILD_CPPFLAGS)? >> > >It would be better to use $(LINUXINCLUDE) as we then pull in all config >> > >symbols too and do not have to hardcode kbuild internal names (include2). >> > >> > OK. Refine this patch. >> >> LDSCRIPT also needed fixing to get builds in a separate object directory >> working again. >> >> I've applied below fix. > >Great - I will drop it from my tree. > >See small comment below. > > Sam > > >> Ralf >> >> From 8babf06e1265214116fb8ffc634c04df85597c52 Mon Sep 17 00:00:00 2001 >> From: WANG Cong <[EMAIL PROTECTED]> >> Date: Wed, 2 Jan 2008 14:21:36 +0800 >> Subject: [PATCH] [MIPS] Lasat: Fix built in separate object directory. >> >> Signed-off-by: WANG Cong <[EMAIL PROTECTED]> >> >> [Ralf: The LDSCRIPT script needed fixing, too] >> >> Signed-off-by: Ralf Baechle <[EMAIL PROTECTED]> >> >> diff --git a/arch/mips/lasat/image/Makefile b/arch/mips/lasat/image/Makefile >> index 5332449..7ccd40d 100644 >> --- a/arch/mips/lasat/image/Makefile >> +++ b/arch/mips/lasat/image/Makefile >> @@ -12,11 +12,11 @@ endif >> >> MKLASATIMG = mklasatimg >> MKLASATIMG_ARCH = mq2,mqpro,sp100,sp200 >> -KERNEL_IMAGE = $(TOPDIR)/vmlinux >> +KERNEL_IMAGE = vmlinux >> KERNEL_START = $(shell $(NM) $(KERNEL_IMAGE) | grep " _text" | cut -f1 -d\ ) >> KERNEL_ENTRY = $(shell $(NM) $(KERNEL_IMAGE) | grep kernel_entry | cut -f1 >> -d\ ) >> >> -LDSCRIPT= -L$(obj) -Tromscript.normal >> +LDSCRIPT= -L$(srctree)/$(obj) -Tromscript.normal > >This needs to read: >> +LDSCRIPT= -L$(srctree)/$(src) -Tromscript.normal > > >(There is no difference between src and obj in normal cases but to be >consistent >it shuld be like above). Agreed. Thank you! -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: Kbuild update
>> > If we can make this to be an offical project for Linux kernel, I >> > think it won't be a big problem. >> >> We don't even manage to maintain the English language texts properly, >> and I am therefore not overly optimistic that we'll have the >> translations maintained properly for many years. >Italian was 100% translated at one point in time. >And the Linux Kernel Translation project has a number of >spelling error fixes in queue (I dunno if they have been applied). > >So even when run as an external project it was ok for some languages, >and having it official and someone taking patches to .po files would >for sure allow more users to build a kernel. > Agreed. That's the goal of TLKTP. Sam, can you contact to the author of TLKTP? Maybe we can talk to him to see if we can restart the project. If so, I can help with the Chinese translation part. Best regards. Cong -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: Kbuild update
> >"only" is the wrong word in this context. > >If someone would update the translations for one language every >3 months for the next years that would be great and disprove my >concerns. > >After all, updates every 3 months would beat the maintainance level of >at least three of our architectures... Hmm, yes. > >And don't underestimate the amount of work required - even when talking >about requiring "only" 10% of the help texts translated that's a four >digit number of lines to translate. Thanks for your point. I agree that the initial work is not so easy. > >> If we can make this to be an offical project for Linux kernel, I >> think it won't be a big problem. > >We don't even manage to maintain the English language texts properly, >and I am therefore not overly optimistic that we'll have the >translations maintained properly for many years. > >OTOH, if someone wouldn't just blindly translate the outdated English >texts but also review the English texts when translating this alone >might be worth it... Fully agreed. Maybe we can restart TLKTP? -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: translations (Re: Kbuild update)
>"I will use ... >http://images.google.cz/images?svnum=100&um=1&hl=cs&client=firefox-a&rls=org.mozilla%3Acs%3Aofficial&q=I+will+use+Google+before&btnG=Hledat+obr%C3%A1zky >... for making translations..." >http://www.google.com/translate?u=http%3A%2F%2Flxr.linux.no%2Flinux%2FDocumentation%2FHOWTO&langpair=en%7Czh-TW&hl=en&ie=UTF8 >? > >In case if people will help Google to have better quality of translation, >that will be better generally for much bigger number of *people*, >especially in China, isn't it? Perhaps yes. But at least now, that kind of translation still sucks. It can satisfy me. > >Making any official world-domination/new-world-order projects with >Linux will not help IMHO. Very fast code flow and almost no up to date >documentation is still relevant and google search + email archives >are not going to be obsolete in the near future. > >Also, future of the linux codebase with Chinese comments in C or in >ASM is kind of wired nightmare. Those, who cannot read actual source >code (i.e. C) will not go too far. > >So, translation guys, maybe you will stop making noise and will start >to make e.g. less buggy Linux? Greg KH have much more stuff to care, >than some translations IMHO. I never say to translate C comments. What we want to translate is the strings in Kconfig. I abosutely agree that we should focus on the exsiting bugs of Linux, but like Greg's inclusion of some kernel doc translations, this kind of work is really helpful to attract some kernel newbies from none English-speaking countries. Even we can't make offical efforts, the civil work, like TLKTP, is still worthy. Believe me, I am leading a local LUG in my college and I found that one _big_ reason that why the newbies are afraid of Linux kernel is English, instead of the C tricks or low-level programming. Regards. Cong -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: Kbuild update
>> It sort of stopped at one point due to missing integration in mainline. >> What I refer to is mostly the mconf.c bits, but I would also like to >> see what lkml says to a sample of .po files included in the kernel >> for a number of languages. >> >> One criteria to get a .po file integrated could be at least 10% of the >> strings translated or similar. Well, I think it's worthy. The translation effort will be valuable and much helpful for non-English-speaking peoples. > >Besides the initial translation efforts a big problem would be to >also find people who will regularly update the translations for >many years. > Yes, that's really a problem. But I think the updates won't be too frequent, only update for stable release is enough. If we can make this to be an offical project for Linux kernel, I think it won't be a big problem. Regards. Cong -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: Kbuild update
{snip} >TODO items (from my mailbox - I have plenty more) >= >- asm-offset useable from modules (Oleg had a half backed solution) >- modpost should use err(), warn() etc (suggestyed by Rusty) >- less kernel hardcoding in kconfig (Rob Landley) >- emit dependencies from "depends" (Bernhard Fischer) >- fix select (whatever that means) >- allow kconfig to accept overrides (Jan Engelhart) > maybe there is a patch, needs followup >- document kernel build better (Andreas Hermann) > just a start, more is needed >- save ARCH and CROSSCOMPILE > requires major surgery to do correct - we use CC too early >- i18n patch for mconf and friends (from Kernel Translator project) > is old but several bits of it needs to be applied to better support i18n Hmm, I glanced at that project. It's old and seems freezed now. I don't know if people still have interests in the i18n of kconfig. If so, I think I can help with the Chinese part. ;) >- i18n support in kernel > some like it, others don't. But now we have japanese versions of some docs... Well, in fact, we've already had some Chinese docs too. ;) Just have a look at Documentation/zh_CN/. >- use GCC --combine (David Woodhouse) >- more color themes (Jan Engelhart) > and I would like them selectable from inside menuconfig >- walk throug the ~15 qconf related patched - are they relevant? >- document use of __init and related sections >- Use seperate sections for all init sections to improve checking >- improve headers_check (10x speed up is possible by doing a dir-by-dir check) > >bugzilla.kernel.org >=== >7103 [EMAIL PROTECTED] NEW 2.6.17.*initramfs >problem >3174 [EMAIL PROTECTED] ASSI2.6.7 make rpm >creates erroneous version number >3486 [EMAIL PROTECTED] ASSI2.6.4-52"make clean" on >external driver will clean the kernel sou... >6860 [EMAIL PROTECTED] ASSI2.6.18-rc1 'make deb-pkg' >create incorrect package name >7042 [EMAIL PROTECTED] ASSI2.6.17.7Recursing into >/lib/modules/`uname -r`/build infects my b... >8275 [EMAIL PROTECTED] ASSI2.6.21-rc5-g28d... make >rpm-pkg broken for git cloned sources > I will take a look at the problems and see if I can help you. {snip} >Note: The kbuild stuff is done only in my spare time and > with 3 kids, a wife and a full-time job I am often lacking behind. Thanks for your work, Sam! -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[Patch] xfrm_policy_destroy: rename and relative fixes
Since __xfrm_policy_destroy is used to destory the resources allocated by xfrm_policy_alloc. So using the name __xfrm_policy_destroy is not correspond with xfrm_policy_alloc. Rename it to xfrm_policy_destroy. And along with some instances that call xfrm_policy_alloc but not using xfrm_policy_destroy to destroy the resource, fix them. Cc: David Miller <[EMAIL PROTECTED]> Cc: Herbert Xu <[EMAIL PROTECTED]> Signed-off-by: WANG Cong <[EMAIL PROTECTED]> --- diff --git a/include/net/xfrm.h b/include/net/xfrm.h index 58dfa82..6eff085 100644 --- a/include/net/xfrm.h +++ b/include/net/xfrm.h @@ -505,12 +505,12 @@ static inline void xfrm_pol_hold(struct xfrm_policy *policy) atomic_inc(&policy->refcnt); } -extern void __xfrm_policy_destroy(struct xfrm_policy *policy); +extern void xfrm_policy_destroy(struct xfrm_policy *policy); static inline void xfrm_pol_put(struct xfrm_policy *policy) { if (atomic_dec_and_test(&policy->refcnt)) - __xfrm_policy_destroy(policy); + xfrm_policy_destroy(policy); } #ifdef CONFIG_XFRM_SUB_POLICY diff --git a/net/key/af_key.c b/net/key/af_key.c index 26d5e63..3667f44 100644 --- a/net/key/af_key.c +++ b/net/key/af_key.c @@ -2291,8 +2291,7 @@ static int pfkey_spdadd(struct sock *sk, struct sk_buff *skb, struct sadb_msg *h return 0; out: - security_xfrm_policy_free(xp); - kfree(xp); + xfrm_policy_destroy(xp); return err; } @@ -3236,8 +3235,7 @@ static struct xfrm_policy *pfkey_compile_policy(struct sock *sk, int opt, return xp; out: - security_xfrm_policy_free(xp); - kfree(xp); + xfrm_policy_destroy(xp); return NULL; } diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c index 26b846e..087484e 100644 --- a/net/xfrm/xfrm_policy.c +++ b/net/xfrm/xfrm_policy.c @@ -206,7 +206,7 @@ EXPORT_SYMBOL(xfrm_policy_alloc); /* Destroy xfrm_policy: descendant resources must be released to this moment. */ -void __xfrm_policy_destroy(struct xfrm_policy *policy) +void xfrm_policy_destroy(struct xfrm_policy *policy) { BUG_ON(!policy->dead); @@ -218,7 +218,7 @@ void __xfrm_policy_destroy(struct xfrm_policy *policy) security_xfrm_policy_free(policy); kfree(policy); } -EXPORT_SYMBOL(__xfrm_policy_destroy); +EXPORT_SYMBOL(xfrm_policy_destroy); static void xfrm_policy_gc_kill(struct xfrm_policy *policy) { diff --git a/net/xfrm/xfrm_user.c b/net/xfrm/xfrm_user.c index e75dbdc..73cc755 100644 --- a/net/xfrm/xfrm_user.c +++ b/net/xfrm/xfrm_user.c @@ -1048,7 +1048,7 @@ static struct xfrm_policy *xfrm_policy_construct(struct xfrm_userpolicy_info *p, return xp; error: *errp = err; - kfree(xp); + xfrm_policy_destroy(xp); return NULL; } -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [Patch 0/8] Remove 'TOPDIR' from Makefiles
>Hi Wang. > >You a heads up. I will most likely apply >the remaining of the patches tonight, except the UM stuff >which I hope Jeff to take and the final removal of TOPDIR >may wait a bit. >I want the s390, xfs and um changes to hit -mm at least >and we have several external modules that uses TOPDIR. > >And some of these external modules I care about - not >all of them but some of them. > > Sam Thanks, Sam! Cong -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
(Try #3) [Patch 3/8] S390: Remove 'TOPDIR' from Makefile
>If the output file does not exist then kbuild does not care about the >dependencies and will just build the target. >On the second invocation when the target exists then kbuild has >created a file named ..cmd that list the dependencies >and this includes any included .c file. >So there is just no pint in defining this dependency explicit >in the MAkefile - kbuild will figure it out automatically. > >The right fix is just to kill the explicit listed dependency. If I understand you correctly, then the fix should be the below one. > This patch removes TOPDIR from arch/s390/kernel/Makefile. Cc: Martin Schwidefsky <[EMAIL PROTECTED]> Cc: Sam Ravnborg <[EMAIL PROTECTED]> Signed-off-by: WANG Cong <[EMAIL PROTECTED]> --- diff --git a/arch/s390/kernel/Makefile b/arch/s390/kernel/Makefile index 56cb710..b3b650a 100644 --- a/arch/s390/kernel/Makefile +++ b/arch/s390/kernel/Makefile @@ -31,7 +31,3 @@ S390_KEXEC_OBJS := machine_kexec.o crash.o S390_KEXEC_OBJS += $(if $(CONFIG_64BIT),relocate_kernel64.o,relocate_kernel.o) obj-$(CONFIG_KEXEC) += $(S390_KEXEC_OBJS) -# -# This is just to get the dependencies... -# -binfmt_elf32.o:$(TOPDIR)/fs/binfmt_elf.c -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
(Try #3) [Patch 4/8] CRIS: Remove 'TOPDIR' from Makefiles
Refine it as suggested by Andreas. > This patch removes TOPDIR from Cris Makefiles. Cc: Mikael Starvik <[EMAIL PROTECTED]> Cc: Sam Ravnborg <[EMAIL PROTECTED]> Cc: Andreas Schwab <[EMAIL PROTECTED]> Signed-off-by: WANG Cong <[EMAIL PROTECTED]> --- diff --git a/arch/cris/arch-v32/boot/compressed/Makefile b/arch/cris/arch-v32/boot/compressed/Makefile index 9f77eda..609692f 100644 --- a/arch/cris/arch-v32/boot/compressed/Makefile +++ b/arch/cris/arch-v32/boot/compressed/Makefile @@ -7,7 +7,7 @@ target = $(target_compressed_dir) src= $(src_compressed_dir) -CC = gcc-cris -mlinux -march=v32 -I $(TOPDIR)/include +CC = gcc-cris -mlinux -march=v32 $(LINUXINCLUDE) CFLAGS = -O2 LD = gcc-cris -mlinux -march=v32 -nostdlib OBJCOPY = objcopy-cris -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
(Try #3) [Patch 2/8] MIPS: Remove 'TOPDIR' from Makefiles
>> >> Shouldn't that use $(LINUXINCLUDE), or $(KBUILD_CPPFLAGS)? >It would be better to use $(LINUXINCLUDE) as we then pull in all config >symbols too and do not have to hardcode kbuild internal names (include2). OK. Refine this patch. ---> Since TOPDIR is obsolete, this patch removes TOPDIR from the Mips Makefiles. Cc: Ralf Baechle <[EMAIL PROTECTED]> Cc: Sam Ravnborg <[EMAIL PROTECTED]> Signed-off-by: WANG Cong <[EMAIL PROTECTED]> --- diff --git a/arch/mips/lasat/image/Makefile b/arch/mips/lasat/image/Makefile index 5332449..17f5266 100644 --- a/arch/mips/lasat/image/Makefile +++ b/arch/mips/lasat/image/Makefile @@ -12,7 +12,7 @@ endif MKLASATIMG = mklasatimg MKLASATIMG_ARCH = mq2,mqpro,sp100,sp200 -KERNEL_IMAGE = $(TOPDIR)/vmlinux +KERNEL_IMAGE = vmlinux KERNEL_START = $(shell $(NM) $(KERNEL_IMAGE) | grep " _text" | cut -f1 -d\ ) KERNEL_ENTRY = $(shell $(NM) $(KERNEL_IMAGE) | grep kernel_entry | cut -f1 -d\ ) @@ -24,7 +24,7 @@ HEAD_DEFINES := -D_kernel_start=0x$(KERNEL_START) \ -D TIMESTAMP=$(shell date +%s) $(obj)/head.o: $(obj)/head.S $(KERNEL_IMAGE) - $(CC) -fno-pic $(HEAD_DEFINES) -I$(TOPDIR)/include -c -o $@ $< + $(CC) -fno-pic $(HEAD_DEFINES) $(LINUXINCLUDE) -c -o $@ $< OBJECTS = head.o kImage.o -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
(Try #3) [Patch 7/8] FS: Remove dead code
On Tue, Jan 01, 2008 at 06:37:29PM +0100, Sam Ravnborg wrote: >On Tue, Jan 01, 2008 at 11:27:37AM -0600, Eric Sandeen wrote: >> WANG Cong wrote: >> > TOPDIR is obsolete, use objtree instead. >> > This patch removes TOPDIR from all fs/ Makefiles. >> >> > diff --git a/fs/xfs/Makefile b/fs/xfs/Makefile >> > index 49e3e7e..d1d3d49 100644 >> > --- a/fs/xfs/Makefile >> > +++ b/fs/xfs/Makefile >> > @@ -1 +1 @@ >> > -include $(TOPDIR)/fs/xfs/Makefile-linux-$(VERSION).$(PATCHLEVEL) >> > +include $(objtree)/fs/xfs/Makefile-linux-$(VERSION).$(PATCHLEVEL) >> >> FWIW $(TOPDIR) is already banished from the latest xfs build code: >> >Good - I will ignore the xfs bits. Thanks. I will drop the xfs part. ---> Remove dead code in smbfs makefile. Cc: Alexander Viro <[EMAIL PROTECTED]> Cc: Tim Shimmin <[EMAIL PROTECTED]> Cc: Sam Ravnborg <[EMAIL PROTECTED]> Signed-off-by: WANG Cong <[EMAIL PROTECTED]> --- diff --git a/fs/smbfs/Makefile b/fs/smbfs/Makefile index 6673ee8..4faf8c4 100644 --- a/fs/smbfs/Makefile +++ b/fs/smbfs/Makefile @@ -16,23 +16,3 @@ EXTRA_CFLAGS += -DSMBFS_PARANOIA #EXTRA_CFLAGS += -DDEBUG_SMB_TIMESTAMP #EXTRA_CFLAGS += -Werror -# -# Maintainer rules -# - -# getopt.c not included. It is intentionally separate -SRC = proc.c dir.c cache.c sock.c inode.c file.c ioctl.c smbiod.c request.c \ - symlink.c - -proto: - -rm -f proto.h - @echo > proto2.h "/*" - @echo >> proto2.h " * Autogenerated with cproto on: " `date` - @echo >> proto2.h " */" - @echo >> proto2.h "" - @echo >> proto2.h "struct smb_request;" - @echo >> proto2.h "struct sock;" - @echo >> proto2.h "struct statfs;" - @echo >> proto2.h "" - cproto -E "gcc -E" -e -v -I $(TOPDIR)/include -DMAKING_PROTO -D__KERNEL__ $(SRC) >> proto2.h - mv proto2.h proto.h -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: linux 0.01 released
On Tue, Jan 01, 2008 at 09:56:59PM +0100, Abdel wrote: >Hello everybody and happy new year, > > >I have ported linux 0.01 to gcc-4.x, and bach-3.2 (and few others >programs) can run on it. > >so you will find binary Image of linux 0.01 floppy and qemu hdd here: >http://draconux.free.fr/download/os-dev/linux0.01/Image/ > >to run it on qemu : >> qemu -hdb hd_oldlinux.img -fda linux-0.01-3.3.omg -boot a >nb : also work with bochs, and I have not tested it (yet) on real computer. > Excellent work! Thank you! I think this work is useful for teaching OS newbies. So I will forward this mail to the professors of our CS dept.. Thanks again and happy new year! Cong -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
(Try #2) [Patch 7/8] FS: Drop 'TOPDIR' from Makefiles and remove some dead code
> >The whole "Maintainer rules" part of this file should be deleted. >I cannot see how it can be used anyway. Agreed. I delete them all and renew the patch. Passed compiling test. -> This patch drops TOPDIR since it's obsolete and removes some dead code from fs/smbfs/Makefile. Cc: Alexander Viro <[EMAIL PROTECTED]> Cc: Tim Shimmin <[EMAIL PROTECTED]> Cc: Sam Ravnborg <[EMAIL PROTECTED]> Signed-off-by: WANG Cong <[EMAIL PROTECTED]> --- diff --git a/fs/smbfs/Makefile b/fs/smbfs/Makefile index 6673ee8..4faf8c4 100644 --- a/fs/smbfs/Makefile +++ b/fs/smbfs/Makefile @@ -16,23 +16,3 @@ EXTRA_CFLAGS += -DSMBFS_PARANOIA #EXTRA_CFLAGS += -DDEBUG_SMB_TIMESTAMP #EXTRA_CFLAGS += -Werror -# -# Maintainer rules -# - -# getopt.c not included. It is intentionally separate -SRC = proc.c dir.c cache.c sock.c inode.c file.c ioctl.c smbiod.c request.c \ - symlink.c - -proto: - -rm -f proto.h - @echo > proto2.h "/*" - @echo >> proto2.h " * Autogenerated with cproto on: " `date` - @echo >> proto2.h " */" - @echo >> proto2.h "" - @echo >> proto2.h "struct smb_request;" - @echo >> proto2.h "struct sock;" - @echo >> proto2.h "struct statfs;" - @echo >> proto2.h "" - cproto -E "gcc -E" -e -v -I $(TOPDIR)/include -DMAKING_PROTO -D__KERNEL__ $(SRC) >> proto2.h - mv proto2.h proto.h diff --git a/fs/xfs/Makefile b/fs/xfs/Makefile index 49e3e7e..d1d3d49 100644 --- a/fs/xfs/Makefile +++ b/fs/xfs/Makefile @@ -1 +1 @@ -include $(TOPDIR)/fs/xfs/Makefile-linux-$(VERSION).$(PATCHLEVEL) +include $(objtree)/fs/xfs/Makefile-linux-$(VERSION).$(PATCHLEVEL) -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
(Try #2) [Patch 6/8] FRV: Drop 'TOPDIR' from Makefiles
> >In this file we can just drop use of $(TOPDIR) since this is our >current directory anyway. Thanks! > This patch drops TOPDIR from frv Makefiles. Cc: David Howells <[EMAIL PROTECTED]> Cc: Sam Ravnborg <[EMAIL PROTECTED]> Signed-off-by: WANG Cong <[EMAIL PROTECTED]> --- diff --git a/arch/frv/boot/Makefile b/arch/frv/boot/Makefile index dc6f038..6ae3254 100644 --- a/arch/frv/boot/Makefile +++ b/arch/frv/boot/Makefile @@ -10,7 +10,7 @@ targets := Image zImage bootpImage -SYSTEM =$(TOPDIR)/$(LINUX) +SYSTEM =$(LINUX) ZTEXTADDR = 0x0208 PARAMS_PHYS = 0x0207c000 @@ -45,7 +45,7 @@ zImage: $(CONFIGURE) compressed/$(LINUX) bootpImage: bootp/bootp $(OBJCOPY) -O binary -R .note -R .comment -S bootp/bootp $@ -compressed/$(LINUX): $(TOPDIR)/$(LINUX) dep +compressed/$(LINUX): $(LINUX) dep @$(MAKE) -C compressed $(LINUX) bootp/bootp: zImage initrd @@ -59,10 +59,10 @@ initrd: # installation # install: $(CONFIGURE) Image - sh ./install.sh $(KERNELRELEASE) Image $(TOPDIR)/System.map "$(INSTALL_PATH)" + sh ./install.sh $(KERNELRELEASE) Image System.map "$(INSTALL_PATH)" zinstall: $(CONFIGURE) zImage - sh ./install.sh $(KERNELRELEASE) zImage $(TOPDIR)/System.map "$(INSTALL_PATH)" + sh ./install.sh $(KERNELRELEASE) zImage System.map "$(INSTALL_PATH)" # # miscellany -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
(Try #2) [Patch 5/8] INFINIBAND: Remove 'TOPDIR' from Makefiles
>> -EXTRA_CFLAGS += -I$(TOPDIR)/drivers/net/cxgb3 \ >> --I$(TOPDIR)/drivers/infiniband/hw/cxgb3/core > >> +EXTRA_CFLAGS += -I$(objtree)/drivers/net/cxgb3 \ >Drop $(TOPDIR) like this: >> +EXTRA_CFLAGS += -Idrivers/net/cxgb3 \ > >> +-I$(objtree)/drivers/infiniband/hw/cxgb3/core >And this line can be deleted - there is no such directory. >At least not in my tree. Yes, correct. Thank you. ---> This patch removes TOPDIR from infiniband Makefiles. Cc: Sam Ravnborg <[EMAIL PROTECTED]> Cc: Roland Dreier <[EMAIL PROTECTED]> Cc: Sean Hefty <[EMAIL PROTECTED]> Cc: Hal Rosenstock <[EMAIL PROTECTED]> Signed-off-by: WANG Cong <[EMAIL PROTECTED]> --- diff --git a/drivers/infiniband/hw/cxgb3/Makefile b/drivers/infiniband/hw/cxgb3/Makefile index 36b9898..7e7b5a6 100644 --- a/drivers/infiniband/hw/cxgb3/Makefile +++ b/drivers/infiniband/hw/cxgb3/Makefile @@ -1,5 +1,4 @@ -EXTRA_CFLAGS += -I$(TOPDIR)/drivers/net/cxgb3 \ - -I$(TOPDIR)/drivers/infiniband/hw/cxgb3/core +EXTRA_CFLAGS += -Idrivers/net/cxgb3 obj-$(CONFIG_INFINIBAND_CXGB3) += iw_cxgb3.o -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
(Try #2) [Patch 4/8] CRIS: Remove 'TOPDIR' from Makefiles
>> -CC = gcc-cris -mlinux -march=v32 -I $(TOPDIR)/include >> +CC = gcc-cris -mlinux -march=v32 -I $(objtree)/include > >As in the mips case the right fix is to use: >> +CC = gcc-cris -mlinux -march=v32 -Iinclude -Iinclude2 > >In this way we pick up the includes also in the O=.. >case. Thanks, Sam! Resend it. ;) -> This patch removes TOPDIR from Cris Makefiles. Cc: Mikael Starvik <[EMAIL PROTECTED]> Cc: Sam Ravnborg <[EMAIL PROTECTED]> Signed-off-by: WANG Cong <[EMAIL PROTECTED]> --- diff --git a/arch/cris/arch-v32/boot/compressed/Makefile b/arch/cris/arch-v32/boot/compressed/Makefile index 9f77eda..27e9f15 100644 --- a/arch/cris/arch-v32/boot/compressed/Makefile +++ b/arch/cris/arch-v32/boot/compressed/Makefile @@ -7,7 +7,7 @@ target = $(target_compressed_dir) src= $(src_compressed_dir) -CC = gcc-cris -mlinux -march=v32 -I $(TOPDIR)/include +CC = gcc-cris -mlinux -march=v32 -Iinclude -Iinclude2 CFLAGS = -O2 LD = gcc-cris -mlinux -march=v32 -nostdlib OBJCOPY = objcopy-cris -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
(Try #2) [Patch 3/8] S390: Tiny fixes for Makefile
>> -binfmt_elf32.o: $(TOPDIR)/fs/binfmt_elf.c >> +binfmt_elf32.o: $(objtree)/fs/binfmt_elf.c > >This prerequisite listing looks just bogus and should be removed altogether. >We only need to list prerequisites explicit for generated files. Not so sure whether this is what s390 people do on purpose. Thanks anyway! The following one contains the new fix. > This patch removes TOPDIR and fixes a bogus prerequisite in arch/s390/kernel/Makefile. Cc: Martin Schwidefsky <[EMAIL PROTECTED]> Cc: Sam Ravnborg <[EMAIL PROTECTED]> Signed-off-by: WANG Cong <[EMAIL PROTECTED]> diff --git a/arch/s390/kernel/Makefile b/arch/s390/kernel/Makefile index 56cb710..4accf27 100644 --- a/arch/s390/kernel/Makefile +++ b/arch/s390/kernel/Makefile @@ -20,7 +20,7 @@ obj-$(CONFIG_AUDIT) += audit.o compat-obj-$(CONFIG_AUDIT) += compat_audit.o obj-$(CONFIG_COMPAT) += compat_linux.o compat_signal.o \ compat_wrapper.o compat_exec_domain.o \ - binfmt_elf32.o $(compat-obj-y) + binfmt_elf.o $(compat-obj-y) obj-$(CONFIG_VIRT_TIMER) += vtime.o obj-$(CONFIG_STACKTRACE) += stacktrace.o @@ -34,4 +34,4 @@ obj-$(CONFIG_KEXEC) += $(S390_KEXEC_OBJS) # # This is just to get the dependencies... # -binfmt_elf32.o:$(TOPDIR)/fs/binfmt_elf.c +binfmt_elf.o: $(objtree)/fs/binfmt_elf.c -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
(Try #2) [Patch 2/8] MIPS: Remove 'TOPDIR' from Makefiles
>> -KERNEL_IMAGE = $(TOPDIR)/vmlinux >> +KERNEL_IMAGE = $(objtree)/vmlinux > >Current directory when building is $(objtree) so here we should >just skip the use of TOPDIR like this: >> +KERNEL_IMAGE = vmlinux > > >> KERNEL_START = $(shell $(NM) $(KERNEL_IMAGE) | grep " _text" | cut -f1 -d\ ) >> KERNEL_ENTRY = $(shell $(NM) $(KERNEL_IMAGE) | grep kernel_entry | cut -f1 >> -d\ ) >> >> @@ -24,7 +24,7 @@ HEAD_DEFINES := -D_kernel_start=0x$(KERNEL_START) \ >> -D TIMESTAMP=$(shell date +%s) >> >> $(obj)/head.o: $(obj)/head.S $(KERNEL_IMAGE) >> -$(CC) -fno-pic $(HEAD_DEFINES) -I$(TOPDIR)/include -c -o $@ $< >> +$(CC) -fno-pic $(HEAD_DEFINES) -I$(objtree)/include -c -o $@ $< >This has never worked with O=.. builds. >The correct fix here is to use: >> +$(CC) -fno-pic $(HEAD_DEFINES) -Iinclude -Iinclude2 -c -o $@ $< > >The -Iinclude2 is only for O=... builds so to keep current >behaviour removing $(TOPDIR)/ would do it. Thank you for your explanations! The following one corrects all the mistakes as you told. ---> Since TOPDIR is obsolete, this patch removes TOPDIR from the Mips Makefiles. Cc: Ralf Baechle <[EMAIL PROTECTED]> Cc: Sam Ravnborg <[EMAIL PROTECTED]> Signed-off-by: WANG Cong <[EMAIL PROTECTED]> --- diff --git a/arch/mips/lasat/image/Makefile b/arch/mips/lasat/image/Makefile index 5332449..1ae73ce 100644 --- a/arch/mips/lasat/image/Makefile +++ b/arch/mips/lasat/image/Makefile @@ -12,7 +12,7 @@ endif MKLASATIMG = mklasatimg MKLASATIMG_ARCH = mq2,mqpro,sp100,sp200 -KERNEL_IMAGE = $(TOPDIR)/vmlinux +KERNEL_IMAGE = vmlinux KERNEL_START = $(shell $(NM) $(KERNEL_IMAGE) | grep " _text" | cut -f1 -d\ ) KERNEL_ENTRY = $(shell $(NM) $(KERNEL_IMAGE) | grep kernel_entry | cut -f1 -d\ ) @@ -24,7 +24,7 @@ HEAD_DEFINES := -D_kernel_start=0x$(KERNEL_START) \ -D TIMESTAMP=$(shell date +%s) $(obj)/head.o: $(obj)/head.S $(KERNEL_IMAGE) - $(CC) -fno-pic $(HEAD_DEFINES) -I$(TOPDIR)/include -c -o $@ $< + $(CC) -fno-pic $(HEAD_DEFINES) -Iinclude -Iinclude2 -c -o $@ $< OBJECTS = head.o kImage.o -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
(Try #2) [Patch 1/8] UML: Remove 'TOPDIR' from Makefiles
On Tue, Jan 01, 2008 at 11:49:42AM +0100, Sam Ravnborg wrote: >On Tue, Jan 01, 2008 at 11:33:42AM +0100, Sam Ravnborg wrote: >> On Tue, Jan 01, 2008 at 03:18:46PM +0800, WANG Cong wrote: >> > >> > TOPDIR is obsolete, use objtree instead. >> > This patch removes TOPDIR from all UML Makefiles. >> > >> >> I do not feel confident with these changes. >> In some places I had expected to see srctree and not objtree. >> I would like to see this tested before applying it. >> >> Building a ppc toolchain now to test it... > >It seems that building a ppc based um kernel is not supported >in mainline. >Kconfig.ppc is missing and when creating it um build fails >in sys-ppc/ due to user-offset.c is missing. > >As most of your patch touches ppc specific code I suggest >to just replace TOPDIR with srctree all over (no semantic change) >and the the um people can figure out the ppc stuff when they get to it. You're right. I use srctree instead. And tested with: $ make O=../foobar/ ARCH=um linux It works fine. Thanks for your points! > TOPDIR is obsolete, use srctree instead. This patch removes TOPDIR from all UML Makefiles. Cc: Jeff Dike <[EMAIL PROTECTED]> Cc: Sam Ravnborg <[EMAIL PROTECTED]> Signed-off-by: WANG Cong <[EMAIL PROTECTED]> --- diff --git a/arch/um/Makefile b/arch/um/Makefile index ba6813a..08a2865 100644 --- a/arch/um/Makefile +++ b/arch/um/Makefile @@ -158,7 +158,7 @@ ifneq ($(KBUILD_SRC),) $(Q)mkdir -p $(objtree)/include/asm-um $(Q)ln -fsn $(srctree)/include/asm-um/$(basename $(notdir $@))-$(SUBARCH)$(suffix $@) $@ else - $(Q)cd $(TOPDIR)/$(dir $@) ; \ + $(Q)cd $(srctree)/$(dir $@) ; \ ln -sf $(basename $(notdir $@))-$(SUBARCH)$(suffix $@) $(notdir $@) endif @@ -168,7 +168,7 @@ ifneq ($(KBUILD_SRC),) $(Q)mkdir -p $(objtree)/include/asm-um $(Q)ln -fsn $(srctree)/include/asm-$(HEADER_ARCH) include/asm-um/arch else - $(Q)cd $(TOPDIR)/include/asm-um && ln -fsn ../asm-$(HEADER_ARCH) arch + $(Q)cd $(srctree)/include/asm-um && ln -fsn ../asm-$(HEADER_ARCH) arch endif $(objtree)/$(ARCH_DIR)/include: diff --git a/arch/um/sys-ppc/Makefile b/arch/um/sys-ppc/Makefile index a9814a7..0890152 100644 --- a/arch/um/sys-ppc/Makefile +++ b/arch/um/sys-ppc/Makefile @@ -6,7 +6,7 @@ OBJ = built-in.o OBJS = ptrace.o sigcontext.o semaphore.o checksum.o miscthings.o misc.o \ ptrace_user.o sysrq.o -EXTRA_AFLAGS := -DCONFIG_PPC32 -I. -I$(TOPDIR)/arch/ppc/kernel +EXTRA_AFLAGS := -DCONFIG_PPC32 -I. -I$(srctree)/arch/ppc/kernel all: $(OBJ) @@ -22,25 +22,25 @@ sigcontext.o: sigcontext.c semaphore.c: rm -f $@ - ln -s $(TOPDIR)/arch/ppc/kernel/$@ $@ + ln -s $(srctree)/arch/ppc/kernel/$@ $@ checksum.S: rm -f $@ - ln -s $(TOPDIR)/arch/ppc/lib/$@ $@ + ln -s $(srctree)/arch/ppc/lib/$@ $@ mk_defs.c: rm -f $@ - ln -s $(TOPDIR)/arch/ppc/kernel/$@ $@ + ln -s $(srctree)/arch/ppc/kernel/$@ $@ ppc_defs.head: rm -f $@ - ln -s $(TOPDIR)/arch/ppc/kernel/$@ $@ + ln -s $(srctree)/arch/ppc/kernel/$@ $@ ppc_defs.h: mk_defs.c ppc_defs.head \ - $(TOPDIR)/include/asm-ppc/mmu.h \ - $(TOPDIR)/include/asm-ppc/processor.h \ - $(TOPDIR)/include/asm-ppc/pgtable.h \ - $(TOPDIR)/include/asm-ppc/ptrace.h + $(srctree)/include/asm-ppc/mmu.h \ + $(srctree)/include/asm-ppc/processor.h \ + $(srctree)/include/asm-ppc/pgtable.h \ + $(srctree)/include/asm-ppc/ptrace.h # $(CC) $(CFLAGS) -S mk_defs.c cp ppc_defs.head ppc_defs.h # for bk, this way we can write to the file even if it's not checked out @@ -56,13 +56,13 @@ ppc_defs.h: mk_defs.c ppc_defs.head \ checksum.o: checksum.S rm -f asm - ln -s $(TOPDIR)/include/asm-ppc asm + ln -s $(srctree)/include/asm-ppc asm $(CC) $(EXTRA_AFLAGS) $(KBUILD_AFLAGS) -D__ASSEMBLY__ -D__UM_PPC__ -c $< -o $*.o rm -f asm misc.o: misc.S ppc_defs.h rm -f asm - ln -s $(TOPDIR)/include/asm-ppc asm + ln -s $(srctree)/include/asm-ppc asm $(CC) $(EXTRA_AFLAGS) $(KBUILD_AFLAGS) -D__ASSEMBLY__ -D__UM_PPC__ -c $< -o $*.o rm -f asm -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[Patch 8/8] Remove 'TOPDIR' from the Top Makefile
TOPDIR is obsolete, thus can be removed. This patch removes TOPDIR from the top Makefile. Cc: Sam Ravnborg <[EMAIL PROTECTED]> Signed-off-by: WANG Cong <[EMAIL PROTECTED]> --- diff --git a/Makefile b/Makefile index fbb8dfc..c892d14 100644 --- a/Makefile +++ b/Makefile @@ -148,15 +148,13 @@ _all: modules endif srctree:= $(if $(KBUILD_SRC),$(KBUILD_SRC),$(CURDIR)) -TOPDIR := $(srctree) -# FIXME - TOPDIR is obsolete, use srctree/objtree objtree:= $(CURDIR) src:= $(srctree) obj:= $(objtree) VPATH := $(srctree)$(if $(KBUILD_EXTMOD),:$(KBUILD_EXTMOD)) -export srctree objtree VPATH TOPDIR +export srctree objtree VPATH # SUBARCH tells the usermode build what the underlying arch is. That is set -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[Patch 7/8] FS: Remove 'TOPDIR' from Makefiles
TOPDIR is obsolete, use objtree instead. This patch removes TOPDIR from all fs/ Makefiles. Cc: Alexander Viro <[EMAIL PROTECTED]> Cc: Tim Shimmin <[EMAIL PROTECTED]> Cc: Sam Ravnborg <[EMAIL PROTECTED]> Signed-off-by: WANG Cong <[EMAIL PROTECTED]> --- diff --git a/fs/smbfs/Makefile b/fs/smbfs/Makefile index 6673ee8..9b5e92b 100644 --- a/fs/smbfs/Makefile +++ b/fs/smbfs/Makefile @@ -34,5 +34,5 @@ proto: @echo >> proto2.h "struct sock;" @echo >> proto2.h "struct statfs;" @echo >> proto2.h "" - cproto -E "gcc -E" -e -v -I $(TOPDIR)/include -DMAKING_PROTO -D__KERNEL__ $(SRC) >> proto2.h + cproto -E "gcc -E" -e -v -I $(objtree)/include -DMAKING_PROTO -D__KERNEL__ $(SRC) >> proto2.h mv proto2.h proto.h diff --git a/fs/xfs/Makefile b/fs/xfs/Makefile index 49e3e7e..d1d3d49 100644 --- a/fs/xfs/Makefile +++ b/fs/xfs/Makefile @@ -1 +1 @@ -include $(TOPDIR)/fs/xfs/Makefile-linux-$(VERSION).$(PATCHLEVEL) +include $(objtree)/fs/xfs/Makefile-linux-$(VERSION).$(PATCHLEVEL) -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[Patch 6/8] FRV: Remove 'TOPDIR' from Makefiles
TOPDIR is obsolete, use objtree instead. This patch removes TOPDIR from all frv Makefiles. Cc: David Howells <[EMAIL PROTECTED]> Cc: Sam Ravnborg <[EMAIL PROTECTED]> Signed-off-by: WANG Cong <[EMAIL PROTECTED]> --- diff --git a/arch/frv/boot/Makefile b/arch/frv/boot/Makefile index dc6f038..d93f768 100644 --- a/arch/frv/boot/Makefile +++ b/arch/frv/boot/Makefile @@ -10,7 +10,7 @@ targets := Image zImage bootpImage -SYSTEM =$(TOPDIR)/$(LINUX) +SYSTEM =$(objtree)/$(LINUX) ZTEXTADDR = 0x0208 PARAMS_PHYS = 0x0207c000 @@ -45,7 +45,7 @@ zImage: $(CONFIGURE) compressed/$(LINUX) bootpImage: bootp/bootp $(OBJCOPY) -O binary -R .note -R .comment -S bootp/bootp $@ -compressed/$(LINUX): $(TOPDIR)/$(LINUX) dep +compressed/$(LINUX): $(objtree)/$(LINUX) dep @$(MAKE) -C compressed $(LINUX) bootp/bootp: zImage initrd @@ -59,10 +59,10 @@ initrd: # installation # install: $(CONFIGURE) Image - sh ./install.sh $(KERNELRELEASE) Image $(TOPDIR)/System.map "$(INSTALL_PATH)" + sh ./install.sh $(KERNELRELEASE) Image $(objtree)/System.map "$(INSTALL_PATH)" zinstall: $(CONFIGURE) zImage - sh ./install.sh $(KERNELRELEASE) zImage $(TOPDIR)/System.map "$(INSTALL_PATH)" + sh ./install.sh $(KERNELRELEASE) zImage $(objtree)/System.map "$(INSTALL_PATH)" # # miscellany -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[Patch 5/8] INFINIBAND: Remove 'TOPDIR' from Makefiles
TOPDIR is obsolete, use objtree instead. This patch removes TOPDIR from all infiniband Makefiles. Cc: Sam Ravnborg <[EMAIL PROTECTED]> Cc: Roland Dreier <[EMAIL PROTECTED]> Cc: Sean Hefty <[EMAIL PROTECTED]> Cc: Hal Rosenstock <[EMAIL PROTECTED]> Signed-off-by: WANG Cong <[EMAIL PROTECTED]> --- diff --git a/drivers/infiniband/hw/cxgb3/Makefile b/drivers/infiniband/hw/cxgb3/Makefile index 36b9898..b82286a 100644 --- a/drivers/infiniband/hw/cxgb3/Makefile +++ b/drivers/infiniband/hw/cxgb3/Makefile @@ -1,5 +1,5 @@ -EXTRA_CFLAGS += -I$(TOPDIR)/drivers/net/cxgb3 \ - -I$(TOPDIR)/drivers/infiniband/hw/cxgb3/core +EXTRA_CFLAGS += -I$(objtree)/drivers/net/cxgb3 \ + -I$(objtree)/drivers/infiniband/hw/cxgb3/core obj-$(CONFIG_INFINIBAND_CXGB3) += iw_cxgb3.o -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[Patch 4/8] CRIS: Remove 'TOPDIR' from Makefiles
TOPDIR is obsolete, use objtree instead. This patch removes TOPDIR from all Cris Makefiles. Cc: Mikael Starvik <[EMAIL PROTECTED]> Cc: Sam Ravnborg <[EMAIL PROTECTED]> Signed-off-by: WANG Cong <[EMAIL PROTECTED]> --- diff --git a/arch/cris/arch-v32/boot/compressed/Makefile b/arch/cris/arch-v32/boot/compressed/Makefile index 9f77eda..8586922 100644 --- a/arch/cris/arch-v32/boot/compressed/Makefile +++ b/arch/cris/arch-v32/boot/compressed/Makefile @@ -7,7 +7,7 @@ target = $(target_compressed_dir) src= $(src_compressed_dir) -CC = gcc-cris -mlinux -march=v32 -I $(TOPDIR)/include +CC = gcc-cris -mlinux -march=v32 -I $(objtree)/include CFLAGS = -O2 LD = gcc-cris -mlinux -march=v32 -nostdlib OBJCOPY = objcopy-cris -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[Patch 3/8] S390: Remove 'TOPDIR' from Makefiles
TOPDIR is obsolete, use objtree instead. This patch removes TOPDIR from all s390 Makefiles. Cc: Martin Schwidefsky <[EMAIL PROTECTED]> Cc: Sam Ravnborg <[EMAIL PROTECTED]> Signed-off-by: WANG Cong <[EMAIL PROTECTED]> --- diff --git a/arch/s390/kernel/Makefile b/arch/s390/kernel/Makefile index 56cb710..a753a71 100644 --- a/arch/s390/kernel/Makefile +++ b/arch/s390/kernel/Makefile @@ -34,4 +34,4 @@ obj-$(CONFIG_KEXEC) += $(S390_KEXEC_OBJS) # # This is just to get the dependencies... # -binfmt_elf32.o:$(TOPDIR)/fs/binfmt_elf.c +binfmt_elf32.o:$(objtree)/fs/binfmt_elf.c -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[Patch 2/8] MIPS: Remove 'TOPDIR' from Makefiles
TOPDIR is obsolete, use objtree instead. This patch removes TOPDIR from all Mips Makefiles. Cc: Ralf Baechle <[EMAIL PROTECTED]> Cc: Sam Ravnborg <[EMAIL PROTECTED]> Signed-off-by: WANG Cong <[EMAIL PROTECTED]> --- diff --git a/arch/mips/lasat/image/Makefile b/arch/mips/lasat/image/Makefile index 5332449..5196962 100644 --- a/arch/mips/lasat/image/Makefile +++ b/arch/mips/lasat/image/Makefile @@ -12,7 +12,7 @@ endif MKLASATIMG = mklasatimg MKLASATIMG_ARCH = mq2,mqpro,sp100,sp200 -KERNEL_IMAGE = $(TOPDIR)/vmlinux +KERNEL_IMAGE = $(objtree)/vmlinux KERNEL_START = $(shell $(NM) $(KERNEL_IMAGE) | grep " _text" | cut -f1 -d\ ) KERNEL_ENTRY = $(shell $(NM) $(KERNEL_IMAGE) | grep kernel_entry | cut -f1 -d\ ) @@ -24,7 +24,7 @@ HEAD_DEFINES := -D_kernel_start=0x$(KERNEL_START) \ -D TIMESTAMP=$(shell date +%s) $(obj)/head.o: $(obj)/head.S $(KERNEL_IMAGE) - $(CC) -fno-pic $(HEAD_DEFINES) -I$(TOPDIR)/include -c -o $@ $< + $(CC) -fno-pic $(HEAD_DEFINES) -I$(objtree)/include -c -o $@ $< OBJECTS = head.o kImage.o -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[Patch 1/8] UML: Remove 'TOPDIR' from Makefiles
TOPDIR is obsolete, use objtree instead. This patch removes TOPDIR from all UML Makefiles. Cc: Jeff Dike <[EMAIL PROTECTED]> Cc: Sam Ravnborg <[EMAIL PROTECTED]> Signed-off-by: WANG Cong <[EMAIL PROTECTED]> --- diff --git a/arch/um/Makefile b/arch/um/Makefile index ba6813a..57491af 100644 --- a/arch/um/Makefile +++ b/arch/um/Makefile @@ -158,7 +158,7 @@ ifneq ($(KBUILD_SRC),) $(Q)mkdir -p $(objtree)/include/asm-um $(Q)ln -fsn $(srctree)/include/asm-um/$(basename $(notdir $@))-$(SUBARCH)$(suffix $@) $@ else - $(Q)cd $(TOPDIR)/$(dir $@) ; \ + $(Q)cd $(objtree)/$(dir $@) ; \ ln -sf $(basename $(notdir $@))-$(SUBARCH)$(suffix $@) $(notdir $@) endif @@ -168,7 +168,7 @@ ifneq ($(KBUILD_SRC),) $(Q)mkdir -p $(objtree)/include/asm-um $(Q)ln -fsn $(srctree)/include/asm-$(HEADER_ARCH) include/asm-um/arch else - $(Q)cd $(TOPDIR)/include/asm-um && ln -fsn ../asm-$(HEADER_ARCH) arch + $(Q)cd $(objtree)/include/asm-um && ln -fsn ../asm-$(HEADER_ARCH) arch endif $(objtree)/$(ARCH_DIR)/include: diff --git a/arch/um/sys-ppc/Makefile b/arch/um/sys-ppc/Makefile index a9814a7..a3cfae7 100644 --- a/arch/um/sys-ppc/Makefile +++ b/arch/um/sys-ppc/Makefile @@ -6,7 +6,7 @@ OBJ = built-in.o OBJS = ptrace.o sigcontext.o semaphore.o checksum.o miscthings.o misc.o \ ptrace_user.o sysrq.o -EXTRA_AFLAGS := -DCONFIG_PPC32 -I. -I$(TOPDIR)/arch/ppc/kernel +EXTRA_AFLAGS := -DCONFIG_PPC32 -I. -I$(objtree)/arch/ppc/kernel all: $(OBJ) @@ -22,25 +22,25 @@ sigcontext.o: sigcontext.c semaphore.c: rm -f $@ - ln -s $(TOPDIR)/arch/ppc/kernel/$@ $@ + ln -s $(objtree)/arch/ppc/kernel/$@ $@ checksum.S: rm -f $@ - ln -s $(TOPDIR)/arch/ppc/lib/$@ $@ + ln -s $(objtree)/arch/ppc/lib/$@ $@ mk_defs.c: rm -f $@ - ln -s $(TOPDIR)/arch/ppc/kernel/$@ $@ + ln -s $(objtree)/arch/ppc/kernel/$@ $@ ppc_defs.head: rm -f $@ - ln -s $(TOPDIR)/arch/ppc/kernel/$@ $@ + ln -s $(objtree)/arch/ppc/kernel/$@ $@ ppc_defs.h: mk_defs.c ppc_defs.head \ - $(TOPDIR)/include/asm-ppc/mmu.h \ - $(TOPDIR)/include/asm-ppc/processor.h \ - $(TOPDIR)/include/asm-ppc/pgtable.h \ - $(TOPDIR)/include/asm-ppc/ptrace.h + $(objtree)/include/asm-ppc/mmu.h \ + $(objtree)/include/asm-ppc/processor.h \ + $(objtree)/include/asm-ppc/pgtable.h \ + $(objtree)/include/asm-ppc/ptrace.h # $(CC) $(CFLAGS) -S mk_defs.c cp ppc_defs.head ppc_defs.h # for bk, this way we can write to the file even if it's not checked out @@ -56,13 +56,13 @@ ppc_defs.h: mk_defs.c ppc_defs.head \ checksum.o: checksum.S rm -f asm - ln -s $(TOPDIR)/include/asm-ppc asm + ln -s $(objtree)/include/asm-ppc asm $(CC) $(EXTRA_AFLAGS) $(KBUILD_AFLAGS) -D__ASSEMBLY__ -D__UM_PPC__ -c $< -o $*.o rm -f asm misc.o: misc.S ppc_defs.h rm -f asm - ln -s $(TOPDIR)/include/asm-ppc asm + ln -s $(objtree)/include/asm-ppc asm $(CC) $(EXTRA_AFLAGS) $(KBUILD_AFLAGS) -D__ASSEMBLY__ -D__UM_PPC__ -c $< -o $*.o rm -f asm diff --git a/arch/x86/Makefile_32 b/arch/x86/Makefile_32 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[Patch 0/8] Remove 'TOPDIR' from Makefiles
TOPDIR is obsolete, use srctree or objtree instead. This patch set removes all the TOPDIR use in the whole source tree and finally drops it in the top Makefile. They're against the current linus-tree. Note that Patch [8/8] should be applied _after_ all the previous patches are applied. Regards. Cc: Sam Ravnborg <[EMAIL PROTECTED]> Cc: Andrew Morton <[EMAIL PROTECTED]> -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: Updated Kernel Hacker's guide to git
On Sun, Dec 23, 2007 at 06:13:03AM -0500, Jeff Garzik wrote: >Another year, another update! :) > >The kernel hacker's guide to git has received some updates: > > http://linux.yyz.us/git-howto.html > >This includes all the input sent to me in the past several months, as >well as a few new tips and tricks I use on a regular basis. > >In general, this document is designed to be a quick-start cookbook, and >not a comprehensive introduction. Jeff, very good! I like it. Thank you! ;-) > >Merry Christmas and Happy Holidays to all! > Merry Christmas, kernel hackers! Best wishes! -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[Patch] net/xfrm/xfrm_policy.c: Some small improvements
This patch contains the following changes. - Use 'bool' instead of 'int' for booleans. - Use 'size_t' instead of 'int' for 'sizeof' return value. - Some style fixes. Cc: Herbert Xu <[EMAIL PROTECTED]> Cc: David Miller <[EMAIL PROTECTED]> Signed-off-by: WANG Cong <[EMAIL PROTECTED]> --- net/xfrm/xfrm_policy.c | 23 --- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c index 5d6a81d..311b08f 100644 --- a/net/xfrm/xfrm_policy.c +++ b/net/xfrm/xfrm_policy.c @@ -476,17 +476,17 @@ static u32 xfrm_gen_index(u8 type, int dir) struct hlist_head *list; struct xfrm_policy *p; u32 idx; - int found; + bool found; idx = (idx_generator | dir); idx_generator += 8; if (idx == 0) idx = 8; list = xfrm_policy_byidx + idx_hash(idx); - found = 0; + found = false; hlist_for_each_entry(p, entry, list, byidx) { if (p->index == idx) { - found = 1; + found = true; break; } } @@ -499,8 +499,8 @@ static inline int selector_cmp(struct xfrm_selector *s1, struct xfrm_selector *s { u32 *p1 = (u32 *) s1; u32 *p2 = (u32 *) s2; - int len = sizeof(struct xfrm_selector) / sizeof(u32); - int i; + size_t len = sizeof(struct xfrm_selector) / sizeof(u32); + size_t i; for (i = 0; i < len; i++) { if (p1[i] != p2[i]) @@ -953,7 +953,7 @@ static int xfrm_policy_lookup(struct flowi *fl, u16 family, u8 dir, #ifdef CONFIG_XFRM_SUB_POLICY end: #endif - if ((*objp = (void *) pol) != NULL) + if ((*objp = pol) != NULL) *obj_refp = &pol->refcnt; return err; } @@ -1137,7 +1137,7 @@ xfrm_tmpl_resolve_one(struct xfrm_policy *policy, struct flowi *fl, xfrm_address_t *saddr = xfrm_flowi_saddr(fl, family); xfrm_address_t tmp; - for (nx=0, i = 0; i < policy->xfrm_nr; i++) { + for (nx = 0, i = 0; i < policy->xfrm_nr; i++) { struct xfrm_state *x; xfrm_address_t *remote = daddr; xfrm_address_t *local = saddr; @@ -1395,7 +1395,7 @@ free_dst: } static int inline -xfrm_dst_alloc_copy(void **target, void *src, int size) +xfrm_dst_alloc_copy(void **target, void *src, size_t size) { if (!*target) { *target = kmalloc(size, GFP_ATOMIC); @@ -1554,7 +1554,7 @@ restart: #endif nx = xfrm_tmpl_resolve(pols, npols, fl, xfrm, family); - if (unlikely(nx<0)) { + if (unlikely(nx < 0)) { err = nx; if (err == -EAGAIN && sysctl_xfrm_larval_drop) { /* EREMOTE tells the caller to generate @@ -1688,7 +1688,8 @@ xfrm_state_ok(struct xfrm_tmpl *tmpl, struct xfrm_state *x, unsigned short family) { if (xfrm_state_kern(x)) - return tmpl->optional && !xfrm_state_addr_cmp(tmpl, x, tmpl->encap_family); + return tmpl->optional && + !xfrm_state_addr_cmp(tmpl, x, tmpl->encap_family); return x->id.proto == tmpl->id.proto && (x->id.spi == tmpl->id.spi || !tmpl->id.spi) && (x->props.reqid == tmpl->reqid || !tmpl->reqid) && @@ -1777,7 +1778,7 @@ int __xfrm_policy_check(struct sock *sk, int dir, struct sk_buff *skb, if (skb->sp) { int i; - for (i=skb->sp->len-1; i>=0; i--) { + for (i = skb->sp->len-1; i >= 0; i--) { struct xfrm_state *x = skb->sp->xvec[i]; if (!xfrm_selector_match(&x->sel, &fl, family)) return 0; -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: Patch submission question [not in the FAQ]
On Wed, Dec 05, 2007 at 03:36:54AM -0800, Gabriele Gorla wrote: >Hello, >I have submitted a patch for the 3x- driver on >alpha several months ago to both the driver maintainer >and the linux-scsi mailing list. >I have read all the FAQ and I tried to stick to the >instructions to the letter. >However the patch has been completely ignored. No >reply, no comment, no flames, absolutely nothing... > >the original email submission is at the end of the >email. > >could anyone please explain what I am doing wrong? > >thanks, >GG > > >[PATCH 2.6.22] 3w-: Fix bad unaligned accesses on >alpha SMP > >disable packing of the TAG_TW_Device_Extension >structure to prevent kernel unaligned accesses when >accessing ioctl_wqueue. >Fixes smartmontools kernel panic on alpha SMP > >Signed-off-by: Gabriele Gorla <[EMAIL PROTECTED]> >--- > > >--- linux-2.6.22/drivers/scsi/3w-.h.orig >2007-09-01 17:49:22.0 -0700 >+++ linux-2.6.22/drivers/scsi/3w-.h 2007-09-01 >17:49:45.0 -0700 It seems that your email client wraps lines. Please don't do this when you submit patches. >@@ -392,6 +392,8 @@ typedef struct TAG_TW_Passthru >unsigned char padding[12]; > } TW_Passthru; And also your email clients eats tabs. Read Documentation/SubmittingPatches, please. And read Documentation/email-clients.txt to learn more. Regards. Cong -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] kbuild: implement modules.order
>> I think, you forgot to free(3) the memory you calloc(3)'ed and >> malloc(3)'ed above. > >It's a simple program where whole body is in main(). Why bother? >What's the benefit of adding hash-table iterating free logic? > Personally, I think memory leaks are bugs. And we hate bugs. ;) Regards. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] kbuild: implement modules.order
{snip} Comments on your C code below. >--- /dev/null >+++ b/scripts/remove-dup.c >@@ -0,0 +1,98 @@ >+/* >+ * remove-dup - Drop duplicate lines from unsorted input files >+ * >+ * Dec 2007 Tejun Heo <[EMAIL PROTECTED]> >+ * >+ * This software is released under GPLv2. >+ */ >+ >+#include >+#include >+#include >+ >+struct hash_ent { >+ struct hash_ent *next; >+ char str[]; >+}; >+ >+#define fatal(fmt, args...) do {\ >+ fprintf(stderr, fmt , ##args); \ >+ exit(1);\ >+ } while (0) >+ >+static inline unsigned int sdb_hash(const char *str) >+{ >+unsigned int hash = 0; >+int c; >+ >+while ((c = *str++)) Maybe ` while ((c = *str++) != '\0') ` is better. ;) >+ hash = c + (hash << 6) + (hash << 16) - hash; >+ >+return hash; >+} >+ >+int main(int argc, char **argv) >+{ >+ unsigned int nr_entries = 0; >+ struct hash_ent **hash_tbl; >+ char line[10240]; Needs to #define the magic number? >+ int i; >+ >+ /* first pass, count lines */ >+ for (i = 1; i < argc; i++) { >+ FILE *fp = fopen(argv[i], "r"); >+ >+ if (!fp) >+ fatal("failed to open %s for reading\n", argv[i]); >+ >+ while (fgets(line, sizeof(line), fp)) >+ nr_entries++; >+ >+ fclose(fp); >+ } >+ >+ nr_entries = nr_entries * 10 / 8; >+ hash_tbl = calloc(nr_entries, sizeof(struct hash_ent *)); >+ if (!hash_tbl) >+ fatal("failed to allocate hash table for %u entries\n", >+nr_entries); >+ >+ /* second pass, hash and print unique lines */ >+ for (i = 1; i < argc; i++) { >+ FILE *fp = fopen(argv[i], "r"); >+ >+ if (!fp) >+ fatal("failed to open %s for reading\n", argv[i]); >+ >+ while (fgets(line, sizeof(line), fp)) { >+ int len = strlen(line); strlen returns 'size_t', which is unsigned. >+ struct hash_ent **ppos, *new_ent; >+ >+ if (line[len - 1] == '\n') >+ line[--len] = '\0'; >+ >+ ppos = hash_tbl + (sdb_hash(line) % nr_entries); >+ while (*ppos) { >+ if (strcmp((*ppos)->str, line) == 0) >+ break; >+ ppos = &(*ppos)->next; >+ } >+ if (*ppos) >+ continue; >+ >+ new_ent = malloc(sizeof(struct hash_ent) + len + 1); >+ if (!new_ent) >+ fatal("failed to allocate hash entry\n"); >+ new_ent->next = NULL; >+ memcpy(new_ent->str, line, len + 1); >+ >+ *ppos = new_ent; >+ >+ printf("%s\n", line); >+ } >+ >+ fclose(fp); >+ } >+ I think, you forgot to free(3) the memory you calloc(3)'ed and malloc(3)'ed above. >+ return 0; >+} Thanks! Cong -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: void* arithmnetic
On Thu, Nov 29, 2007 at 09:38:46AM +0200, Benny Halevy wrote: >On Nov. 29, 2007, 3:19 +0200, "Ming Lei" <[EMAIL PROTECTED]> wrote: >> 2007/11/29, Jan Engelhardt <[EMAIL PROTECTED]>: >>> On Nov 29 2007 01:05, J.A. Magallón wrote: Since begin of the ages the build of the nvidia driver says things like this: >>> Explicitly adding -Wpointer-arith to ones own Makefile is like >>> admitting the code might be problematic. :-> >>> >>> >>> I think sizeof(void *) == 1 is taken as granted as sizeof(int) >= 4 >>> these days. Sigh. >> sizeof(void *) == 4, sizeof(void)==1, :) >well, sizeof(void *) == sizeof(unsigned long) maybe :) I *heard* that on Win64 sizeof(void *) > sizeof(long). But it's off-topic here. ;-) - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [Patch](Resend) mm/sparse.c: Improve the error handling for sparse_add_one_section()
On Tue, Nov 27, 2007 at 10:53:45AM -0800, Dave Hansen wrote: >On Tue, 2007-11-27 at 10:26 +0800, WANG Cong wrote: >> >> @@ -414,7 +418,7 @@ int sparse_add_one_section(struct zone * >> out: >> pgdat_resize_unlock(pgdat, &flags); >> if (ret <= 0) >> - __kfree_section_memmap(memmap, nr_pages); >> + kfree(usemap); >> return ret; >> } >> #endif > >Why did you get rid of the memmap free here? A bad return from >sparse_init_one_section() indicates that we didn't use the memmap, so it >will leak otherwise. Sorry, I was confused by the recursion. This one should be OK. Thanks. Improve the error handling for mm/sparse.c::sparse_add_one_section(). And I see no reason to check 'usemap' until holding the 'pgdat_resize_lock'. Cc: Christoph Lameter <[EMAIL PROTECTED]> Cc: Dave Hansen <[EMAIL PROTECTED]> Cc: Rik van Riel <[EMAIL PROTECTED]> Cc: Yasunori Goto <[EMAIL PROTECTED]> Cc: Andy Whitcroft <[EMAIL PROTECTED]> Signed-off-by: WANG Cong <[EMAIL PROTECTED]> --- Index: linux-2.6/mm/sparse.c === --- linux-2.6.orig/mm/sparse.c +++ linux-2.6/mm/sparse.c @@ -391,9 +391,17 @@ int sparse_add_one_section(struct zone * * no locking for this, because it does its own * plus, it does a kmalloc */ - sparse_index_init(section_nr, pgdat->node_id); + ret = sparse_index_init(section_nr, pgdat->node_id); + if (ret < 0) + return ret; memmap = kmalloc_section_memmap(section_nr, pgdat->node_id, nr_pages); + if (!memmap) + return -ENOMEM; usemap = __kmalloc_section_usemap(); + if (!usemap) { + __kfree_section_memmap(memmap, nr_pages); + return -ENOMEM; + } pgdat_resize_lock(pgdat, &flags); @@ -403,18 +411,16 @@ int sparse_add_one_section(struct zone * goto out; } - if (!usemap) { - ret = -ENOMEM; - goto out; - } ms->section_mem_map |= SECTION_MARKED_PRESENT; ret = sparse_init_one_section(ms, section_nr, memmap, usemap); out: pgdat_resize_unlock(pgdat, &flags); - if (ret <= 0) + if (ret <= 0) { + kfree(usemap); __kfree_section_memmap(memmap, nr_pages); + } return ret; } #endif - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] [VIDEO]: Complement va_start() with va_end().
On Tue, Nov 27, 2007 at 08:06:17AM +0100, Richard Knutsson wrote: >Complement va_start() with va_end(). > >Signed-off-by: Richard Knutsson <[EMAIL PROTECTED]> >--- >Compile-tested on i386 with allyesconfig and allmodconfig. > > >diff --git a/drivers/media/video/saa5246a.c b/drivers/media/video/saa5246a.c >index ad02329..996b494 100644 >--- a/drivers/media/video/saa5246a.c >+++ b/drivers/media/video/saa5246a.c >@@ -187,12 +187,14 @@ static int i2c_senddata(struct saa5246a_device *t, ...) > { > unsigned char buf[64]; > int v; >- int ct=0; >+ int ct = 0; > va_list argp; >- va_start(argp,t); >+ va_start(argp, t); Hi, Richard! These are style fixes, and you did't mention this above. ;) Thanks. Cong - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[Patch](Resend) mm/sparse.c: Improve the error handling for sparse_add_one_section()
On Mon, Nov 26, 2007 at 07:19:49PM +0900, Yasunori Goto wrote: >Hi, Cong-san. > >> ms->section_mem_map |= SECTION_MARKED_PRESENT; >> >> ret = sparse_init_one_section(ms, section_nr, memmap, usemap); >> >> out: >> pgdat_resize_unlock(pgdat, &flags); >> -if (ret <= 0) >> -__kfree_section_memmap(memmap, nr_pages); >> + >> return ret; >> } >> #endif > >Hmm. When sparse_init_one_section() returns error, memmap and >usemap should be free. Hi, Yasunori. Thanks for your comments. Is the following one fine for you? Signed-off-by: WANG Cong <[EMAIL PROTECTED]> --- Index: linux-2.6/mm/sparse.c === --- linux-2.6.orig/mm/sparse.c +++ linux-2.6/mm/sparse.c @@ -391,9 +391,17 @@ int sparse_add_one_section(struct zone * * no locking for this, because it does its own * plus, it does a kmalloc */ - sparse_index_init(section_nr, pgdat->node_id); + ret = sparse_index_init(section_nr, pgdat->node_id); + if (ret < 0) + return ret; memmap = kmalloc_section_memmap(section_nr, pgdat->node_id, nr_pages); + if (!memmap) + return -ENOMEM; usemap = __kmalloc_section_usemap(); + if (!usemap) { + __kfree_section_memmap(memmap, nr_pages); + return -ENOMEM; + } pgdat_resize_lock(pgdat, &flags); @@ -403,10 +411,6 @@ int sparse_add_one_section(struct zone * goto out; } - if (!usemap) { - ret = -ENOMEM; - goto out; - } ms->section_mem_map |= SECTION_MARKED_PRESENT; ret = sparse_init_one_section(ms, section_nr, memmap, usemap); @@ -414,7 +418,7 @@ int sparse_add_one_section(struct zone * out: pgdat_resize_unlock(pgdat, &flags); if (ret <= 0) - __kfree_section_memmap(memmap, nr_pages); + kfree(usemap); return ret; } #endif - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [uml-devel] uml doesn't work on 2.6.24-rc2
On Fri, Nov 23, 2007 at 11:54:41AM +0100, Jiri Olsa wrote: >Hi, > >after applying following changes, the mainline is working for me. > Hi, I have already mentioned this. Follow this link[1]. ;^) [1] http://lkml.org/lkml/2007/11/20/10 - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PROBLEM] uml doesn't compile on i386
On Fri, Nov 23, 2007 at 10:52:06AM +0200, Pekka Enberg wrote: >Hi, > >Current git head doesn't compile. Looks like fall-out from the x86 merge? > >[EMAIL PROTECTED]:~/src/linux/uml-2.6$ make ARCH=um > SYMLINK arch/um/include/kern_constants.h > SYMLINK arch/um/include/sysdep >make[1]: `arch/um/sys-i386/user-offsets.s' is up to date. > CHK arch/um/include/user_constants.h > CHK include/linux/version.h > CHK include/linux/utsrelease.h > CC arch/um/kernel/asm-offsets.s >In file included from include/asm/arch/atomic.h:2, > from include/asm/atomic.h:9, > from include/linux/spinlock.h:333, > from include/linux/seqlock.h:29, > from include/linux/time.h:8, > from include/linux/timex.h:57, > from include/linux/sched.h:53, > from arch/um/include/sysdep/kernel-offsets.h:2, > from arch/um/kernel/asm-offsets.c:1: >include/asm/arch/atomic_32.h: In function 'atomic_add_unless': >include/asm/arch/atomic_32.h:237: error: 'struct cpuinfo_um' has no >member named 'x86' >In file included from include/asm/rwsem.h:4, > from include/linux/rwsem.h:24, > from include/linux/mm_types.h:11, > from include/linux/sched.h:60, > from arch/um/include/sysdep/kernel-offsets.h:2, > from arch/um/kernel/asm-offsets.c:1: >include/asm/arch/rwsem.h: In function '__down_write_trylock': >include/asm/arch/rwsem.h:165: error: 'struct cpuinfo_um' has no member >named 'x86' >make[1]: *** [arch/um/kernel/asm-offsets.s] Error 1 >make: *** [prepare0] Error 2 Hmm, I believe this patch[1] from Jeff can solve the problem. ;-) [1] http://lkml.org/lkml/2007/11/19/220 - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/