[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAH2r5msAs9Lm=jzWd=pYnK3r9iANSNRTqHvHxNjzsBucgq9Ktw@mail.gmail.com>
Date: Sun, 1 Sep 2024 15:50:03 -0500
From: Steve French <smfrench@...il.com>
To: Thorsten Blum <thorsten.blum@...lux.com>, Shen Lichuan <shenlichuan@...o.com>
Cc: sfrench@...ba.org, pc@...guebit.com, ronniesahlberg@...il.com,
sprasad@...rosoft.com, tom@...pey.com, bharathsm@...rosoft.com,
linux-cifs@...r.kernel.org, samba-technical@...ts.samba.org,
linux-kernel@...r.kernel.org
Subject: Re: [RESEND PATCH] smb3: Use min() to improve _smbd_get_connection()
There is a similar patch in cifs-2.6.git for-next-next (for 6.12-rc) from
smfrench@...rench-ThinkPad-P52:~/cifs-2.6$ git show
commit a85383ccf515f82ad791f9bfe70b0e6fb5a2117f (HEAD ->
for-next-next, origin/for-next-next)
Author: Shen Lichuan <shenlichuan@...o.com>
Date: Tue Aug 27 16:54:20 2024 +0800
smb: client: Use min() macro
Use the min() macro to simplify the function and improve
its readability.
Signed-off-by: Shen Lichuan <shenlichuan@...o.com>
Signed-off-by: Steve French <stfrench@...rosoft.com>
On Sun, Sep 1, 2024 at 11:40 AM Thorsten Blum <thorsten.blum@...lux.com> wrote:
>
> Use the min() macro to simplify the _smbd_get_connection() function and
> improve its readability.
>
> Signed-off-by: Thorsten Blum <thorsten.blum@...lux.com>
> ---
> fs/smb/client/smbdirect.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/fs/smb/client/smbdirect.c b/fs/smb/client/smbdirect.c
> index 7bcc379014ca..8f782edc3fd7 100644
> --- a/fs/smb/client/smbdirect.c
> +++ b/fs/smb/client/smbdirect.c
> @@ -1585,10 +1585,8 @@ static struct smbd_connection *_smbd_get_connection(
> conn_param.initiator_depth = 0;
>
> conn_param.responder_resources =
> - info->id->device->attrs.max_qp_rd_atom
> - < SMBD_CM_RESPONDER_RESOURCES ?
> - info->id->device->attrs.max_qp_rd_atom :
> - SMBD_CM_RESPONDER_RESOURCES;
> + min(info->id->device->attrs.max_qp_rd_atom,
> + SMBD_CM_RESPONDER_RESOURCES);
> info->responder_resources = conn_param.responder_resources;
> log_rdma_mr(INFO, "responder_resources=%d\n",
> info->responder_resources);
> --
> 2.46.0
>
>
--
Thanks,
Steve
Powered by blists - more mailing lists