Skip to contentSkip to conversation

fs: smb: client: Replace the ternary conditional operator

PATCH New Lu Hongfei 1 participant 1 message Jun 12, 2023

Subsystems (3)
lore
Share & tools
lore

Lu Hongfei

author
#0 lore raw

PATCH 1/1 fs: smb: client: Replace the ternary conditional operator

It would be better to replace the traditional ternary conditional operator with min() in _smbd_get_connection

---
 fs/smb/client/smbdirect.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
fs/smb/client/smbdirect.c +1 -4
index 2a2aec8c6112..69f9023f89f9
@@ -1582,10 +1582,7 @@ 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);
Signature · 1 line
2.39.0