Re: [PATCH] tty: serial: samsung_tty: remove set but not used variables

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

 



On Fri, Apr 23, 2021 at 05:54:16PM +0800, tiantao (H) wrote:
> 
> 在 2021/4/23 17:47, Greg KH 写道:
> > On Fri, Apr 23, 2021 at 05:39:00PM +0800, Tian Tao wrote:
> > > The value of 'ret' is not used, so just delete it.
> > > 
> > > Signed-off-by: Tian Tao <tiantao6@xxxxxxxxxxxxx>
> > > ---
> > >   drivers/tty/serial/samsung_tty.c | 1 -
> > >   1 file changed, 1 deletion(-)
> > > 
> > > diff --git a/drivers/tty/serial/samsung_tty.c b/drivers/tty/serial/samsung_tty.c
> > > index d9e4b67..d269d75 100644
> > > --- a/drivers/tty/serial/samsung_tty.c
> > > +++ b/drivers/tty/serial/samsung_tty.c
> > > @@ -2220,7 +2220,6 @@ static int s3c24xx_serial_probe(struct platform_device *pdev)
> > >   			default:
> > >   				dev_warn(&pdev->dev, "unsupported reg-io-width (%d)\n",
> > >   						prop);
> > > -				ret = -EINVAL;
> > That looks odd, shouldn't you do something with this instead of ignoring
> > it???
> 
> How about this ?
> 
> diff --git a/drivers/tty/serial/samsung_tty.c
> b/drivers/tty/serial/samsung_tty.c
> index d9e4b67..9fbc611 100644
> --- a/drivers/tty/serial/samsung_tty.c
> +++ b/drivers/tty/serial/samsung_tty.c
> @@ -2220,8 +2220,7 @@ static int s3c24xx_serial_probe(struct platform_device
> *pdev)
>                         default:
>                                 dev_warn(&pdev->dev, "unsupported
> reg-io-width (%d)\n",
>                                                 prop);
> -                               ret = -EINVAL;
> -                               break;
> +                               return -EINVAL;
> 

You tell me, does the patch work for you?

Is this really a "hard error" and did you now just break devices that
used to work properly?  Are you correctly unwinding any previously
allocated state when you return here?

Please do some research on this, and ideally, lots of testing, before
submitting it as a real solution.

thanks,

greg k-h



[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux PPP]     [Linux FS]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Linmodem]     [Device Mapper]     [Linux Kernel for ARM]

  Powered by Linux