[Cbe-oss-dev] [PATCH] return only valid data in ibox_info and mbox_info

Arnd Bergmann arnd at arndb.de
Tue Dec 18 16:30:02 EST 2007


On Tuesday 18 December 2007, Jeremy Kerr wrote:
> > I guess that would be equivalent, but I don't see an improvement over
> > this code. The function would then either violate the
> > single-return-statement rule or grow by another few lines.
> 
> We have a single-return-statement rule? :)

Andrew Morton likes this rule a lot, but it's more a recommendation
than a hard rule, similar to the don't initialize automatic variables
at declaration time, which we also violate here.

> I think that's justified when avoiding spaghetti code, but in this
> case you'd have to drill-down through copy_to_user to audit the use of
> an uninitialised 'data' variable.

Yes, good point. These functions should be small enough to still
be obvious.

> How's this patch?

fine with me, thanks!

	Arnd <><



More information about the cbe-oss-dev mailing list