[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAH2r5mvfMH6pW=6QwWEKyPHWnvuwA364KwVVirBj+irBi8DbRw@mail.gmail.com>
Date: Tue, 10 Sep 2024 01:30:46 -0500
From: Steve French <smfrench@...il.com>
To: 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, opensource.kernel@...o.com
Subject: Re: [PATCH v1] smb: client: Use min() macro
merged into cifs-2.6.git for-next
On Sat, Aug 31, 2024 at 11:43 PM Steve French <smfrench@...il.com> wrote:
>
> tentatively merged to cifs-2.6.git for-next-next (target for 6.12-rc)
> pending additional review and testing
>
> On Tue, Aug 27, 2024 at 3:54 AM Shen Lichuan <shenlichuan@...o.com> wrote:
> >
> > Use the min() macro to simplify the function and improve
> > its readability.
> >
> > Signed-off-by: Shen Lichuan <shenlichuan@...o.com>
> > ---
> > fs/smb/client/cifsacl.c | 2 +-
> > fs/smb/client/smbdirect.c | 8 +++-----
> > 2 files changed, 4 insertions(+), 6 deletions(-)
> >
> > diff --git a/fs/smb/client/cifsacl.c b/fs/smb/client/cifsacl.c
> > index f5b6df82e857..2f9a1bb6e21c 100644
> > --- a/fs/smb/client/cifsacl.c
> > +++ b/fs/smb/client/cifsacl.c
> > @@ -187,7 +187,7 @@ compare_sids(const struct cifs_sid *ctsid, const struct cifs_sid *cwsid)
> > /* compare all of the subauth values if any */
> > num_sat = ctsid->num_subauth;
> > num_saw = cwsid->num_subauth;
> > - num_subauth = num_sat < num_saw ? num_sat : num_saw;
> > + num_subauth = min(num_sat, num_saw);
> > if (num_subauth) {
> > for (i = 0; i < num_subauth; ++i) {
> > if (ctsid->sub_auth[i] != cwsid->sub_auth[i]) {
> > diff --git a/fs/smb/client/smbdirect.c b/fs/smb/client/smbdirect.c
> > index 7bcc379014ca..f307122b59fe 100644
> > --- a/fs/smb/client/smbdirect.c
> > +++ b/fs/smb/client/smbdirect.c
> > @@ -1584,11 +1584,9 @@ static struct smbd_connection *_smbd_get_connection(
> > memset(&conn_param, 0, sizeof(conn_param));
> > 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;
> > + conn_param.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.17.1
> >
> >
>
>
> --
> Thanks,
>
> Steve
--
Thanks,
Steve
Powered by blists - more mailing lists