[PATCH v3 13/14] staging: unisys: fix else statement in visornic_main.c

Sudip Mukherjee sudipm.mukherjee at gmail.com
Wed Feb 10 05:36:44 UTC 2016


On Tue, Feb 09, 2016 at 10:16:12AM -0500, Ben Romer wrote:
> On Mon, 2016-02-08 at 22:39 +0530, Sudip Mukherjee wrote:
> > maybe this is better where you have single exit point and so only one
> > spin_unlock_irqrestore().
> 
> 
> We discussed this before. I don't want to put any of the goto messes
> back in because I don't think it shortens the code or makes it any
> simpler.

yes, now i remember. Sorry for suggesting the same thing again.
Documentation/CodingStyle says:
"The goto statement comes in handy when a function exits from multiple
locations and some common work such as cleanup has to be done.  If there
is no cleanup needed then just return directly."

IMHO, the patch I posted or this suggestion does not go against that.
But anyway, since you are opposed to it I will not send the patch again.

> 
> [snip]
> > +
> > +exit_unlock:
> > +	spin_unlock_irqrestore(&devdata->priv_lock, flags);
> >  	return 0;
> 
> This should be returning ret.

yes, ofcourse. my mistake.

regards
sudip


More information about the devel mailing list