From: Jason Gunthorpe <jgg@nvidia.com>
To: Bob Pearson <rpearsonhpe@gmail.com>
Cc: <zyjzyj2000@gmail.com>, <linux-rdma@vger.kernel.org>,
Bob Pearson <rpearson@hpe.com>, Hillf Danton <hdanton@sina.com>
Subject: Re: [PATCH for-next 2/5] RDMA/rxe: Fix misleading comments and names
Date: Fri, 22 Jan 2021 15:27:25 -0400 [thread overview]
Message-ID: <20210122192725.GG4147@nvidia.com> (raw)
In-Reply-To: <20210122042313.3336-3-rpearson@hpe.com>
On Thu, Jan 21, 2021 at 10:23:10PM -0600, Bob Pearson wrote:
> The names and comments of the 'unlocked' pool APIs are very
> misleading and not what was intended. This patch replaces
> 'rxe_xxx_nl' with 'rxe_xxx__' with comments indicating that the
> caller is expected to hold the rxe pool lock.
>
> Reported-by: Hillf Danton <hdanton@sina.com>
> Signed-off-by: Bob Pearson <rpearson@hpe.com>
> ---
> drivers/infiniband/sw/rxe/rxe_mcast.c | 8 ++--
> drivers/infiniband/sw/rxe/rxe_pool.c | 22 +++++------
> drivers/infiniband/sw/rxe/rxe_pool.h | 55 +++++++++++++--------------
> 3 files changed, 42 insertions(+), 43 deletions(-)
>
> diff --git a/drivers/infiniband/sw/rxe/rxe_mcast.c b/drivers/infiniband/sw/rxe/rxe_mcast.c
> index 5be47ce7d319..b9f06f87866e 100644
> --- a/drivers/infiniband/sw/rxe/rxe_mcast.c
> +++ b/drivers/infiniband/sw/rxe/rxe_mcast.c
> @@ -15,18 +15,18 @@ static struct rxe_mc_grp *create_grp(struct rxe_dev *rxe,
> int err;
> struct rxe_mc_grp *grp;
>
> - grp = rxe_alloc_nl(&rxe->mc_grp_pool);
> + grp = rxe_alloc__(&rxe->mc_grp_pool);
Everything else seems fine, but this trailing __ is too weird
If a lock is supposed to be held then name it foo_locked() or locked_()
If it auto-locks then name it foo()
If there is some #define wrapper then it is
#define foo() __foo()
Jason
next prev parent reply other threads:[~2021-01-22 19:38 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-22 4:23 [PATCH for-next 0/5] RDMA/rxe: Fix rxe_alloc() bug Bob Pearson
2021-01-22 4:23 ` [PATCH for-next 1/5] RDMA/rxe: Fix bug in rxe_alloc Bob Pearson
2021-01-22 4:23 ` [PATCH for-next 2/5] RDMA/rxe: Fix misleading comments and names Bob Pearson
2021-01-22 19:27 ` Jason Gunthorpe [this message]
2021-01-22 21:48 ` Pearson, Robert B
2021-01-25 15:15 ` Jason Gunthorpe
2021-01-22 4:23 ` [PATCH for-next 3/5] RDMA/rxe: Remove RXE_POOL_ATOMIC Bob Pearson
2021-01-22 4:23 ` [PATCH for-next 4/5] RDMA/rxe: Remove calls to ib_device_try_get/put Bob Pearson
2021-01-22 4:23 ` [PATCH for-next 5/5] RDMA/rxe: Remove unneeded pool->flag Bob Pearson
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=20210122192725.GG4147@nvidia.com \
--to=jgg@nvidia.com \
--cc=hdanton@sina.com \
--cc=linux-rdma@vger.kernel.org \
--cc=rpearson@hpe.com \
--cc=rpearsonhpe@gmail.com \
--cc=zyjzyj2000@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox