Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp4224854rwd; Tue, 30 May 2023 02:11:05 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4VFw5qCvTptHTZF0Vz6YDY/api6b6vy6DA7g16JLtLTISLE82/KHrKfAAu3y6mxW6GreLu X-Received: by 2002:a05:6a20:a208:b0:10d:1abb:e31 with SMTP id u8-20020a056a20a20800b0010d1abb0e31mr1314944pzk.50.1685437864964; Tue, 30 May 2023 02:11:04 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1685437864; cv=pass; d=google.com; s=arc-20160816; b=XNLurQl4vPeOGcZdIJliOIVb0H0EXbtPcMESMuJ6duh1Vs1TExCQpKb08xUeM/6Q3b XdRbgVJbDLATqMHh9xP+DMZaYYxUul1SUtLy0m2DygBOk+uptugYdaSRRzGEFU0slsML JchPq63p0s5laESRGb8yYe8z9FL3Szg6MNOmSrDF6d7u4vw5411rAu9qG+1uPq9XkHLk 6BlnGPvPX9106qJYDB0znDTrV+LVCqyqf2c1arc+7A/p1voUDzmhlvb0GjCnIqm3UrKF PzAMv2zoEM07Rl5H69MFVhZg/6tx5/+PuPnu8IxedbBmWvljjOs8m7hoJ+aW2S4mpdcd AHJQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :message-id:date:subject:cc:to:from:dkim-signature; bh=gxec+QlojZDbZO4XWxTUaQdUcZhwseYskfYJQntQvCY=; b=b7leqoFvffadwTFf9DdudaEjuNEy6JSU4sXl4ZGl31nmeIXGu3Q8Wx0UF8QA88V5Nn F10rFtVY9A4Q8YUI32SEurGVZh25appHf6u8pAd7dAY0NpY345gK2e4WBo8GkNyiolKl nMsMnTP5ahP0v0NrlGpVbHe65H7EB28crm0j1BXnQGW5jLk1wBFyVO8dW6mLmGMBSEq7 ajt841xXcd9s62XtRi9Y+BpriPgfuKq8rDujW/fOP/5oE1ZIUBdlZS5YBTZzx3iOqdlU jC0Hk+cxYsUiIAU9NotAV1XR0sl3xd+epI16N5/wDExw81cC/eUogDBMcU1QVwOsizkw 1GAQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b=BQAGYqWh; arc=pass (i=1 spf=pass spfdomain=vivo.com dkim=pass dkdomain=vivo.com dmarc=pass fromdomain=vivo.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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=vivo.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m14-20020a637d4e000000b0053f24deef11si10262017pgn.318.2023.05.30.02.10.52; Tue, 30 May 2023 02:11:04 -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; dkim=pass header.i=@vivo.com header.s=selector2 header.b=BQAGYqWh; arc=pass (i=1 spf=pass spfdomain=vivo.com dkim=pass dkdomain=vivo.com dmarc=pass fromdomain=vivo.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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=vivo.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229630AbjE3Ipz (ORCPT + 99 others); Tue, 30 May 2023 04:45:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52396 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229553AbjE3Ipx (ORCPT ); Tue, 30 May 2023 04:45:53 -0400 Received: from APC01-SG2-obe.outbound.protection.outlook.com (mail-sgaapc01on2128.outbound.protection.outlook.com [40.107.215.128]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9B091A1; Tue, 30 May 2023 01:45:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LMi1h0jFTji8uOPri5kd6S/OQldMZNJy0jevX4Ahb4YWIO2N5hD4dPkIG3OxVc4T26xXO+I7f2SF3VmCciOx3A2rrLCViqQ6KswvToHhdimuCIwiSW/7Av31GTfOqRX/SKXntq4oa5YOvDi91sWRf1kAW723PmXkZUWGiFjZ41RwvLD1jhVfT4Ojy9TEcoIoG5lmNUhMfkK6Lht82c9oTwjfURSjrP+2b8Ob63LIWaIF65hoJVrJxL2KLNvbnZ5wbQcNnBjGRCiJEnNoW3ItwQKLsPgZLdFJUpP2qpaf77KbpFvFCpqRaLJFX33L9Z/hKng45wY0SWA8uRIXZwSO5A== 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=gxec+QlojZDbZO4XWxTUaQdUcZhwseYskfYJQntQvCY=; b=NNRbU74h6g/JkchZ1BvsP79klEMAgot0k9LqzwWwFyqW9QugVo5wVgOVydFK1OwyMCtriMFrRccw1o9ifFIsAUh2B/3W6PfHUkEOv4H1CCc3LWcEq1aCOEwCFLaaUtEKekvV/F+4Mfv1u2khNsL5nTIiXoZ9kYS3vopTi5f1acqVUccOEswb2rZXqKaa/ILqDCc8mYSotN2On0EbMvGu1bVY6Zmi1OtVN3/ev+lXYm/swDge54CiyvxKZNPctjG2c+AfV7/7egR5D7eEzmO06lWu7MG5QbVSsmqLYKzSfVPhDK40cJFymOVnUeix4BgX99IWTpb8Lulv7xg5lOnfMw== 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=vivo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=gxec+QlojZDbZO4XWxTUaQdUcZhwseYskfYJQntQvCY=; b=BQAGYqWhX9iYAUoWlv05TUT+CmlQewyXtwWqgupuBaeK8v3SsCAOnKOFN/LJozPH0raPpvN3YoJCESl3ARByyLdWK+ElH5o9vo7ROCKpzWpwrRe995QoXdO49HxbGxHBaR7vMeOe2b3kdLNIF0NaGOhX6428JA+kiB434wB+ds27mClKA0J0YNH4KAgAHyCsuMfipJ4fUXzngKCDgtyHFhVI9ASYt/5OWxKmcHcKL9kbCnjUTgLOu0aNJu/x4FkAoTXGX+zvcLssi1J+Vtj/JEwkHbDEhqyCKICxum++sRbOSjNpPjuWDvmzcgLiWHew0Pi4KMQnE6LwqPZznZYyJw== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=vivo.com; Received: from TYZPR06MB6697.apcprd06.prod.outlook.com (2603:1096:400:451::6) by SEYPR06MB5326.apcprd06.prod.outlook.com (2603:1096:101:6b::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6433.23; Tue, 30 May 2023 08:45:47 +0000 Received: from TYZPR06MB6697.apcprd06.prod.outlook.com ([fe80::f652:a96b:482:409e]) by TYZPR06MB6697.apcprd06.prod.outlook.com ([fe80::f652:a96b:482:409e%5]) with mapi id 15.20.6433.018; Tue, 30 May 2023 08:45:47 +0000 From: Lu Hongfei To: Andrew Lunn , Heiner Kallweit , Russell King , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org (open list:ETHERNET PHY LIBRARY), linux-kernel@vger.kernel.org (open list) Cc: opensource.kernel@vivo.com, luhongfei@vivo.com Subject: [PATCH] net: Replace the ternary conditional operator with min() Date: Tue, 30 May 2023 16:45:30 +0800 Message-Id: <20230530084531.7354-1-luhongfei@vivo.com> X-Mailer: git-send-email 2.39.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SI2PR02CA0012.apcprd02.prod.outlook.com (2603:1096:4:194::7) To TYZPR06MB6697.apcprd06.prod.outlook.com (2603:1096:400:451::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYZPR06MB6697:EE_|SEYPR06MB5326:EE_ X-MS-Office365-Filtering-Correlation-Id: 26689f37-ce37-4767-2787-08db60ea4360 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: rjfF1Rt8iDCguQtN9VOFzhiufcLcyq+iRNbZ2SkVZcmwAjMWdV4boCmicEIWjQUQ8PDQFncArCcXIlXu4IIVQvsqEnlQbNpgOV3fDf6bWJYARuZJq3tZMekZli4MSxhHLYMLAgcMT5E+g0G4rU66XEEKhrSDJJzXCpbTilsaoGhmZ3LzEVgVpp3k0U+kT0rEwH+4uCvI4H1/ldwRhY1KZ7R7jqVz5YL2MegR3rK6LTt7BGEUvDh2qxF3ueaL/pKK76AeIZCmZI5GbBe2sH40QP717M7ZkgYI/jfsnz9456moA+tacBjvaTOiWzp8yL4X92rLtgUQEciAGkUawTTy8TL5sFqCi7iOLqrgIyh6uyNrfCTxvcHoL98tU8RJHMe9Mdod+GGVqfzxn9O5MhwNrJiAt5DjQXudxSs6r7eWkVilmiy+e7d2buRMMY3vjCA1jEmER9Ts/KAJshsIjd/g80fesQpEfuNQ8BsJSfkI+IiQiIWSo4+lzSpFZ54vxnHS4x+w+pZDnrBd/39wD36wBu2K7tcPqhFSuchJLADE2ERUhUkCdSQstD89BJFvhVoILDgzIuSLZoEVY5HiLiZdj0Rpzp0ksBo34PzMi7TptRDkSbDdSd2qYuTyiuFZBvXO X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:TYZPR06MB6697.apcprd06.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(366004)(376002)(39860400002)(346002)(396003)(136003)(451199021)(186003)(107886003)(2616005)(38350700002)(38100700002)(41300700001)(83380400001)(6512007)(6506007)(26005)(1076003)(6486002)(6666004)(52116002)(478600001)(110136005)(4326008)(66476007)(66946007)(66556008)(316002)(5660300002)(8676002)(8936002)(2906002)(86362001)(4744005)(36756003);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?IfS3s8dmQTGO8r1unO1KnVwL0d1/P8WqZ2azTwyCIXvrJjDKJ22WOkOAilkG?= =?us-ascii?Q?JGocIixhrJlEk+5FL7q0EygRCQ8tV94/YyfAkw0A8kqyMQSnS6PbhAoOwdtB?= =?us-ascii?Q?V3Wce8vSSdUQ/mJGEBiM2Avcrg13K/fi5w6Qnc0cMCafmLDqu301EVCOvPt3?= =?us-ascii?Q?WG35JceSCV5kOZ9zdqDURXoi54AzhLA1TMfjZs7uyqWlajtJD3sBOSZ+iLHX?= =?us-ascii?Q?6gWpg/2REs/YeAl4G+kMacBjZP/EJCtkyw/HiOfVfgvZpvUgpnG8K/srn2/A?= =?us-ascii?Q?NFl/1HQjUtgBZMkIo3JZYKebKOmWRHNGef55NAx6LroxZWQ01w1zvXHleVHN?= =?us-ascii?Q?xTJ93bTyimRaigls53QeHfbO6iquYBXd4q0Y24YakPa3BIlthBx1M0UTPOH4?= =?us-ascii?Q?vYjJHkL/AJNP1pX6FRv5M4pIDaG8WX9s0gwh4G068f/vFOTWdR5GAypRrdqJ?= =?us-ascii?Q?8RGDsJdfOoiYUf8l/oAPmxuTCmq8XapOhljsRZcF+FVPkyX/rpqRJVtSVfgY?= =?us-ascii?Q?Cmz8uFduybay8MrqzdTl/EisPbwUAt5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E3PLVaZ3WuShKKuUtDCXisqPJzIEhDgG2L2tU1kAwdQwSpfqzMP+p+eR?= =?us-ascii?Q?9OuUAW0kvlTKWPCp5J92Ap+Ifcp4Sg+zlyQUoFssWVfL+0dDu4EXpFz6/Iw1?= =?us-ascii?Q?H7famWKhJmX3tHORjg20rgEwXLuLPpt+7Qi8Aos1?= X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 26689f37-ce37-4767-2787-08db60ea4360 X-MS-Exchange-CrossTenant-AuthSource: TYZPR06MB6697.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 May 2023 08:45:47.4045 (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: mTEhkT4vb2jpiuQ13cFeYSPvVL1rJ7cT2jbAKN1enaKwBGZSO654Jp8YTsYIR+imxZnqppOKYwfAzGk+1mmXQA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SEYPR06MB5326 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED 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-kernel@vger.kernel.org It would be better to replace the traditional ternary conditional operator with min() Signed-off-by: Lu Hongfei --- drivers/net/phy/phy.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) mode change 100644 => 100755 drivers/net/phy/phy.c diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c index 0c0df38cd1ab..a8beb4ab8451 --- a/drivers/net/phy/phy.c +++ b/drivers/net/phy/phy.c @@ -1002,7 +1002,7 @@ static int phy_poll_aneg_done(struct phy_device *phydev) if (!ret) return -ETIMEDOUT; - return ret < 0 ? ret : 0; + return min(ret, 0); } int phy_ethtool_ksettings_set(struct phy_device *phydev, @@ -1526,7 +1526,7 @@ int phy_init_eee(struct phy_device *phydev, bool clk_stop_enable) ret = phy_set_bits_mmd(phydev, MDIO_MMD_PCS, MDIO_CTRL1, MDIO_PCS_CTRL1_CLKSTOP_EN); - return ret < 0 ? ret : 0; + return min(ret, 0); } EXPORT_SYMBOL(phy_init_eee); -- 2.39.0