Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp25556165rwd; Sun, 2 Jul 2023 20:17:39 -0700 (PDT) X-Google-Smtp-Source: APBJJlH0MTZG5EkA4Db06g9hdq8l35lvQoROb+CNBAPEoLjIFarUuRdEbXZ7bjg7Mg6b7xctawGb X-Received: by 2002:a05:6a00:3982:b0:681:ee3c:c5fe with SMTP id fi2-20020a056a00398200b00681ee3cc5femr9719052pfb.33.1688354259418; Sun, 02 Jul 2023 20:17:39 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1688354259; cv=pass; d=google.com; s=arc-20160816; b=iL5sdz7qMuLRNqbh3IsqBoUMD3b+R3sP0VysuaDnY0risqHeq+QSUBDKrssRfSSfcW sYt8uTGOI3MUf7gmNy+FnsYzeXZM1e2H/BwT/fUDdvq+xQefMWX8Yk7gz4zhOj9z/QuE sNNf8ti71YiOTxLwflGed/V1gY2j9rchB6Pf8Fj7Nl0FwLx/T6KNqOH8ace1RCh6VYjy Bvq6ZtaH1ceHjKH7XwoHHRT03tcjjQfjaawdJ6+FQ6aQC5MG54FkEn6SxooKUz0qTVDw VcxFF03JCLnllUmpz5nYwWzYl/T8OZTVw34EGkHhXxU9gHFkn5wyuUfxyZ1nUXDI8twW szkA== 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=2ipvBLMpljeI/qzEjr8Rux6XTwBTbVBaTQ7ECyObwcA=; fh=k881pT4LIQDviW52vaMajwBCpJdF9qah5+3mbg6IlgY=; b=bS7DPEI/HLNA38Ew4FMK8xhU/hocS9xr/wLvutHyyUtp9Dv9WgVK9V5UuRbtvEtZB3 dDGGVPtaXhXA6Yu/1chdNGNZiADNlJECm+j30XaKIHOn/Ypc3FpH85v3M+CK+Xjr4mcj BQDsvosEWzTqsNgQFp10N1IwAtqWJxoSXtGdJaSaN6gl0G2oAWdIAPv2uOEYoiyUGAo4 oAW/0nLB2AdpNU5I6grefXwp1WBGU9j/NCpx4HBsDh4D1EdD/Ys2VkQQQ9Awaj8fhS1d CXQ1c5ka3G1fk1LNE3qEKsl0UxhWHB9tScFJwY/4+xHg3hozSCTLlXTd+jTPeiSjPYhy +GfQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b=cHmXmAWc; 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-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-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 w4-20020a656944000000b0055b12486641si10953652pgq.186.2023.07.02.20.17.26; Sun, 02 Jul 2023 20:17:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-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=cHmXmAWc; 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-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-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 S229759AbjGCDCV (ORCPT + 59 others); Sun, 2 Jul 2023 23:02:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56282 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229772AbjGCDCT (ORCPT ); Sun, 2 Jul 2023 23:02:19 -0400 Received: from APC01-TYZ-obe.outbound.protection.outlook.com (mail-tyzapc01on2133.outbound.protection.outlook.com [40.107.117.133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 390CD1BC; Sun, 2 Jul 2023 20:02:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fnqlgRReScspWyaEa+vvDEOI1EA6qZL93TFTRvjMwKGovJIFF4FOfNjEYr7maSyN8qGyTj94PmLDTOHr7DIch3ff2LMnGH+bMBkX83jbTV00sxT3ALb+6cEaGmdF3AMSJQMn7rL9n/50qsWwmpR/0RuA3bcHnoutGhWDXkG7mgF+mnpcvOhDXCVdNDbL5pjYZpPWHUiBcn2JTV+9fpDoaQNipiOXS3NMZzFLVt3V7v9feSpumaZk5IhrljBZnAp/egjwFN9BmUXG0V/42YTcdPpYu8Ak84s8L84q+ct4Bjk7FMOndC8rDtwj1jKFClEQaXJuS5JlC+4RhvTaNdmO/w== 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=2ipvBLMpljeI/qzEjr8Rux6XTwBTbVBaTQ7ECyObwcA=; b=QF88X/nyhNo+M0GB5hkw8fPy3p/lQbSf68QdsZB1xMa/7mxCEV8Q9wHmCkuv+RxrEHKgx83565kudVXaLA137Ev6TV2Dk/41V3uGtFOvv6IbXuzsdEyXW6ECxrgCPHwR6+MiEX9NRbfpoMtXbaRsZcWY7dhx4fNnEG9FtB2B+aXzMiojWt8i3O6b3gXJ7EC7kfAy5Eq2IbeZXXoslgWl10C3Xu7Dsd8mOFhg9G5pExmPghA7ge8beHbe3aP9013clqfsA5w6VJgcVUpiJQ4fy5p1o9Z+8fUAJiBUUvl4ivBVtFMNTElmPKUuCwfxXtdlaeT7keZY40v2S2F/pLC9/A== 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=2ipvBLMpljeI/qzEjr8Rux6XTwBTbVBaTQ7ECyObwcA=; b=cHmXmAWcNl087GlezizE/BtoMJS1bwBQbOKbK34rcei6i/dt+8twRaQf9v4x4nby/x5Nj9DRV2OZkU4iZQewcFs+bp14q/r9ttkxdL7wpCPwIM9fkK/aGt+OaW6iNjonGskCL6Plf7vIFl4nqPf7eSPOk8QOVhS7uDvE27V7154OWDCp0jA0GV/IkN2xITYoK3xuj21i1L8YTzQXAcEMhzsc0bdQ4FxHWBSS5BwRXgzL3MD37NR7KbK9iyMUZfhZLWDpelH0kiF75dIDhorn+bzkJClsUMHHiv7IQko9suM3HPxINvWBd5taFHC5pb64FQrgWkzIT9WQn2BoQv5mag== 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 SEZPR06MB6231.apcprd06.prod.outlook.com (2603:1096:101:e8::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.24; Mon, 3 Jul 2023 03:02:07 +0000 Received: from PUZPR06MB5936.apcprd06.prod.outlook.com ([fe80::5c03:58ad:fb2b:49d9]) by PUZPR06MB5936.apcprd06.prod.outlook.com ([fe80::5c03:58ad:fb2b:49d9%7]) with mapi id 15.20.6544.024; Mon, 3 Jul 2023 03:02:07 +0000 From: You Kangren To: Johannes Berg , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , linux-wireless@vger.kernel.org (open list:MAC80211), netdev@vger.kernel.org (open list:NETWORKING [GENERAL]), linux-kernel@vger.kernel.org (open list) Cc: opensource.kernel@vivo.com, youkangren@vivo.com Subject: [PATCH v4] =?UTF-8?q?wifi=EF=BC=9Amac80211:=20Replace=20the=20ter?= =?UTF-8?q?nary=20conditional=20operator=20with=20conditional-statements?= Date: Mon, 3 Jul 2023 11:02:00 +0800 Message-Id: <20230703030200.1067-1-youkangren@vivo.com> X-Mailer: git-send-email 2.39.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-ClientProxiedBy: TYCP286CA0085.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:2b3::8) To PUZPR06MB5936.apcprd06.prod.outlook.com (2603:1096:301:11d::13) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PUZPR06MB5936:EE_|SEZPR06MB6231:EE_ X-MS-Office365-Filtering-Correlation-Id: 1edd1555-5aec-4d7c-2b7b-08db7b71e2bc X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 7UhfWGuqTN32YkPUTb1gFlxTmKtDdnXuXs1DAg8+BjdtDbYdxL2rR1/sPuQL8RCFBv9rSkGnI7ZW9gdY4GHwaQk4huiPzm/uTysx0QDjeQbwJU507TGADlXVJHs+mVh57zRgKwfnBGtF/h1AAlnBfgy7fWbuuKjpbMNThLBRIdkSh8NDC5MaH84xkqlZ029yrrqLuYcLdA2a2uONQfqPKpB/9bYtBRllML7bv0wVWyXRlMQlqjnR3ikVmdW1q8N7cavv140yAyvuB7PvKxRTBHT9IWj+6mB+ftQn0T7lo7JUcVo2Ddi9Izso/dKE2uWS70UAurlWABvVhcWvh8ZuSUk4iGjU91fBFGJMyvha1o7cNTTAsn0yIGsPeaSS2IEX/CNR2kz3bgpvtQ3+y/zq+Lcu6NwgHxN4wQHBBHg1+ScxddA7Fl1nwZZyaNVpKcpymKNvoD0WZy7Fvufps8cHUiMNgDOcS/UBGbM+Ur4jOUMw8+v5/KXXVENJ+f3r7YgUik4XS8RWb+D8eYaouhgrTVXYK2jFJrvg3PAo0HEUQXjSdQBdrZN/lXhhshHHiq0tiQkAl4vskGnHkdCp0oHzAIjqPpry2kDeXKq6eSSWu3DiyZO9p8K3cZ3kJYiPjNgV 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)(396003)(366004)(136003)(39860400002)(376002)(346002)(451199021)(4326008)(66476007)(66556008)(66946007)(316002)(478600001)(2906002)(36756003)(8936002)(5660300002)(41300700001)(6512007)(86362001)(110136005)(52116002)(38350700002)(38100700002)(6486002)(4744005)(6666004)(6506007)(1076003)(26005)(186003)(83380400001)(2616005)(107886003);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?YmtXOWREZ1FZZzZIV2loWkNxZkFxSklSaEdNQ3I2eXZMbFZzR2dtTVVZbHB5?= =?utf-8?B?MFU5UTdHYksyelZCa3pNMGNYSXJ5a2hSOFFCV01qa0NOeFd4RkpXMEdwWUo0?= =?utf-8?B?bUo2aUE0L3hHZzhQblhscXJqSWdCSzlGbnhkRjNEUFBSOVZRL1pnaTRaajh1?= =?utf-8?B?U014bTJoWTQ2S0ZYeGcwdTZEdWMwUnBhSjJDRGlQMGdCekNUQ0RMdGNDT1g3?= =?utf-8?B?eEZxODF6c2VoZlNtWGoxUTZldVBWVnFzZmNRNjJDWTFqQ09vVUY1bkkvZWJv?= =?utf-8?B?NnVhYVZzbTVUNVRXaGJoSnYrUWRjVFBRYmh5UTl1MGxCS2hGTC80ajNHcW9X?= =?utf-8?B?eGlNMzRlWTRhTlR6ZUdRb1IrckEvV1liUGlRdFNIb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2bc X-MS-Exchange-CrossTenant-AuthSource: PUZPR06MB5936.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Jul 2023 03:02:07.2589 (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: yNxC9aQgTK9YPn1e6vaKeU/4Zo7wjgWzvCz6Mj3jq6wQU15PrX5DoIP4WWzBjdhAqtDZ48PtctEGF1WCDvRD6w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SEZPR06MB6231 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 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-wireless@vger.kernel.org Replacing ternary conditional operators with conditional statements ensures proper expression of meaning while making it easier for the compiler to generate code. Signed-off-by: You Kangren --- net/mac80211/tdls.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/mac80211/tdls.c b/net/mac80211/tdls.c index a4af3b7675ef..41176491965d 100644 --- a/net/mac80211/tdls.c +++ b/net/mac80211/tdls.c @@ -946,7 +946,8 @@ ieee80211_tdls_build_mgmt_packet_data(struct ieee80211_sub_if_data *sdata, int ret; struct ieee80211_link_data *link; - link_id = link_id >= 0 ? link_id : 0; + if (link_id < 0) + link_id = 0; rcu_read_lock(); link = rcu_dereference(sdata->link[link_id]); if (WARN_ON(!link)) -- 2.39.0