linux-rdma.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Haakon Bugge <haakon.bugge@oracle.com>
To: kangning <kangning18z@ict.ac.cn>
Cc: OFED mailing list <linux-rdma@vger.kernel.org>
Subject: Re: [PATCH] Fix one error in mthca_alloc
Date: Thu, 26 Aug 2021 12:49:21 +0000	[thread overview]
Message-ID: <9B14AD95-E5D5-4141-92B8-F9BD5AF99AEE@oracle.com> (raw)
In-Reply-To: <20210826105215.2001-1-kangning18z@ict.ac.cn>



> On 26 Aug 2021, at 12:52, kangning <kangning18z@ict.ac.cn> wrote:
> 
> drivers/infiniband/hw/mthca/mthca_allocator.c: alloc->last left unchanged in mthca_alloc, which
> has impact on performance of function find_next_zero_bit in mthca_alloc.
> 
> Signed-off-by: kangning <kangning18z@ict.ac.cn>
> ---
> drivers/infiniband/hw/mthca/mthca_allocator.c | 4 ++++
> 1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/infiniband/hw/mthca/mthca_allocator.c b/drivers/infiniband/hw/mthca/mthca_allocator.c
> index aef1d274a14e..e81bb0fcd08e 100644
> --- a/drivers/infiniband/hw/mthca/mthca_allocator.c
> +++ b/drivers/infiniband/hw/mthca/mthca_allocator.c
> @@ -51,6 +51,10 @@ u32 mthca_alloc(struct mthca_alloc *alloc)
> 	}
> 
> 	if (obj < alloc->max) {
> +		alloc->last = (obj + 1);

No need for parenthesis.

> +		if (alloc->last == alloc->max) {

No need for braces.


Otherwise, looks good to me:

Reviewed-by: Håkon Bugge <haakon.bugge@oracle.com>


> +			alloc->last = 0;
> +		}
> 		set_bit(obj, alloc->table);
> 		obj |= alloc->top;
> 	} else
> -- 
> 2.17.1
> 


      reply	other threads:[~2021-08-26 12:49 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-26 10:52 [PATCH] Fix one error in mthca_alloc kangning
2021-08-26 12:49 ` Haakon Bugge [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=9B14AD95-E5D5-4141-92B8-F9BD5AF99AEE@oracle.com \
    --to=haakon.bugge@oracle.com \
    --cc=kangning18z@ict.ac.cn \
    --cc=linux-rdma@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).