Re: [PATCH] KernelJanitor: Convert remaining error returns to return -E Linux 2.5.68

From: Gabriel Devenyi (devenyga@mcmaster.ca)
Date: Tue Apr 29 2003 - 18:08:30 EST


Thanks for the suggestions, I'm kinda new at this and just following the TODO
which unfortuately says "sed s/return EWHATEVER/return -EWHATEVER/". I'll
work on checking the things you suggested. As for your other questions, the
kernel did build but I didn't attempt to boot it, I'll be sure to do so in
the future. Thanks for the encouragement.

P.S. Anyone who works on KernelJanitor, kj.pl is suggesting some of the things
I'm changing which aparently I shouldn't.

Building the Future,
Gabriel Devenyi
devenyga@mcmaster.ca

On April 29, 2003 10:32 pm, you wrote:
> On Tue, 29 Apr 2003 22:15:20 +0000 Gabriel Devenyi <devenyga@mcmaster.ca>
wrote:
> | This patch applies to 2.5.68. It converts all the remaining error returns
> | to the new return -E form, this is in the KernelJanitor TODO list.
> |
> | http://muss.mcmaster.ca/~devenyga/patch-linux-2.5.68-return-errors.patch
> |
> | Please CC me with any discussion since I do not subscribe to lkml
> | --
>
> I'd have to say that it really depends on whether the caller can
> handle negative return values. Did you check/audit the callers too?
>
> If it's a well-defined Unix/Linux error code (like s/ENOMEM/-ENOMEM/),
> this should be made to work (at least in most cases).
>
> And don't change ones that use ERR_PTR, like this:
>
> - return ERR_PTR(-ENOMEM);
> + return -ENOMEM;
>
>
> Local variable returns of positive/negative are probably not correct...
> without auditing the callers, it's hard to say. E.g.:
>
> - return ErrFlag;
> + return -ErrFlag;
>
> (same type of change in DAC960 driver)
>
>
> I'm a bit suspicious of:
>
> - return EOF;
> + return -EOF;
>
> and
>
> - return E05;
> + return -E05;
>
> It's not just a global search & replace...
>
>
> One more thing... did you build and boot that modified kernel?
> If so, did it build with the same number or fewer warnings than the
> unmodified version?
>
> --
> ~Randy

-- 
-
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/



This archive was generated by hypermail 2b29 : Wed Apr 30 2003 - 22:00:33 EST