[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <ZBCqHJz8zYeXQ3Q7@kroah.com>
Date: Tue, 14 Mar 2023 18:08:44 +0100
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: Danila Chernetsov <listdansp@...l.ru>
Cc: stable@...r.kernel.org, Bin Liu <b-liu@...com>,
linux-usb@...r.kernel.org, linux-kernel@...r.kernel.org,
lvc-project@...uxtesting.org, Sergey Shtylyov <s.shtylyov@....ru>
Subject: Re: [PATCH 5.10 1/1] usb: musb: core: drop redundant checks
On Tue, Mar 14, 2023 at 05:01:13PM +0000, Danila Chernetsov wrote:
> From: Sergey Shtylyov <s.shtylyov@....ru>
>
> commit b0ec7e55fce65f125bd1d7f02e2dc4de62abee34 upstream.
Nit, trailing whitespace, please fix your editor to show this up easier.
>
> In musb_{save|restore}_context() the expression '&musb->endpoints[i]' just
> cannot be NULL, so the checks have no sense at all -- after dropping them,
> the local variables 'hw_ep' are no longer necessary, so drop them as well.
>
> Found by Linux Verification Center (linuxtesting.org) with the SVACE static
> analysis tool.
>
> Signed-off-by: Sergey Shtylyov <s.shtylyov@....ru>
> Link: https://lore.kernel.org/r/3f8f60d9-f1b5-6b2c-1222-39b156151a22@omp.ru
> Signed-off-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
> Signed-off-by: Danila Chernetsov <listdansp@...l.ru>
> ---
> drivers/usb/musb/musb_core.c | 16 ++--------------
> 1 file changed, 2 insertions(+), 14 deletions(-)
>
> diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c
> index 4c8f0112481f..605f5cc0f18b 100644
> --- a/drivers/usb/musb/musb_core.c
> +++ b/drivers/usb/musb/musb_core.c
> @@ -2673,13 +2673,7 @@ static void musb_save_context(struct musb *musb)
> musb->context.devctl = musb_readb(musb_base, MUSB_DEVCTL);
>
> for (i = 0; i < musb->config->num_eps; ++i) {
> - struct musb_hw_ep *hw_ep;
> -
> - hw_ep = &musb->endpoints[i];
> - if (!hw_ep)
> - continue;
> -
> - epio = hw_ep->regs;
> + epio = musb->endpoints[i].regs;
Why is this needed in the stable releases? It just seems to remove
unused code, but does not change any logic at all, so why backport it?
thanks,
greg k-h
Powered by blists - more mailing lists