From patchwork Thu May 12 13:25:11 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guo Zhengkui X-Patchwork-Id: 1630199 X-Patchwork-Delegate: patchwork@peda.user.lysator.liu.se Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=vivo0.onmicrosoft.com header.i=@vivo0.onmicrosoft.com header.a=rsa-sha256 header.s=selector2-vivo0-onmicrosoft-com header.b=br/synv7; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=2620:137:e000::1:20; helo=out1.vger.email; envelope-from=linux-i2c-owner@vger.kernel.org; receiver=) Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by bilbo.ozlabs.org (Postfix) with ESMTP id 4KzXc12HtXz9sGF for ; Thu, 12 May 2022 23:26:25 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1354361AbiELN0V (ORCPT ); Thu, 12 May 2022 09:26:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57500 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1354412AbiELN0S (ORCPT ); Thu, 12 May 2022 09:26:18 -0400 Received: from APC01-PSA-obe.outbound.protection.outlook.com (mail-psaapc01on2095.outbound.protection.outlook.com [40.107.255.95]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1E66C3CA56; Thu, 12 May 2022 06:26:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CjwoFJC5qtM95UuXaLL1LgzbJdZSmGVOyfeEo0VOV1ogDVUe/GHhKJJUE3dEwiTJeVZvEHahCwZU92MJzL8OvBZf83pcUWJj97cMTY9FXOYvUtpOH1ysWtx9Rly302u52WhPcaEuWI3ocJBQfEFu94BpQ0qBzZU+1XbKG58LYCh2axHPA8CV/yfV1fytWFCyg1se0AAUt8eIQNFlZZUXaIfrIJLxgNYFUB9a8Cl8n1PsbQefm3PdGgqppNNV9gExyv+JtZkW16xceLs6CS7AAc/L2/ziyHoWlEi6FyMASjIGSNNsRH0iD1hZv8v41VAA8c2GbEvRutYcce0piZ2Ivg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=u+Ei++l8lmdvNx8jPnWLTrsnKEdjHcLWtnXjPHuwL/0=; b=kjDfWsLBHhz+K+FVgreHOuCYCCN6qXcUNLD9PhjdF5glbFCIyDWeIDiLwqjSiO2GJwv1RbDX3wb4ot5q8SbLNqIpmPlxjx/iiqESpwSqGAIPoZ1ieZZDil2TtWi1oVB/UtYIINzCqxujhloVOLTsIBVi3AvrAoxdJhg1UGRjGIviOP6S4OYzI0Ow3NGDwN89HmANAwMFYAoBKu2v/Jj1lr6dF/4SNWWlcISs6zR+igFjqVPAZkwwdgybIA3o1vK9IXDaEMLoPKCJMw5ueuR1DzUYqAelP8Ku+kB0xc0X6NA7PX2riYL3n2y7iGP+fhwkK7RXIEXYznNLOVGmd+Q6Wg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=vivo.com; dmarc=pass action=none header.from=vivo.com; dkim=pass header.d=vivo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vivo0.onmicrosoft.com; s=selector2-vivo0-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=u+Ei++l8lmdvNx8jPnWLTrsnKEdjHcLWtnXjPHuwL/0=; b=br/synv7ktX9za79G15VsGlTIJ88lJKCyIKObQkAF5Cry6uiHZqLfug2OnHSZFZqO/vs1urscA1p3vkCy1UKNazysQahOj1VarEjVFE+c4wxkqGadGgX+VMDPUoGqRqMGi59SMSnT2xk+/TwrNyY+tQQ2DPoyLJyQDYpjRlcn3E= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=vivo.com; Received: from HK2PR06MB3492.apcprd06.prod.outlook.com (2603:1096:202:2f::10) by SG2PR06MB2442.apcprd06.prod.outlook.com (2603:1096:4:56::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5227.23; Thu, 12 May 2022 13:26:12 +0000 Received: from HK2PR06MB3492.apcprd06.prod.outlook.com ([fe80::88e1:dc04:6851:ad08]) by HK2PR06MB3492.apcprd06.prod.outlook.com ([fe80::88e1:dc04:6851:ad08%7]) with mapi id 15.20.5227.023; Thu, 12 May 2022 13:26:11 +0000 From: Guo Zhengkui To: Guenter Roeck , Peter Rosin , linux-i2c@vger.kernel.org (open list:PCA9541 I2C BUS MASTER SELECTOR DRIVER), linux-kernel@vger.kernel.org (open list) Cc: zhengkui_guo@outlook.com, Guo Zhengkui Subject: [PATCH] i2c: mux: pca9541: replace ternary operator with min() Date: Thu, 12 May 2022 21:25:11 +0800 Message-Id: <20220512132511.40637-1-guozhengkui@vivo.com> X-Mailer: git-send-email 2.20.1 X-ClientProxiedBy: HK0PR01CA0065.apcprd01.prod.exchangelabs.com (2603:1096:203:a6::29) To HK2PR06MB3492.apcprd06.prod.outlook.com (2603:1096:202:2f::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9198f77a-5475-450f-ddb3-08da341afad4 X-MS-TrafficTypeDiagnostic: SG2PR06MB2442:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: mkA1z3m97YK/nZ7HSAP2KM/3eX+6kWIhEuybpLVbqKUrZA7fHnuQUlWqxhpv7e2l/B24/sYAtU6tBhftjn5oUTxtl3nw/+IOsBUxc9kxjNmVBy6J1zBEomkOT3Y7ZOlWdqNmfEndr1MRGeL/2rOWQr0nzR0alOMrXajwg+gXv5V1cy8yNpPcOtmohP5R+TvCtlvR/HJ4XwZ6lksWXGEpH/nY6Yv9VdZcRv1gOeEE/tKcuUdCJ+9UIGFyWkZ537qtIu15rv6y2uT4X5FHcDNH07NPY4uJaiO34cn9264RuGBe2Uy0KFM9XAEoyj9XYFzu2Kde/1bKIAWaQjyuniXiebEIPUqhCKw1EM/KZkRalQQHc62E3tAYVUsJUrU91q5lFl9aVWC8fP/axQX1GXD2Sql6UDHdz7R6tXmIrGFKwBvWbMPxNBHRFMxgqm26snZxatcC0lvtvm+JwxdM+xXUR+NbBqjbQo52HpPhy5ooFbWxt/DohCxXzCc9q/zbX3nwUJQ02z7ulHaIl8wdJx25+EjLDFbYoC5REhuj0bomSbvCgx5dijobSCG9A8WW13zVqTjahUlNO+hIz9vppBMHPSATnsQ75uzGCTn78kzovV2pMB0/Ljf8EnPp47E3MC138TN6x9bEU6vwp0e1oPwp1zK8GXysu5x0NB9dFju8ptEcKabGs+Hjnvqb0k7OvIUwbm4hQn8FCusFhoxzcxQvSg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:HK2PR06MB3492.apcprd06.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(4636009)(366004)(110136005)(8936002)(86362001)(6512007)(1076003)(6506007)(6486002)(316002)(52116002)(5660300002)(4744005)(508600001)(36756003)(2906002)(66556008)(66476007)(107886003)(38350700002)(4326008)(66946007)(38100700002)(8676002)(2616005)(26005)(83380400001)(186003);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS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k5mf5q6I+NqgQnK6ZbmflSEGUwt5CLS9Ll5VLolmGIo253a/GMuP2q7M8+gRQe8bXHOFyesVBmCVCehMIt32YUnRO4gIN+AKGvVZiW3qxYRKThx4EVpXVvQLdPp/Yv6JSeMjiMGfE/XF4vl7rVZEn+6FQRZHZcGzeFG7aH0erl/XHwQ73bIUxpxWigci4mMF1jjMgkaU3GdgskXBWYgt++r58mQKVpJIvsj/HD2eWflZ7pBuU3GY9e84eg6/WCqHoA8LP2cxvozV0L48dxhKgKkEXlozjp7HMU0KVVtFpJR92scQ4fTxZOEwqosTVAVC2ojiHmZWSUy9VqRO5r1RFhcwd6xRjWPW4AxTntFv7GzcWQMriyu6NaeyEdwscJ6iJKiMWyvNNa1o0mDz4QwXueSAqBmAmecBrsIZUrQHJe4flAnlcfkrRuT1LUxBl2Va2QfjzfFyQr7Zb2jYfKC1JGxKyHfH+OJBkf8YXmNWW4U771ozs6cmii/r3Ej01SPMkMvvT54LBmVEGfe7BETAV1F7RQO998LN2wK9TWc3ic42lNrvHx9c2VpOtSZ+Vbz5LRYPXs0oA0m7RtZ23eW1vuvHmC21DxQMkQpFdJU1l6UrsT27qX46QRkmLRyVTuXzSLPo3HxC/842FL14uuYANJyhQxRPxbSE4aM93yVo+0g== X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9198f77a-5475-450f-ddb3-08da341afad4 X-MS-Exchange-CrossTenant-AuthSource: HK2PR06MB3492.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 May 2022 13:26:11.0582 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 923e42dc-48d5-4cbe-b582-1a797a6412ed X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: XPxTel1EDRkgPtJSZGG01VQ7VLHaKySdW9OOhDEWt2tB0dg+S0XvpDeQqpPItQauGm+GvXS/nbsqLelxi/gW0Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SG2PR06MB2442 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham 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-i2c@vger.kernel.org Fix the following coccicheck warning: drivers/i2c/muxes/i2c-mux-pca9541.c:263:14-15: 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: Guo Zhengkui --- drivers/i2c/muxes/i2c-mux-pca9541.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/i2c/muxes/i2c-mux-pca9541.c b/drivers/i2c/muxes/i2c-mux-pca9541.c index 6daec8d3d331..f374a1e85837 100644 --- a/drivers/i2c/muxes/i2c-mux-pca9541.c +++ b/drivers/i2c/muxes/i2c-mux-pca9541.c @@ -260,7 +260,7 @@ static int pca9541_select_chan(struct i2c_mux_core *muxc, u32 chan) do { ret = pca9541_arbitrate(client); if (ret) - return ret < 0 ? ret : 0; + return min(ret, 0); if (data->select_timeout == SELECT_DELAY_SHORT) udelay(data->select_timeout);