Skip to content

Commit 25e68c3

Browse files
Shen Lichuansmfrench
authored andcommitted
smb: client: Use min() macro
Use the min() macro to simplify the function and improve its readability. Signed-off-by: Shen Lichuan <[email protected]> Signed-off-by: Steve French <[email protected]>
1 parent 9290038 commit 25e68c3

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

fs/smb/client/cifsacl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ compare_sids(const struct smb_sid *ctsid, const struct smb_sid *cwsid)
187187
/* compare all of the subauth values if any */
188188
num_sat = ctsid->num_subauth;
189189
num_saw = cwsid->num_subauth;
190-
num_subauth = num_sat < num_saw ? num_sat : num_saw;
190+
num_subauth = min(num_sat, num_saw);
191191
if (num_subauth) {
192192
for (i = 0; i < num_subauth; ++i) {
193193
if (ctsid->sub_auth[i] != cwsid->sub_auth[i]) {

fs/smb/client/smbdirect.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1585,10 +1585,8 @@ static struct smbd_connection *_smbd_get_connection(
15851585
conn_param.initiator_depth = 0;
15861586

15871587
conn_param.responder_resources =
1588-
info->id->device->attrs.max_qp_rd_atom
1589-
< SMBD_CM_RESPONDER_RESOURCES ?
1590-
info->id->device->attrs.max_qp_rd_atom :
1591-
SMBD_CM_RESPONDER_RESOURCES;
1588+
min(info->id->device->attrs.max_qp_rd_atom,
1589+
SMBD_CM_RESPONDER_RESOURCES);
15921590
info->responder_resources = conn_param.responder_resources;
15931591
log_rdma_mr(INFO, "responder_resources=%d\n",
15941592
info->responder_resources);

0 commit comments

Comments
 (0)