lkml.org 
[lkml]   [2009]   [Dec]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [RFC, PATCH 1/4] cleanup elf_core_dump(): remove ELF_CORE_EXTRA_* macro
From
On Tue, Dec 15, 2009 at 10:41 AM, Daisuke HATAYAMA
<d.hatayama@jp.fujitsu.com> wrote:
> elf_core_dump() uses #ifdef and the corresponding macro for hiding
> _multiline_ logics in functions. This patch removes #ifdef and
> replaces ELF_CORE_EXTRA_* by corresponding functions. For
> architectures not implemeonting ELF_CORE_EXTRA_*, we use weak
> functions in order to reduce a range of modification.
>
> This cleanup is for my next patches, but I think this cleanup itself
> is worth doing regardless of my firnal purpose.
>
> Signed-off-by: Daisuke HATAYAMA <d.hatayama@jp.fujitsu.com>


Good patch! I like it!

Just one problem below.


> --- /dev/null
> +++ b/arch/um/sys-i386/elfcore.c
> @@ -0,0 +1,78 @@
> +#include <linux/elf.h>
> +#include <linux/fs.h>
> +#include <linux/mm.h>
> +
> +#include <asm/elf.h>
> +
> +static int dump_write(struct file *file, const void *addr, int nr)
> +{
> +       return file->f_op->write(file, addr, nr, &file->f_pos) == nr;
> +}

We already have the same dump_write() in fs/binfmt_elf.c, can't we
reuse it? e.g. moving it to a header and make it staic inline.

Thanks!
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2009-12-15 09:01    [W:0.057 / U:0.760 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site