From patchwork Sat Oct 29 16:19:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: KaiLong Wang X-Patchwork-Id: 12739 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp1420148wru; Sat, 29 Oct 2022 09:31:14 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4BF3lQeZktU50AfZw3IUX7IAmq1hff9id1TLxTw/gSWgWJPanp82bu0KAfi23ehHew+gXG X-Received: by 2002:a17:907:7211:b0:7ac:e7b0:3bb5 with SMTP id dr17-20020a170907721100b007ace7b03bb5mr4418262ejc.515.1667061074656; Sat, 29 Oct 2022 09:31:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667061074; cv=none; d=google.com; s=arc-20160816; b=YR1HbG7nq2ODaPk3GKBB08s/7fS3pBjuRnIOgWL0jSDkTY4Tmn13sfYqxPBMJNZXsS o2QiafAoM76pd0e0xP9MskfH066l9L4Y/ihZdCx2Q/mpZCXhPwYpsJlC0ZvnKMLz8QVj AV44LTcNAyZnDJOGMu2yR9DsPpBnNPqCY0xkOBd78tx/VlMxmx5dm41zZr3NOdyvQ/pQ FXpBuaM1k68wbw7C3WgKACjTCgR5l12OkGiDAW8yVo8o5Wg+8AzJAP6dktSiQDZrPU9X orm10U7QD3ExXf6BRAFpPxcEEs3FUIQMstw1vD02OzNbkC+3Z1buTUYT9nIakr1yCLPJ Qkag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:mime-version :content-transfer-encoding:subject:cc:to:from:date; bh=jVgYeJjx4M7KRCxchwWysHYQhNq2yfh93bqGLVpsrd4=; b=kK5yc+40kQutFTROvm1pKNkdJzODFT5YnHZyR5WxYhSISv7TSn44MNrUAPIyYV1oTu 03B0EdCdh2hkIkOmU2PPjRIwIdXW7anA0s5/yBSSCYtIvPTButwkaoIBrFisYeWj5ISL j1t7AAn2Am5AG0O7XUCBwL6hefiIBl6rzmynsNjgoTuylsuszpd4PfoL7N9HFEu1d1FD GX2/cMxZlTsfe6g2ChV0zKfjco5GTGgdmYRT7wkVequycVXprEtn8+H20tqLCgjAhp3f ldxSC2W2yMtXMbVqduMdxagoRPq1rZ4mX8L8OkLiNj4N1MlZ1c0imBEKEDX5KPT03wYG mJQQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ec3-20020a170906b6c300b0078db1258ae9si1800665ejb.555.2022.10.29.09.30.50; Sat, 29 Oct 2022 09:31:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229716AbiJ2QYY (ORCPT + 99 others); Sat, 29 Oct 2022 12:24:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51044 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229476AbiJ2QYX (ORCPT ); Sat, 29 Oct 2022 12:24:23 -0400 Received: from jari.cn (unknown [218.92.28.115]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id B9969AE7A; Sat, 29 Oct 2022 09:24:22 -0700 (PDT) Received: by ajax-webmail-localhost.localdomain (Coremail) ; Sun, 30 Oct 2022 00:19:42 +0800 (GMT+08:00) X-Originating-IP: [182.148.13.81] Date: Sun, 30 Oct 2022 00:19:42 +0800 (GMT+08:00) X-CM-HeaderCharset: UTF-8 From: wangkailong@jari.cn To: njavali@marvell.com, GR-QLogic-Storage-Upstream@marvell.com, jejb@linux.ibm.com, martin.petersen@oracle.com Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] scsi: qla2xxx: replace ternary operator with max() X-Priority: 3 X-Mailer: Coremail Webmail Server Version XT6.0.1 build 20210329(c53f3fee) Copyright (c) 2002-2022 www.mailtech.cn mispb-4e503810-ca60-4ec8-a188-7102c18937cf-zhkzyfz.cn MIME-Version: 1.0 Message-ID: <7ce8e1aa.43.184248abc71.Coremail.wangkailong@jari.cn> X-Coremail-Locale: zh_CN X-CM-TRANSID: AQAAfwD3C+KeUl1juOMAAA--.21W X-CM-SenderInfo: 5zdqwypdlo00nj6mt2flof0/1tbiAQAOB2FEYx0BLQADs8 X-Coremail-Antispam: 1Ur529EdanIXcx71UUUUU7IcSsGvfJ3iIAIbVAYjsxI4VWxJw CS07vEb4IE77IF4wCS07vE1I0E4x80FVAKz4kxMIAIbVAFxVCaYxvI4VCIwcAKzIAtYxBI daVFxhVjvjDU= X-Spam-Status: No, score=2.2 required=5.0 tests=BAYES_00,RCVD_IN_PBL,RDNS_NONE, T_SPF_HELO_PERMERROR,T_SPF_PERMERROR,XPRIO autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: ** X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748040233299964929?= X-GMAIL-MSGID: =?utf-8?q?1748040233299964929?= Fix the following coccicheck warning: drivers/scsi/qla2xxx/qla_dbg.c:689: WARNING opportunity for max() Signed-off-by: KaiLong Wang --- 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);