[<prev] [next>] [day] [month] [year] [list]
Message-ID: <7ce8e1aa.43.184248abc71.Coremail.wangkailong@jari.cn>
Date: Sun, 30 Oct 2022 00:19:42 +0800 (GMT+08:00)
From: wangkailong@...i.cn
To: njavali@...vell.com, GR-QLogic-Storage-Upstream@...vell.com,
jejb@...ux.ibm.com, martin.petersen@...cle.com
Cc: linux-scsi@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH] scsi: qla2xxx: replace ternary operator with max()
Fix the following coccicheck warning:
drivers/scsi/qla2xxx/qla_dbg.c:689: WARNING opportunity for max()
Signed-off-by: KaiLong Wang <wangkailong@...i.cn>
---
drivers/scsi/qla2xxx/qla_dbg.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/scsi/qla2xxx/qla_dbg.c b/drivers/scsi/qla2xxx/qla_dbg.c
index d7e8454304ce..68ce440bd6cf 100644
--- a/drivers/scsi/qla2xxx/qla_dbg.c
+++ b/drivers/scsi/qla2xxx/qla_dbg.c
@@ -686,8 +686,7 @@ qla25xx_copy_mq(struct qla_hw_data *ha, void *ptr, __be32 **last_chain)
mq->type = htonl(DUMP_CHAIN_MQ);
mq->chain_size = htonl(sizeof(struct qla2xxx_mq_chain));
- que_cnt = ha->max_req_queues > ha->max_rsp_queues ?
- ha->max_req_queues : ha->max_rsp_queues;
+ que_cnt = max(ha->max_req_queues, ha->max_rsp_queues);
mq->count = htonl(que_cnt);
for (cnt = 0; cnt < que_cnt; cnt++) {
reg = ISP_QUE_REG(ha, cnt);
--
2.25.1
Powered by blists - more mailing lists