Re: [PATCH] copy_strings cleanup for 2.3.2

Andi Kleen (ak@muc.de)
Sun, 16 May 1999 20:04:20 +0200


On Sun, May 16, 1999 at 07:50:10PM +0200, Linus Torvalds wrote:
>
>
> On Sun, 16 May 1999, Andi Kleen wrote:
> >
> > This patch cleans up copy_strings considerably:
>
> If something like this needs to be done (and the patches look reasonably
> ok), then I'd much rather clean it up all the way.
>
> So a real cleanup would do in addition to your changes:
> - copystrings would return the error value, instead of writing it to a
> pointer. I hate those kinds of interfaces (look at the extremes I went
> to in order to avoid it for get_user(), for example).
> - instead of passing in 5 arguments, just pass in the bprm pointer. That
> way you get rid of the arguments that are always the same (bprm->page
> and bprm->p), and you don't have to return bprm->p because copy_strings
> can just modify it in place. (which allows you to do #1 above)
>
> So copy_strings would be something like
>
> int copy_strings(int argc, char *const*argv, &bprm)
>
> instead of
>
> unsigned long copy_strings(.. horror-arguments ..)
>
> no?

I didn't do it at first because I thought copy_strings is general purpose
enough that it may be someday used for something else than just with
binformats, but at a closer look you're right: it is unlikely that it
will ever happen and it is not worth the complexity.

>
> Would you mind going that exra mile?

Ok, I'll submit a new patch with these changes.

-Andi

-- 
This is like TV. I don't like TV.

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