* [PATCH] KernelJanitor: Convert remaining error returns to return -E Linux 2.5.68
@ 2003-04-29 22:15 Gabriel Devenyi
2003-04-29 22:32 ` Randy.Dunlap
2003-04-29 22:42 ` viro
0 siblings, 2 replies; 14+ messages in thread
From: Gabriel Devenyi @ 2003-04-29 22:15 UTC (permalink / raw)
To: alan, torvalds; +Cc: linux-kernel
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
--
Building the Future,
Gabriel Devenyi
devenyga@mcmaster.ca
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH] KernelJanitor: Convert remaining error returns to return -E Linux 2.5.68
2003-04-29 22:15 [PATCH] KernelJanitor: Convert remaining error returns to return -E Linux 2.5.68 Gabriel Devenyi
@ 2003-04-29 22:32 ` Randy.Dunlap
2003-04-29 23:08 ` Gabriel Devenyi
2003-04-29 22:42 ` viro
1 sibling, 1 reply; 14+ messages in thread
From: Randy.Dunlap @ 2003-04-29 22:32 UTC (permalink / raw)
To: Gabriel Devenyi; +Cc: alan, torvalds, linux-kernel
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
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH] KernelJanitor: Convert remaining error returns to return -E Linux 2.5.68
2003-04-29 22:32 ` Randy.Dunlap
@ 2003-04-29 23:08 ` Gabriel Devenyi
2003-04-30 0:22 ` Dave Jones
0 siblings, 1 reply; 14+ messages in thread
From: Gabriel Devenyi @ 2003-04-29 23:08 UTC (permalink / raw)
To: Randy.Dunlap; +Cc: linux-kernel
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
--
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH] KernelJanitor: Convert remaining error returns to return -E Linux 2.5.68
2003-04-29 23:08 ` Gabriel Devenyi
@ 2003-04-30 0:22 ` Dave Jones
0 siblings, 0 replies; 14+ messages in thread
From: Dave Jones @ 2003-04-30 0:22 UTC (permalink / raw)
To: Gabriel Devenyi; +Cc: Randy.Dunlap, linux-kernel
On Tue, Apr 29, 2003 at 11:08:30PM +0000, Gabriel Devenyi wrote:
> P.S. Anyone who works on KernelJanitor, kj.pl is suggesting some of the things
> I'm changing which aparently I shouldn't.
I'd take most things it says with a pinch of salt.
I wasn't kidding when I said I knew no perl at all before I wrote this.
I stopped hacking on it when Dan Carpenters smatch appeared, as it
was a more 'real' solution with a future.
kj.pl was a fun weekend hack.
Dave
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH] KernelJanitor: Convert remaining error returns to return -E Linux 2.5.68
2003-04-29 22:15 [PATCH] KernelJanitor: Convert remaining error returns to return -E Linux 2.5.68 Gabriel Devenyi
2003-04-29 22:32 ` Randy.Dunlap
@ 2003-04-29 22:42 ` viro
2003-04-29 23:11 ` Gabriel Devenyi
1 sibling, 1 reply; 14+ messages in thread
From: viro @ 2003-04-29 22:42 UTC (permalink / raw)
To: Gabriel Devenyi; +Cc: alan, torvalds, linux-kernel
On Tue, Apr 29, 2003 at 10:15:20PM +0000, Gabriel Devenyi 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
Have you tried to compile the patched kernel?
Patch is bogus - most of the changes are s/return ERR_PTR(foo)/return foo/
with neither explanation nor change of function prototype not change of
other exits from these functions.
WTF was it intended to do?
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH] KernelJanitor: Convert remaining error returns to return -E Linux 2.5.68
2003-04-29 22:42 ` viro
@ 2003-04-29 23:11 ` Gabriel Devenyi
2003-05-05 22:11 ` Pavel Machek
0 siblings, 1 reply; 14+ messages in thread
From: Gabriel Devenyi @ 2003-04-29 23:11 UTC (permalink / raw)
To: viro; +Cc: linux-kernel
It was intended to do exactly what the KernelJanitor TODO and kj.pl script
pointed out, but aparently there's more to it than that. (BTW it just says
"sed s/return EWHATEVER/return -EWHATEVER/") Discouraging people with foul
language isn't the best way to get more developers, this is only my first
try.
--
Building the Future,
Gabriel Devenyi
devenyga@mcmaster.ca
On April 29, 2003 10:42 pm, you wrote:
> On Tue, Apr 29, 2003 at 10:15:20PM +0000, Gabriel Devenyi 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
>
> Have you tried to compile the patched kernel?
>
> Patch is bogus - most of the changes are s/return ERR_PTR(foo)/return foo/
> with neither explanation nor change of function prototype not change of
> other exits from these functions.
>
> WTF was it intended to do?
--
Building the Future,
Gabriel Devenyi
devenyga@mcmaster.ca
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH] KernelJanitor: Convert remaining error returns to return -E Linux 2.5.68
2003-04-29 23:11 ` Gabriel Devenyi
@ 2003-05-05 22:11 ` Pavel Machek
2003-05-05 22:22 ` viro
0 siblings, 1 reply; 14+ messages in thread
From: Pavel Machek @ 2003-05-05 22:11 UTC (permalink / raw)
To: Gabriel Devenyi; +Cc: viro, linux-kernel
Hi!
> It was intended to do exactly what the KernelJanitor TODO and kj.pl script
> pointed out, but aparently there's more to it than that. (BTW it just says
> "sed s/return EWHATEVER/return -EWHATEVER/") Discouraging people with foul
> language isn't the best way to get more developers, this is only my first
> try.
That's Al Viro, it seems. He is hidding his real name? He's always
like that, and his flames are actually pretty nice reading. [And if
you did not even try to compile/boot that kernel, you deserve them.]
Pavel
--
When do you have a heart between your knees?
[Johanka's followup: and *two* hearts?]
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH] KernelJanitor: Convert remaining error returns to return -E Linux 2.5.68
2003-05-05 22:11 ` Pavel Machek
@ 2003-05-05 22:22 ` viro
2003-05-05 22:33 ` Martin Mares
0 siblings, 1 reply; 14+ messages in thread
From: viro @ 2003-05-05 22:22 UTC (permalink / raw)
To: Pavel Machek; +Cc: Gabriel Devenyi, linux-kernel
On Tue, May 06, 2003 at 12:11:46AM +0200, Pavel Machek wrote:
> Hi!
>
> > It was intended to do exactly what the KernelJanitor TODO and kj.pl script
> > pointed out, but aparently there's more to it than that. (BTW it just says
> > "sed s/return EWHATEVER/return -EWHATEVER/") Discouraging people with foul
> > language isn't the best way to get more developers, this is only my first
> > try.
>
> That's Al Viro, it seems. He is hidding his real name? He's always
> like that
???
When the fsck had I ever stooped down to hiding my name?
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH] KernelJanitor: Convert remaining error returns to return -E Linux 2.5.68
@ 2003-04-29 23:11 Randy.Dunlap
2003-04-30 0:02 ` viro
0 siblings, 1 reply; 14+ messages in thread
From: Randy.Dunlap @ 2003-04-29 23:11 UTC (permalink / raw)
To: lkml
On Tue, 29 Apr 2003 23:08:30 +0000 Gabriel Devenyi <devenyga@mcmaster.ca> wrote:
| 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.
The kernel-janitor TODO should be your guide. However, it needs some
updating too, so the best thing to do is ask about things on
kernel-janitor-discuss@lists.sf.net before you spend time on them.
[item updates are welcome]
--
~Randy
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH] KernelJanitor: Convert remaining error returns to return -E Linux 2.5.68
2003-04-29 23:11 Randy.Dunlap
@ 2003-04-30 0:02 ` viro
2003-04-30 0:25 ` John Levon
` (2 more replies)
0 siblings, 3 replies; 14+ messages in thread
From: viro @ 2003-04-30 0:02 UTC (permalink / raw)
To: Randy.Dunlap; +Cc: lkml
On Tue, Apr 29, 2003 at 04:11:28PM -0700, Randy.Dunlap wrote:
> On Tue, 29 Apr 2003 23:08:30 +0000 Gabriel Devenyi <devenyga@mcmaster.ca> wrote:
>
> | 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.
>
>
> The kernel-janitor TODO should be your guide. However, it needs some
> updating too, so the best thing to do is ask about things on
> kernel-janitor-discuss@lists.sf.net before you spend time on them.
>
> [item updates are welcome]
Well... Turn that one into
* try and convince XFS folks that they want to use negative numbers
for error values (will be tricky - they really don't like to diverge from
IRIX codebase)
* ditto for JFS - again, a bunch of functions use positive error
values.
* oprofile init on alpha should be returning negative in case of
failure to follow the common conventions.
AFAICS that's it.
^ permalink raw reply [flat|nested] 14+ messages in thread* Re: [PATCH] KernelJanitor: Convert remaining error returns to return -E Linux 2.5.68
2003-04-30 0:02 ` viro
@ 2003-04-30 0:25 ` John Levon
2003-04-30 14:19 ` Dave Kleikamp
2003-05-01 4:12 ` Randy.Dunlap
2 siblings, 0 replies; 14+ messages in thread
From: John Levon @ 2003-04-30 0:25 UTC (permalink / raw)
To: viro; +Cc: Randy.Dunlap, lkml
On Wed, Apr 30, 2003 at 01:02:36AM +0100, viro@parcelfarce.linux.theplanet.co.uk wrote:
> * oprofile init on alpha should be returning negative in case of
> failure to follow the common conventions.
I noticed this yesterday and the change is in my tree already.
regards,
john
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH] KernelJanitor: Convert remaining error returns to return -E Linux 2.5.68
2003-04-30 0:02 ` viro
2003-04-30 0:25 ` John Levon
@ 2003-04-30 14:19 ` Dave Kleikamp
2003-05-01 4:12 ` Randy.Dunlap
2 siblings, 0 replies; 14+ messages in thread
From: Dave Kleikamp @ 2003-04-30 14:19 UTC (permalink / raw)
To: viro, Randy.Dunlap; +Cc: lkml
On Tuesday 29 April 2003 19:02, viro@parcelfarce.linux.theplanet.co.uk
wrote:
> * ditto for JFS - again, a bunch of functions use positive error
> values.
Yeah, we've changed some of this from the way it was in OS/2, but we
haven't gone through everything. I'll put it on my todo list.
Thanks,
Shaggy
--
David Kleikamp
IBM Linux Technology Center
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH] KernelJanitor: Convert remaining error returns to return -E Linux 2.5.68
2003-04-30 0:02 ` viro
2003-04-30 0:25 ` John Levon
2003-04-30 14:19 ` Dave Kleikamp
@ 2003-05-01 4:12 ` Randy.Dunlap
2 siblings, 0 replies; 14+ messages in thread
From: Randy.Dunlap @ 2003-05-01 4:12 UTC (permalink / raw)
To: viro; +Cc: linux-kernel
> On Tue, Apr 29, 2003 at 04:11:28PM -0700, Randy.Dunlap wrote:
>> On Tue, 29 Apr 2003 23:08:30 +0000 Gabriel Devenyi <devenyga@mcmaster.ca>
>> wrote:
>>
>> | 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.
>>
>>
>> The kernel-janitor TODO should be your guide. However, it needs some
>> updating too, so the best thing to do is ask about things on
>> kernel-janitor-discuss@lists.sf.net before you spend time on them.
>>
>> [item updates are welcome]
>
> Well... Turn that one into
> * try and convince XFS folks that they want to use negative numbers
> for error values (will be tricky - they really don't like to diverge from
> IRIX codebase)
> * ditto for JFS - again, a bunch of functions use positive error
> values.
> * oprofile init on alpha should be returning negative in case of
> failure to follow the common conventions.
>
> AFAICS that's it.
OK, did that. and thanks.
The updated KJ TODO will be available shortly.
~Randy
^ permalink raw reply [flat|nested] 14+ messages in thread
end of thread, other threads:[~2003-05-05 22:20 UTC | newest]
Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-04-29 22:15 [PATCH] KernelJanitor: Convert remaining error returns to return -E Linux 2.5.68 Gabriel Devenyi
2003-04-29 22:32 ` Randy.Dunlap
2003-04-29 23:08 ` Gabriel Devenyi
2003-04-30 0:22 ` Dave Jones
2003-04-29 22:42 ` viro
2003-04-29 23:11 ` Gabriel Devenyi
2003-05-05 22:11 ` Pavel Machek
2003-05-05 22:22 ` viro
2003-05-05 22:33 ` Martin Mares
-- strict thread matches above, loose matches on Subject: below --
2003-04-29 23:11 Randy.Dunlap
2003-04-30 0:02 ` viro
2003-04-30 0:25 ` John Levon
2003-04-30 14:19 ` Dave Kleikamp
2003-05-01 4:12 ` Randy.Dunlap
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox