[Top] [All Lists]

[PATCH 0/2] xfs: clean up return handling

To: xfs-oss <xfs@xxxxxxxxxxx>
Subject: [PATCH 0/2] xfs: clean up return handling
From: Eric Sandeen <sandeen@xxxxxxxxxxx>
Date: Wed, 16 Apr 2014 12:40:03 -0500
Delivered-to: xfs@xxxxxxxxxxx
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:24.0) Gecko/20100101 Thunderbird/24.4.0
2 patches here:

First of all, "return" is not a function.  "return(EIO);" is silly.
"return (EIO);" is even sillier.  Stop it.

Second of all, XFS_ERROR was designed long ago to trap return values,
but it's not runtime configurable, it's not consistently used,
and we can do the same thing today with systemtap.

So nuke that macro, too.

This is a *lot* of churn.  It'll make merging across this change hard.
So we might want to batch this up with another suggestion of Dave's,
to migrate all of xfs to the Linux convention of negative error
returns everywhere, so we don't have two nasty points to merge
across - that'd be fine with me.  But anyway, here it is for now.

For posterity, the first patch was generated with:

perl -p -i -e 's/return \(([a-zA-Z0-9]*?)\)/return $1/g' *.c
perl -p -i -e 's/return\(([a-zA-Z0-9]*?)\)/return $1/g' *.c

and the 2nd with:

perl -p -i -e 's/return\(XFS_ERROR\(([a-zA-Z0-9]*?)\)\)/return XFS_ERROR($1)/g' 
perl -p -i -e 's/return \(XFS_ERROR\(([a-zA-Z0-9]*?)\)\)/return 
XFS_ERROR($1)/g' *.c

(Yes, I know I could have done it w/ one regexp - so sue me) ;)


<Prev in Thread] Current Thread [Next in Thread>