All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] xfs: clean up return handling
@ 2014-04-16 17:40 Eric Sandeen
  2014-04-16 17:44 ` [PATCH 1/2] xfs: return is not a function Eric Sandeen
  2014-04-16 17:48 ` [PATCH 2/2] xfs: Nuke XFS_ERROR macro Eric Sandeen
  0 siblings, 2 replies; 15+ messages in thread
From: Eric Sandeen @ 2014-04-16 17:40 UTC (permalink / raw)
  To: xfs-oss

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' *.c
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) ;)

-Eric

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2014-04-22 21:39 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-16 17:40 [PATCH 0/2] xfs: clean up return handling Eric Sandeen
2014-04-16 17:44 ` [PATCH 1/2] xfs: return is not a function Eric Sandeen
2014-04-21  6:58   ` Christoph Hellwig
2014-04-16 17:48 ` [PATCH 2/2] xfs: Nuke XFS_ERROR macro Eric Sandeen
2014-04-16 17:51   ` Christoph Hellwig
2014-04-16 17:55     ` Eric Sandeen
2014-04-16 19:11       ` Eric Sandeen
2014-04-16 22:08         ` Dave Chinner
2014-04-16 23:44           ` Steven Rostedt
2014-04-17  0:39             ` Dave Chinner
2014-04-17  0:49               ` Dave Chinner
2014-04-21  6:57               ` Christoph Hellwig
2014-04-21 23:43                 ` Dave Chinner
2014-04-16 22:28     ` Dave Chinner
2014-04-22 21:38   ` Dave Chinner

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.