From patchwork Sat Oct 29 15:40:58 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: KaiLong Wang X-Patchwork-Id: 12735 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp1414415wru; Sat, 29 Oct 2022 09:14:11 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5MlgMboTzuBPy72W9vq4eUUAByDzX5sZD36HVtg4TtjKgB1xPtWHKA5NSAxZz5g5RFwLvC X-Received: by 2002:a65:49c9:0:b0:462:9ce1:3f58 with SMTP id t9-20020a6549c9000000b004629ce13f58mr4558862pgs.200.1667060050743; Sat, 29 Oct 2022 09:14:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667060050; cv=none; d=google.com; s=arc-20160816; b=IKQl02uXJP6rDglKcUuBvsAg1SwNu2JALPeFfW3gWdDNIj3l/GCwbNGx2CM2rzwKew vtKbFd9ZYKv7TLxuC2WOZm17FoyjKs4cJ8HmvBl5Oh+/Vai96C/At+JdwigIBjaj6RRY WQ7VVAC/OWWHFMdAZ5668I/Zpwa1n3KzwWiK6cRwT2CIQrlzuLXNDhkiAhcAh2r3QVRA xgUhB0mgfXWjxvajpHs5dUOdYjscrLHKZqdDXJwUaEaI3lfh4AeEWkfrfmQ/1j6nlKHh UZ+t7nl3ZT31nh9/gKSsPR21JD9dEOhx95f24ggpy3ywUswKRXFBsUWMg2iDgtY7Bksg BKuw== 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=R/As33T0tKJpsdWmQbqMTwA5Nv7rBxxPj6Bz9y/COZk=; b=eGh+lsNCG4GepLbMx9isF70joQwocLo7+EBzCx04mSY4L3eoIaPHpV4/JpihjiGjNw G3v/w4CsLr7wZJQpQM1B5oCh49+iQvZUMnw08XGFja6Q5MO3QGrEpnZcaYAljwBrnRmv Ci0oQ6o6MGl4UDQFGSX3jEHEOLu0FfXUlkYGoFaANQpZ3H90hrwKlJqXmfQZ3zptn1sT tiOPzVertG0naL5e9jsN1HzJKwmkftGTNZOdib1kfDhIPkf+QUkJZr68C8l0hUahVu9g GoGk2Tdl63AnCbUH8U5/OMVhkF5TBXTeLUljILQiMoOHuZiuQ9qf8tVXf1KlhqCeoIR4 rcGw== 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 kx10-20020a17090b228a00b0020ad4d5b9e8si2106425pjb.89.2022.10.29.09.13.57; Sat, 29 Oct 2022 09:14:10 -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 S229717AbiJ2Ppq (ORCPT + 99 others); Sat, 29 Oct 2022 11:45:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36344 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229692AbiJ2Ppf (ORCPT ); Sat, 29 Oct 2022 11:45:35 -0400 Received: from jari.cn (unknown [218.92.28.115]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 3524D631ED for ; Sat, 29 Oct 2022 08:45:33 -0700 (PDT) Received: by ajax-webmail-localhost.localdomain (Coremail) ; Sat, 29 Oct 2022 23:40:58 +0800 (GMT+08:00) X-Originating-IP: [182.148.13.81] Date: Sat, 29 Oct 2022 23:40:58 +0800 (GMT+08:00) X-CM-HeaderCharset: UTF-8 From: wangkailong@jari.cn To: Kai.Makisara@kolumbus.fi, jejb@linux.ibm.com, martin.petersen@oracle.com Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] scsi: st: 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: <317f9e05.40.18424674406.Coremail.wangkailong@jari.cn> X-Coremail-Locale: zh_CN X-CM-TRANSID: AQAAfwCXq+GKSV1jUOEAAA--.20W X-CM-SenderInfo: 5zdqwypdlo00nj6mt2flof0/1tbiAQAOB2FEYx0BKAADs5 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?1748039159793601816?= X-GMAIL-MSGID: =?utf-8?q?1748039159793601816?= Fix the following coccicheck warning: drivers/scsi/st.c:1577: WARNING opportunity for max() Signed-off-by: KaiLong Wang --- drivers/scsi/st.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/scsi/st.c b/drivers/scsi/st.c index b90a440e135d..5477897aa920 100644 --- a/drivers/scsi/st.c +++ b/drivers/scsi/st.c @@ -1574,8 +1574,7 @@ static int setup_buffering(struct scsi_tape *STp, const char __user *buf, if (!STbp->do_dio) { if (STp->block_size) - bufsize = STp->block_size > st_fixed_buffer_size ? - STp->block_size : st_fixed_buffer_size; + bufsize = max(STp->block_size, st_fixed_buffer_size); else { bufsize = count; /* Make sure that data from previous user is not leaked even if