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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.

regards,
dan carpenter
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel



[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux