[PATCH 3/4] staging: dgnc: audit goto's in dgnc_tty

Tobin C. Harding me at tobin.cc
Tue Mar 7 21:08:24 UTC 2017


On Tue, Mar 07, 2017 at 08:08:44PM +0300, Dan Carpenter wrote:
> On Tue, Mar 07, 2017 at 05:33:08PM +1100, Tobin C. Harding wrote:
> > @@ -1668,20 +1669,20 @@ static int dgnc_tty_tiocmget(struct tty_struct *tty)
> >  {
> >  	struct channel_t *ch;
> >  	struct un_t *un;
> > -	int result = -EIO;
> > +	int rc = -EIO;
> >  	unsigned char mstat = 0;
> >  	unsigned long flags;
> >  
> >  	if (!tty || tty->magic != TTY_MAGIC)
> > -		return result;
> > +		return rc;
> >  
> 
> It's better to just do "return -EIO;"  That way all the information is
> on one line, and you don't need to scroll back to find out what it's
> returning.
> 
> > @@ -1987,20 +1990,21 @@ static int dgnc_tty_digigeta(struct tty_struct *tty,
> >  	struct un_t *un;
> >  	struct digi_t tmp;
> >  	unsigned long flags;
> > +	int rc = -EFAULT;
> >  
> >  	if (!retinfo)
> > -		return -EFAULT;
> > +		return rc;
> 
> The original is better here.

Awesome, thanks. Will include in v3.

thanks,
Tobin.


More information about the devel mailing list