lkml.org 
[lkml]   [2009]   [Dec]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [RFC, PATCH 4/4] elf_core_dump(): Add extended numbering support
From

I agree with two of three cleanup ideas, but the last.

> > @@ -2079,11 +2139,19 @@ static int elf_core_dump(long signr, struct pt_regs *regs, struct file *file, un
> >        if (!elf_core_write_extra_data(file, &size, limit))
> >                goto end_coredump;
> >
> > +       if (e_phnum == PN_XNUM) {
> > +               size += sizeof(*shdr4extnum);
> > +               if (size > limit
> > +                   || !dump_write(file, shdr4extnum, sizeof(*shdr4extnum)))
> > +                       goto end_coredump;
> > +       }
> > +
> >  end_coredump:

There are two reasons I wrote like this.

First, the code like

if (size > limit || !dump_write(file, obj, sizeof(*obj)))
goto end_coredump;

is used as the common idiom in thourghout elf_core_dump(). Not
writing goto only at the last use seems unnatural for me.

Second, there is a possibility that new writing operation for section
header table will be added. If the goto is removed now, the patch
writer must rewrite it again.

Thanks for your comments.
--
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-16 03:27    [W:0.069 / U:0.036 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site