mirror of
https://github.com/torvalds/linux.git
synced 2024-11-21 19:41:42 +00:00
smb: client: Use min() macro
Use the min() macro to simplify the function and improve its readability. Signed-off-by: Shen Lichuan <shenlichuan@vivo.com> Signed-off-by: Steve French <stfrench@microsoft.com>
This commit is contained in:
parent
9290038be2
commit
25e68c37ca
@ -187,7 +187,7 @@ compare_sids(const struct smb_sid *ctsid, const struct smb_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]) {
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user