From patchwork Tue Jun 27 01:21:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: You Kangren X-Patchwork-Id: 697195 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 83253EB64DD for ; Tue, 27 Jun 2023 01:21:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230083AbjF0BVs (ORCPT ); Mon, 26 Jun 2023 21:21:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36856 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229703AbjF0BVp (ORCPT ); Mon, 26 Jun 2023 21:21:45 -0400 Received: from APC01-SG2-obe.outbound.protection.outlook.com (mail-sgaapc01on2116.outbound.protection.outlook.com [40.107.215.116]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C1EB0173E; Mon, 26 Jun 2023 18:21:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=V6Dcb5W+KmF0ly6k4OodOdUNUNI7x30LtvUFpl7a2QdTHj96bBB6BpsmSReyHSK9L2iMUmmpiZ59FBTGgQruGJQ+kotPbKGjIu5WktIOGy9dl1bwcemsHL9zjyFMLMhuisKhFU3mCcaqF4S5x5uIp4TrwrcwE2+lx7ubYkpnCyZvPOHbUteQ/g7olUBMr16WSN5NE1iHCqCY5vVDP4wTkYnuLuUY3ZG7fgEuV/ywwrQkKzjzIirfypTr+KsbQFd/VoP9NYX8bABOdISAcuu2oeQGu6pQm5UISVFw5M2JR9ereEaKDb2WsukzDeJEl6AmIyqrkIrPgiEiTTi/rm9SdA== 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=wY5tA3V++FRLrpsAcsPaQBkCmzG17OjpSALkEpFk47I=; b=FTKOAZeOvoJoXXAAf1NMEGDnqchwVeIl/2o0OyCYebCGDTCcQ9KwfOwNoNCZnIZr6IOUryuaYzJ7j7zBTwEGZTHSzHEJLPqZIDG+LiFYOaJhLk4IV3hqR6//9fmR6uqKcXyfvGQu4vd1E9Iy6kOLJ5XRgBxe2djR5QmGQFoFQ0OS15PMsVl28aNN9ofGetl7V56tudIiI/2raS2/ZXo3buQF21xs6xiPwCBvRyT9x3WaOf9FHvaxp1Ng9eDMlCPTOdrlq0KRnemIMN//OctEkw3WUrVe/UunclzTwU8LR3GtWHI+/3TEP7sTetuF7PAQCCjdvGaG8N+/mBuVCky/Fw== 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=wY5tA3V++FRLrpsAcsPaQBkCmzG17OjpSALkEpFk47I=; b=OfzWteAyQGSWlTZoR8YK+LVfhDuP0q79LCDE/CAke0mR+kPN1nDJDqiyDsz7/T9lpSI9jV+fzFkp76SbJSHZwrW6bzAk4V6Iu/9ay/QDaUgpYkhN6RLt9ApbKQiVaj3Y6ondKmc+TcE0TAn2cPXNLghtUAM6zfKcGooFqQjmR8XUNVTuoAsZJSaMjKwYHupld5/LyQwYZyxkZmW1bDjRD/7HPapUbwAFXFN5V9N+2+H+2Nw9SYStXmixHIOEHB3UNbUupwzbT93qgUCfK5xrrpm0n5YkOwHmO/291U1Mlovf+ZJiBo9BqjRCMzv1/DZqriABVIz73wfkHvBC3fgMkQ== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=vivo.com; Received: from PUZPR06MB5936.apcprd06.prod.outlook.com (2603:1096:301:11d::13) by SI2PR06MB4378.apcprd06.prod.outlook.com (2603:1096:4:15a::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6521.26; Tue, 27 Jun 2023 01:21:39 +0000 Received: from PUZPR06MB5936.apcprd06.prod.outlook.com ([fe80::adc0:c22:ffae:227b]) by PUZPR06MB5936.apcprd06.prod.outlook.com ([fe80::adc0:c22:ffae:227b%6]) with mapi id 15.20.6500.045; Tue, 27 Jun 2023 01:21:39 +0000 From: You Kangren To: Kalle Valo , Dongliang Mu , You Kangren , Christophe JAILLET , Simon Horman , linux-wireless@vger.kernel.org (open list:RAYLINK/WEBGEAR 802.11 WIRELESS LAN DRIVER), linux-kernel@vger.kernel.org (open list) Cc: opensource.kernel@vivo.com Subject: [PATCH v2] wifi: ray_cs: Replace the ternary conditional operator with min() Date: Tue, 27 Jun 2023 09:21:26 +0800 Message-Id: <20230627012129.4066-1-youkangren@vivo.com> X-Mailer: git-send-email 2.39.0 X-ClientProxiedBy: SG2PR02CA0120.apcprd02.prod.outlook.com (2603:1096:4:92::36) To PUZPR06MB5936.apcprd06.prod.outlook.com (2603:1096:301:11d::13) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PUZPR06MB5936:EE_|SI2PR06MB4378:EE_ X-MS-Office365-Filtering-Correlation-Id: ce2eac27-9a29-4983-16d3-08db76acdb2e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: FZcnstUn+2t26eHfOTreJNzTin376bsaMvEVruJ1+ozDQHuJCeI2uAg2F0MHU9R0KPJBQU0953PqikXP1YBMM7/HDr3beTxK0yRQhPOT0qVAOYu6LFzxk9PGQxPxY521AdAO/U9CxJtju8hysvgK6gLhnFcsOJQJyJQ28x+Tj22rWn4lvq/zAHnbJXcrU3wqLF93Cqesai+El34+AxvrMKQYFf6dIu6YcY/lg2YAl5HLQPEUFoCKNl96uKJasUGC6DP+FBMBcu/b1BHqK5EH5DvNwlqUBW2KzUhDLwQ5oUDq3G7NqSLQm6r+lrkt6+cylKvLJs6NCRca+WLOtNp1VrZn0ypuKJR8tBKTyDk/dsAjFuLASgf/yznnL9l+hW7uUuhxL0XWxXEjOUo3cp/ogvETYrSfD37KNdwitN5ceKOP1cXEETz7getIvUHt3M5YQGw4H6qsmVG3f48m056JXs9P7R7mJdUYfzUwG6huUgnPCrPT8is+xaH6OWwlD7XBqy3OKyAH7SiTGfOipj44qVtIYqh8f9sPG9Cb6JTJZr4HEGRIYt2G235VGFu3eXy2Ky2kX3f2NfmMDkFa3WuDSXmgWjGMInz1/6CnRCg5StWacoJPc//K+mfZIXaNrwDk X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PUZPR06MB5936.apcprd06.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230028)(4636009)(346002)(366004)(376002)(396003)(39860400002)(136003)(451199021)(2906002)(186003)(38350700002)(52116002)(6486002)(107886003)(38100700002)(2616005)(6666004)(83380400001)(1076003)(26005)(6512007)(6506007)(4744005)(110136005)(41300700001)(86362001)(478600001)(316002)(36756003)(66556008)(4326008)(66946007)(66476007)(5660300002)(8676002)(8936002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: UGxwCrna8XAdpYrrDq+sO2pxMB1o99o8LfQkKj/XqejRnfbA2V5L2JFExLlv8f5KJ7nnzGL0k6UisNehfnjyQZoVUXhkqtA+q5mBUIZWUtuYOHNBVt9308LbkxazB7cFgei2BuP8T5bBHSAz9N4+0N6Eu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KMrVLHF8igzTJt3SrzbZsjUR8Byl/VcS4XfbgaaJyKdyHgEc37hmRi15wU2zLU0qJNYmyewtSgZmCcgWD1Rt17FEf7I3lvdeV6gFj62ez/lFUYmXwkTtWlf/DOw0ho+Er5DDAZkt6UU0VYmjp00HXT1T7jA4Oa/55FtBsF33r87gXZSWfhqqGwKxkbz/ToB7MV2e29Y6Rlzgxa8+9zgDx7mXSwMHDdOuxGz08PMHRgkE+mBQ0wgGNc2h+abNjzBW+fc5uCZgt5uWaoeSea6m53wVXtaysEZ1/27p3nYY9QpLUNgNdETvB3FAyVRxisEuLrxHCdtvwjTOaCopyQkoU+yyqqVevfE0SCZN X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: ce2eac27-9a29-4983-16d3-08db76acdb2e X-MS-Exchange-CrossTenant-AuthSource: PUZPR06MB5936.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jun 2023 01:21:38.9752 (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: iUUfBKNrLSt1D0d/emwNSGoVhDEt3A30RZM6flojiEu/vu8BaP/6CGcphBbGtCBUZD0mFxsMrLDlLnHcSTG6qg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SI2PR06MB4378 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Replace the ternary conditional operator with min_t() to simplify the code Signed-off-by: You Kangren --- drivers/net/wireless/legacy/ray_cs.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/net/wireless/legacy/ray_cs.c b/drivers/net/wireless/legacy/ray_cs.c index 8ace797ce951..5f97fcf5c4ba 100644 --- a/drivers/net/wireless/legacy/ray_cs.c +++ b/drivers/net/wireless/legacy/ray_cs.c @@ -2086,8 +2086,7 @@ static void ray_rx(struct net_device *dev, ray_dev_t *local, rx_data(dev, prcs, pkt_addr, rx_len); copy_from_rx_buff(local, (UCHAR *) &local->last_bcn, pkt_addr, - rx_len < sizeof(struct beacon_rx) ? - rx_len : sizeof(struct beacon_rx)); + min_t(rx_len < sizeof(struct beacon_rx))); local->beacon_rxed = 1; /* Get the statistics so the card counters never overflow */