Received: by 2002:ac0:e350:0:0:0:0:0 with SMTP id g16csp1726278imn; Sun, 31 Jul 2022 19:53:50 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tRj//ZXcnaSfHQg+uwSNE1U3iLuls5LlchwYVNN86Q96SebV2qfpgIYGIfWrrkq6WxjXgD X-Received: by 2002:a05:6402:2709:b0:43c:62d:7a63 with SMTP id y9-20020a056402270900b0043c062d7a63mr13872339edd.130.1659322430655; Sun, 31 Jul 2022 19:53:50 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1659322430; cv=pass; d=google.com; s=arc-20160816; b=pV0SR+zsNLPfUK/fbhTqCUhlTo8daTn0lwc2/pTL5OWA9VdqYYM6AMJ9kZ9N3hfpxm PIaKZUkhNE3BYMPBOoVEN8ZtMM54kD5tHW17oDi2migH5JXpjBUWSYr+k9ibcl3oTHmI Tst/kiRP3HXs4zPAAyt5gWN4aaWtt7aW6hpWcLWWPfucr88X5T5iJLzLoCvRdXaYLyP2 OKE19hM/8n4vV5TGWazEQz8lc+WeOSseMz5Sz6o1cVMXXrMVUCEWKiSJUWbnKxMM25Jl AnSg5aVlCANAZB/Hl+SqESDpU47KhKVc4TqFlhG8XD6aMfAawFJHi47YhVV778myHNQG MnVg== 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 :in-reply-to:from:references:cc:to:content-language:subject :user-agent:date:message-id:dkim-signature; bh=uAg/J966LiZrTvC4rWE5ou2aGLXZt0ricHZJeiiXfiA=; b=yiuhIp6F7HUGQEPzBozTkP2y38ent6gyciYSO4smtrcpATu+82wo1Zmq1F8SEFTVuj 3nddD4w5Y+gRxqDX+U1EvQ6qeN/uySY9ls8ATz/ZR67DX6z/rzhR08HVAQv1vLlrZocT o5yLO+LSYwdqg6GvJ/57198ECQRri1v1lyiyCzIb2o60E1UqIQuMl21hcjpjzfQzeu3f /hFuhvWGG/38skQfnSMFcn1P+xj6IbzxD1cTFrDmCdzhUaUT7P7zKZ3PzFJA04sZgUyQ C/i0haM7EsnS066n9vt4+dpT/Y4coGAGReyF17wBpmNxf8ocwCXYd1klCKLVU3zubUTc ZkMA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=Uibn4L4E; arc=pass (i=1 spf=pass spfdomain=nvidia.com dkim=pass dkdomain=nvidia.com dmarc=pass fromdomain=nvidia.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=REJECT sp=REJECT dis=NONE) header.from=nvidia.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hw19-20020a170907a0d300b00726efd49e61si7273063ejc.907.2022.07.31.19.53.26; Sun, 31 Jul 2022 19:53: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; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=Uibn4L4E; arc=pass (i=1 spf=pass spfdomain=nvidia.com dkim=pass dkdomain=nvidia.com dmarc=pass fromdomain=nvidia.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=REJECT sp=REJECT dis=NONE) header.from=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239265AbiHACmQ (ORCPT + 99 others); Sun, 31 Jul 2022 22:42:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57616 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238902AbiHACmP (ORCPT ); Sun, 31 Jul 2022 22:42:15 -0400 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2076.outbound.protection.outlook.com [40.107.223.76]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B61CE13D09; Sun, 31 Jul 2022 19:42:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=T7iZbA83w7hMuO7HSP48tYn/yGywIUr/3i+ssu+jSxVS8LzklgiLtHrTSDMCM5Vbt+X/uNuBsL/nJ6Ll8PY0QBUU8TnY9GL87vWLdMMsSlBqitaXC7nMShjhxiQH9ynvh+4v2WCmOJ4Gt1v1lwgqN4rCK9dk0WaRGJAyTMn10RGNurACjoPlR2QZpZ83Y81+dDq0aIdqvepdpyXtI/ASeewAr9ASrp2yObu4ILEeItT5Qxq0IQ5ekIKvWsPT3mCKVqBiUAXawnepXJ9NbBrmYgZ/zH+YwLzNy7W1PxS0Gy4b30hUEIrTe67GMlEVXaSjZPecWcH/S3o/6BIVKZCF/g== 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=uAg/J966LiZrTvC4rWE5ou2aGLXZt0ricHZJeiiXfiA=; b=Z1AQ4T61e6o8dZWtIX1x5rXtQOM9g02bA46Rz/9ZD88TK70L8cUH/sELcj5nyxFbhRiQCrXTi4AVxRixyk0JvYWJOEeI88BWZnJN+q3srfIu2L4BVkhJPE8rruxytG6dQ3trx6jtaf8XAFYb+qstCvBHddgeXhAz8QlU5MAE2cpmEqGVFyFSUDGRFmVfofly650BZy7q+AtqYbVdGnf5wzrb5nzhTMFQabLk0EDuTlGa24xGblXnD7/h1Haykyh4bRcpWDTdSIeJ/WU8D/CwtgJD0HqGZPXYp3aIcWQTEJcLQBONkt1eWXUyGvzcxFikSLjdBf8Zki8rLWXHNGOlHQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=uAg/J966LiZrTvC4rWE5ou2aGLXZt0ricHZJeiiXfiA=; b=Uibn4L4EH97lmWxrCn6PoQF+XtO9Cvq5eIbTnhYOTgpuCCG0XxC2g/7i3GoP/+7ibCYlX7wBuBt860uY4gMbpGd3j7zcnrVVOCxzN60/LR+SiHAH/STVwT0O4L/0gcvipjNo0K9YaNzxIhuGA4CZPR/O1Pjllsa8LML/Y2Z8uc3aQhHx6YU0FUYX6x6Y4uezrFwnxWVS+32O8ZHqcQk2isSs9TvYqWE96YBrRk/3sTd8xoSH/qGXLcysuIafE17sxoMc5lt7rTAQdLYro1HqTfBlRnTRPdBIHNCrSaiyoSQteqwULARVRu4lR1pscqIpLiN0QGDiJpWa3yOBF21WIA== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; Received: from CY4PR12MB1366.namprd12.prod.outlook.com (2603:10b6:903:40::13) by DM6PR12MB4283.namprd12.prod.outlook.com (2603:10b6:5:211::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5482.12; Mon, 1 Aug 2022 02:42:08 +0000 Received: from CY4PR12MB1366.namprd12.prod.outlook.com ([fe80::dd48:8d3b:7eac:ea85]) by CY4PR12MB1366.namprd12.prod.outlook.com ([fe80::dd48:8d3b:7eac:ea85%11]) with mapi id 15.20.5482.016; Mon, 1 Aug 2022 02:42:08 +0000 Message-ID: Date: Mon, 1 Aug 2022 10:41:59 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [PATCH linux-next] IB/cm:Change the conditional statements Content-Language: en-US To: cgel.zte@gmail.com, linux-kernel@vger.kernel.org Cc: linux-rdma@vger.kernel.org, ye xingchen , Zeal Robot References: <20220801023146.1594841-1-ye.xingchen@zte.com.cn> From: Mark Zhang In-Reply-To: <20220801023146.1594841-1-ye.xingchen@zte.com.cn> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: SG2PR02CA0109.apcprd02.prod.outlook.com (2603:1096:4:92::25) To CY4PR12MB1366.namprd12.prod.outlook.com (2603:10b6:903:40::13) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d7e30c1b-652b-4fa2-f092-08da73676d24 X-MS-TrafficTypeDiagnostic: DM6PR12MB4283:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: SB1SiVDff+z0sOHAWsFtSjypzowMYeYiBHP33StU/YqVcDM1pO0OCa8mpe9g6SuTIjLmxw99MOGquibUawjJ+yLi6il31eOiVQFFafyIN3FJPw1333KztAb62V/rLPK3Ie3Aj0VpZTjUxZOAvTY9/k5V8cKPxDABAgTi2WOSeNuiulLdTJc+5/oqI6Reej2LV1WGcnbPa/c0AF4L8/n6kM9tiqbo1a9koNLVU9PGtbWtALCWxlK8fYUpg+x3bJknuwToUBdgjoxrpmup8UISRADxU8eiesLVDvS9aMfQ7rnVk44KSgwfPDgM9CMtWvwqb44ssatuezYATwRQZs5WGuCBHZPkZjDaEJkD8TutNXKdsO9r7rmzbnMyNQwSekVPANL6Y0pX0q08HKT9VtbFMBRvm3aBJjKnNR4ZSKDJn9Ms9iGOPrtCbUPEbPjjhMgQFMRu4/7IFWpi5PPpjZ7Ypt4F654Ot45yLsLUeQyp5OBlVwGkZbR4W/tHHQ+y/l8uaAMAmPa2qJqOT2qWkbRzjhKyNmwqAtlHRslodZ1LjV8Fq2XJONZEI9XxgcEaz10i6Wrw5Mlhj0JuchWxjNsfuQYFIENbkR7GJU43DSCcJ3MtynHLK/WsET9NBUA4+SJMYQA8GlyrNxlF9gg2cVhZPWKG+BCl5Y7Ql6C+QatDqiPX3ofvk1UR0ekJwtsz2AH1ah4zrp6Iz1pBbeonVnff1EeoCEUlRLs5cxB0JUyWUju5v8MYXbcepFa8pdz2iPD2jksqVfIelI1zghSZ+F93498aGM0BdxwMLGbyXkp6NZvHD1HALzXuSf18Fm7UCJgMVy1EkVh1p7R2e0eKc8a7ky14V+fcCRkCOJsBvNYpYtT5Hxf1bHJ/h9JQlq4aaSldA8kGgTTPFSLQGEol0FtcJWihN8cIXNpfSvqGv3TtcEc= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CY4PR12MB1366.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230016)(4636009)(376002)(366004)(346002)(39860400002)(396003)(136003)(31686004)(53546011)(83380400001)(2616005)(6666004)(5660300002)(186003)(26005)(478600001)(36756003)(6512007)(6486002)(8936002)(966005)(41300700001)(38100700002)(31696002)(6506007)(86362001)(316002)(2906002)(54906003)(4326008)(66476007)(8676002)(66556008)(66946007)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?aU5HLzN6TzUwRlZ5dDVKZW1KdjNadHhvYUFYNCtmcTE0eURIMzY2c0U0emE0?= =?utf-8?B?QVpNSlRsQU5mcXdiS0xBbklHOW9MMXdPQXdyNDJKUVJjMnVCN0tWRlNNOE9L?= =?utf-8?B?RmhEdFBUMXFweWx3bGxzL3ZybGtNMGdpcW4veTNJUnBKK3N3VGRoRHZzNjly?= =?utf-8?B?WVJ5OFVxT2FqUVNtSGdLUHduY20zS0dvUmVaYUV4QUU4Z2pzSGtVVzBBemF4?= =?utf-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XhBYTA4eSszak52S0xBUzdYQXNheGg4?= =?utf-8?B?eVdlK1BDRHFkeVZDdHFaVEI5eVhMSkc2bk9QM3QzdUtlZEFlZjAxVHYra1BI?= =?utf-8?Q?4Osda7oYU7/TDDjJ5gsWtpD4X?= X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: d7e30c1b-652b-4fa2-f092-08da73676d24 X-MS-Exchange-CrossTenant-AuthSource: CY4PR12MB1366.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Aug 2022 02:42:07.9590 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: nGpDvvdkt1xVCR6gyLKAtaLKew8FcZPf+Hc5duJiKdykT3Fbz9+yEFHEo8ippPFkM8jqFjXqbSl3aQW9l90ZZg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4283 X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO, NICE_REPLY_A,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS, SPF_NONE 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 On 8/1/2022 10:31 AM, cgel.zte@gmail.com wrote: > External email: Use caution opening links or attachments > > > From: ye xingchen > > Conditional statements could changed to be easier explain. > > Reported-by: Zeal Robot > Signed-off-by: ye xingchen > --- > drivers/infiniband/core/cm.c | 9 ++------- > 1 file changed, 2 insertions(+), 7 deletions(-) > > diff --git a/drivers/infiniband/core/cm.c b/drivers/infiniband/core/cm.c > index b985e0d9bc05..6e323d0c0fce 100644 > --- a/drivers/infiniband/core/cm.c > +++ b/drivers/infiniband/core/cm.c > @@ -676,14 +676,9 @@ static struct cm_id_private *cm_find_listen(struct ib_device *device, > refcount_inc(&cm_id_priv->refcount); > return cm_id_priv; > } > - if (device < cm_id_priv->id.device) > + if (device < cm_id_priv->id.device || > + be64_lt(service_id, cm_id_priv->id.service_id)) > node = node->rb_left; > - else if (device > cm_id_priv->id.device) > - node = node->rb_right; > - else if (be64_lt(service_id, cm_id_priv->id.service_id)) > - node = node->rb_left; > - else if (be64_gt(service_id, cm_id_priv->id.service_id)) > - node = node->rb_right; > else > node = node->rb_right; > } > -- > 2.25.1 This is not correct, ref.: https://lore.kernel.org/lkml/20220624201733.GA284068@nvidia.com/t/