lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <96170d620618804d49ad19323d3cdee853070c72.camel@nxp.com>
Date:   Thu, 20 Sep 2018 08:50:44 +0000
From:   Leonard Crestez <leonard.crestez@....com>
To:     "yuehaibing@...wei.com" <yuehaibing@...wei.com>,
        "u.kleine-koenig@...gutronix.de" <u.kleine-koenig@...gutronix.de>,
        "jslaby@...e.cz" <jslaby@...e.cz>
CC:     "linux-serial@...r.kernel.org" <linux-serial@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        dl-linux-imx <linux-imx@....com>,
        "gregkh@...uxfoundation.org" <gregkh@...uxfoundation.org>,
        Andy Duan <fugang.duan@....com>,
        "kernel-janitors@...r.kernel.org" <kernel-janitors@...r.kernel.org>
Subject: Re: [PATCH -next] serial: imx: remove set but not used variable
 'rtsirq'

On Thu, 2018-09-20 at 08:45 +0200, Jiri Slaby wrote:
> On 09/20/2018, 03:58 AM, YueHaibing wrote:
> > Fixes gcc '-Wunused-but-set-variable' warning:
> > 
> > drivers/tty/serial/imx.c: In function 'imx_uart_probe':
> > drivers/tty/serial/imx.c:2198:20: warning:
> >  variable 'rtsirq' set but not used [-Wunused-but-set-variable]
> > 
> > diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c
> > @@ -2220,7 +2220,6 @@ static int imx_uart_probe(struct platform_device *pdev)
> >  
> >  	rxirq = platform_get_irq(pdev, 0);
> >  	txirq = platform_get_irq(pdev, 1);
> > -	rtsirq = platform_get_irq(pdev, 2);
> 
> I am not sure this is correct. platform_get_irq has side effects (like
> enabling the IRQ). Are you sure this won't change the behaviour (this is
> question mostly to IMX fellows)?

As far as I can tell there was a request_irq call for rtsirq which was
removed by mistake in commit afe9cbb1a6ad ("serial: imx: drop support
for IRDA"):

-               /* do not use RTS IRQ on IrDA */
-               if (!USE_IRDA(sport)) {
-                       ret = devm_request_irq(&pdev->dev, rtsirq,
-                                              imx_rtsint, 0,
-                                              dev_name(&pdev->dev), sport);
-                       if (ret)
-                               return ret;
-               }

This should have just removed the IRDA check and request rtsirq
unconditionally. Nobody noticed this by testing RTS on imx1, this is an
old chip and later variants have a single combined irq.

The correct fix for the warning would be to restore that request_irq.

--
Regards,
Leonard

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ