All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Alexandr Ivanov <alexandr.sky@gmail.com>
Cc: mathias.nyman@intel.com, linux-usb@vger.kernel.org
Subject: Re: [PATCH] xhci: Remove unnecessary condition from xhci_check_tt_bw_table
Date: Mon, 24 May 2021 09:04:32 +0200	[thread overview]
Message-ID: <YKtQAG9J9kvs0Az2@kroah.com> (raw)
In-Reply-To: <a7ca3671-aaee-2b4e-ed90-208ba82baef8@gmail.com>

On Sun, May 23, 2021 at 06:10:31PM +0300, Alexandr Ivanov wrote:
> Remove condition (old_active_eps == 0) from xhci_check_tt_bw_table
> because the previous check of old_active_eps returns
> from the function if old_active_eps is not zero.
> 
> Move the previous condition to the function beginning.
> 
> Signed-off-by: Alexandr Ivanov <alexandr.sky@gmail.com>
> ---
>  drivers/usb/host/xhci.c | 10 ++++++----
>  1 file changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
> index 27283654ca08..14aae87d6c8f 100644
> --- a/drivers/usb/host/xhci.c
> +++ b/drivers/usb/host/xhci.c
> @@ -2329,16 +2329,18 @@ static int xhci_check_tt_bw_table(struct xhci_hcd
> *xhci,
>      struct xhci_interval_bw_table *bw_table;
>      struct xhci_tt_bw_info *tt_info;
> 
> -    /* Find the bandwidth table for the root port this TT is attached to.
> */
> -    bw_table = &xhci->rh_bw[virt_dev->real_port - 1].bw_table;
> -    tt_info = virt_dev->tt_info;
>      /* If this TT already had active endpoints, the bandwidth for this TT
>       * has already been added.  Removing all periodic endpoints (and thus
>       * making the TT enactive) will only decrease the bandwidth used.
>       */
>      if (old_active_eps)
>          return 0;
> -    if (old_active_eps == 0 && tt_info->active_eps != 0) {
> +
> +    /* Find the bandwidth table for the root port this TT is attached to.
> */
> +    bw_table = &xhci->rh_bw[virt_dev->real_port - 1].bw_table;
> +    tt_info = virt_dev->tt_info;
> +
> +    if (tt_info->active_eps != 0) {
>          if (bw_table->bw_used + TT_HS_OVERHEAD > HS_BW_LIMIT)
>              return -ENOMEM;
>          return 0;
> -- 
> 2.31.1
> 

Hi,

This is the friendly patch-bot of Greg Kroah-Hartman.  You have sent him
a patch that has triggered this response.  He used to manually respond
to these common problems, but in order to save his sanity (he kept
writing the same thing over and over, yet to different people), I was
created.  Hopefully you will not take offence and will fix the problem
in your patch and resubmit it so that it can be accepted into the Linux
kernel tree.

You are receiving this message because of the following common error(s)
as indicated below:

- Your patch is malformed (tabs converted to spaces, linewrapped, etc.)
  and can not be applied.  Please read the file,
  Documentation/email-clients.txt in order to fix this.

If you wish to discuss this problem further, or you have questions about
how to resolve this issue, please feel free to respond to this email and
Greg will reply once he has dug out from the pending patches received
from other developers.

thanks,

greg k-h's patch email bot

      reply	other threads:[~2021-05-24  7:04 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-23 15:10 [PATCH] xhci: Remove unnecessary condition from xhci_check_tt_bw_table Alexandr Ivanov
2021-05-24  7:04 ` Greg KH [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YKtQAG9J9kvs0Az2@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=alexandr.sky@gmail.com \
    --cc=linux-usb@vger.kernel.org \
    --cc=mathias.nyman@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.