<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <div class="A3dMNc" data-initial-text=""><font size="2"><span>This
          patch was prepare in according to secure programming
          conception.</span><span> <br>
        </span><span>In practice it indeed simply remove unused code.</span><span>
          <br>
        </span><span>If you're thinking, that this patch is useless, we
          don't insist on applying it.<br>
          <br>
          Danila<br>
        </span></font></div>
    <div class="A3dMNc" data-initial-text=""><font size="2"><span></span></font><span
        style="font-family: courier new, courier, monaco, monospace,
        sans-serif;" data-mce-style="font-family: courier new, courier,
        monaco, monospace, sans-serif;"><span><br>
        </span></span></div>
    <div class="A3dMNc" data-initial-text=""><span style="font-family:
        courier new, courier, monaco, monospace, sans-serif;"
        data-mce-style="font-family: courier new, courier, monaco,
        monospace, sans-serif;"><span><br>
        </span></span></div>
    <div class="moz-cite-prefix">14.03.2023 20:08, Greg Kroah-Hartman
      пишет:<br>
    </div>
    <blockquote type="cite" cite="mid:ZBCqHJz8zYeXQ3Q7@kroah.com">
      <pre class="moz-quote-pre" wrap="">On Tue, Mar 14, 2023 at 05:01:13PM +0000, Danila Chernetsov wrote:
</pre>
      <blockquote type="cite">
        <pre class="moz-quote-pre" wrap="">From: Sergey Shtylyov <a class="moz-txt-link-rfc2396E" href="mailto:s.shtylyov@omp.ru"><s.shtylyov@omp.ru></a>

commit b0ec7e55fce65f125bd1d7f02e2dc4de62abee34 upstream. 
</pre>
      </blockquote>
      <pre class="moz-quote-pre" wrap="">
Nit, trailing whitespace, please fix your editor to show this up easier.

</pre>
      <blockquote type="cite">
        <pre class="moz-quote-pre" wrap="">
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 <a class="moz-txt-link-rfc2396E" href="mailto:s.shtylyov@omp.ru"><s.shtylyov@omp.ru></a>
Link: <a class="moz-txt-link-freetext" href="https://lore.kernel.org/r/3f8f60d9-f1b5-6b2c-1222-39b156151a22@omp.ru">https://lore.kernel.org/r/3f8f60d9-f1b5-6b2c-1222-39b156151a22@omp.ru</a>
Signed-off-by: Greg Kroah-Hartman <a class="moz-txt-link-rfc2396E" href="mailto:gregkh@linuxfoundation.org"><gregkh@linuxfoundation.org></a>
Signed-off-by: Danila Chernetsov <a class="moz-txt-link-rfc2396E" href="mailto:listdansp@mail.ru"><listdansp@mail.ru></a>
---
 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;
</pre>
      </blockquote>
      <pre class="moz-quote-pre" wrap="">
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
</pre>
    </blockquote>
  </body>
</html>