Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp3706923rwl; Mon, 27 Mar 2023 18:59:51 -0700 (PDT) X-Google-Smtp-Source: AKy350ZtXoo9s4oxfyQNKttuIbQMx9MZW0tjP/BhycAwcLJRU/9lotG2DhMwSQv8zMSrdTq+ARX0 X-Received: by 2002:a17:902:ecc2:b0:1a1:f95a:2505 with SMTP id a2-20020a170902ecc200b001a1f95a2505mr18832577plh.29.1679968791003; Mon, 27 Mar 2023 18:59:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679968790; cv=none; d=google.com; s=arc-20160816; b=m3prgEnCJh/9NIuvl0qKT3C6n1QbI1JN9aEhsLe7LGq9f8EnKWve2rBuCSd0ZaCl/P e5WnxMMD+mySOjn5AYkiYlVRE1tZwnZD56wn9MFOyE6kK/Y+fBqtjvJ9uOaIipjgBoNb 6Trd+z0mqh0P4D36XYc7hy1bAK6oClAS4AkiMDmYypcdNRvU1Dy8Dxtu6vdW7xUVYrRp d6mHC4M3san1475prHwJgaUIAjYC7clnexdhZRzJjGViwHLGFAQj9eVFkrxubAyemfmp tExPb7I1J7Y/hoNP+jyHllGWv2BhRmfYuowWNbQQHlXYiK6Yju3r10z/CWcQi/u9AP+o V2tQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=Q25eP+3xyWs4d12siKEh5X2KyU/hBfqtr8MNZiUsH0A=; b=VxJqoFMQv8tbgLmSJIGReJfYOiALNkn+gsZDmihPgiHipc3vMzvz7xbhkBeDxXm0Dx VjQ7EMeABouG+IzofXUhwSSs3LY5izkMZROgU1ZKNl+byC0JjUPR0ul+okTkZmKUnGOS P2qelT6onBVj0uUD6HRafHAg+n1tJDsNDmIVPkq4Ba3n9yO5LailssBf6MElEWiJYTla 3GKhakVkKA7GH+nc4fQ+RiGTpj1K8pGhqZkE+8P5F35TTiFzOCSPqLzbYUOujuZL43zV 49+O4HA8dS5Z6DrrJXGWPvXRDrNRXmmirtWoghd6ZwNB+JO+X5JB0g2clP+iMetZfSNe 4izQ== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h7-20020a17090adb8700b0023b4158aaf1si11573088pjv.62.2023.03.27.18.59.39; Mon, 27 Mar 2023 18:59:50 -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 S232475AbjC1BwN (ORCPT + 99 others); Mon, 27 Mar 2023 21:52:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53856 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232269AbjC1BwM (ORCPT ); Mon, 27 Mar 2023 21:52:12 -0400 Received: from mailgw.kylinos.cn (mailgw.kylinos.cn [124.126.103.232]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2F4F21FDE; Mon, 27 Mar 2023 18:52:11 -0700 (PDT) X-UUID: 08321cc7251f4a488c4909c7af261d8a-20230328 X-CID-UNFAMILIAR: 1 X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.20,REQID:fcfc3164-7bc9-4ae3-bb3a-67c55f0bc93b,IP:20, URL:0,TC:0,Content:-5,EDM:0,RT:0,SF:14,FILE:0,BULK:0,RULE:Release_Ham,ACTI ON:release,TS:29 X-CID-INFO: VERSION:1.1.20,REQID:fcfc3164-7bc9-4ae3-bb3a-67c55f0bc93b,IP:20,UR L:0,TC:0,Content:-5,EDM:0,RT:0,SF:14,FILE:0,BULK:0,RULE:Release_HamU,ACTIO N:release,TS:29 X-CID-META: VersionHash:25b5999,CLOUDID:31748cb4-beed-4dfc-bd9c-e1b22fa6ccc4,B ulkID:2303280952064848OZ6D,BulkQuantity:0,Recheck:0,SF:24|16|19|43|102,TC: nil,Content:0,EDM:-3,IP:-2,URL:0,File:nil,Bulk:nil,QS:nil,BEC:nil,COL:0,OS I:0,OSA:0,AV:0 X-CID-BVR: 0,NGT X-UUID: 08321cc7251f4a488c4909c7af261d8a-20230328 Received: from mail.kylinos.cn [(39.156.73.10)] by mailgw (envelope-from ) (Generic MTA) with ESMTP id 484537904; Tue, 28 Mar 2023 09:52:05 +0800 Received: from mail.kylinos.cn (localhost [127.0.0.1]) by mail.kylinos.cn (NSMail) with SMTP id 3DAABE0084A1; Tue, 28 Mar 2023 09:52:05 +0800 (CST) X-ns-mid: postfix-64224844-71411298 Received: from localhost.localdomain (unknown [172.20.125.154]) by mail.kylinos.cn (NSMail) with ESMTPA id D4907E0084A1; Tue, 28 Mar 2023 09:52:03 +0800 (CST) From: Jiangshan Yi To: robert.moore@intel.com, rafael.j.wysocki@intel.com Cc: lenb@kernel.org, linux-acpi@vger.kernel.org, acpica-devel@lists.linuxfoundation.org, linux-kernel@vger.kernel.org, 13667453960@163.com, Jiangshan Yi Subject: [PATCH] drivers/acpi/acpica/exserial.c: replace ternary operator with min() Date: Tue, 28 Mar 2023 09:51:20 +0800 Message-Id: <20230328015120.111168-1-yijiangshan@kylinos.cn> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=0.0 required=5.0 tests=SPF_HELO_NONE,SPF_PASS, UNPARSEABLE_RELAY autolearn=unavailable autolearn_force=no version=3.4.6 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 Fix the following coccicheck warning: drivers/acpi/acpica/exserial.c:346: WARNING opportunity for min(). min() macro is defined in include/linux/minmax.h. It avoids multiple evaluations of the arguments when non-constant and performs strict type-checking. Signed-off-by: Jiangshan Yi --- drivers/acpi/acpica/exserial.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/acpi/acpica/exserial.c b/drivers/acpi/acpica/exseria= l.c index fd63f2042514..dfe507e0a09a 100644 --- a/drivers/acpi/acpica/exserial.c +++ b/drivers/acpi/acpica/exserial.c @@ -343,8 +343,7 @@ acpi_ex_write_serial_bus(union acpi_operand_object *s= ource_desc, /* Copy the input buffer data to the transfer buffer */ =20 buffer =3D buffer_desc->buffer.pointer; - data_length =3D (buffer_length < source_desc->buffer.length ? - buffer_length : source_desc->buffer.length); + data_length =3D min(buffer_length, source_desc->buffer.length); memcpy(buffer, source_desc->buffer.pointer, data_length); =20 /* Lock entire transaction if requested */ --=20 2.27.0