Received: by 2002:ab2:7041:0:b0:1f4:bcc8:f211 with SMTP id x1csp24095lql; Fri, 12 Apr 2024 02:22:54 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWb0/5KYMgELVsDhqWlbodUIfprAyQZFdi4hKuI9PLqffZxgSgmeylRfQMr3YXzeeyWEcm/TVXJAnARRekBHyud2PyVNZYj3W5da07xKg== X-Google-Smtp-Source: AGHT+IF//26PZiWeJ5UzuUkbQZEvvhxh4l8Pg3nd+B3AZ07T3bTvLoNd/4HfMdNd3IztBHF80kiL X-Received: by 2002:a50:cdde:0:b0:56d:f035:7db2 with SMTP id h30-20020a50cdde000000b0056df0357db2mr1268953edj.24.1712913774573; Fri, 12 Apr 2024 02:22:54 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712913774; cv=pass; d=google.com; s=arc-20160816; b=j/HEOMK4owRNKP2biVKypoAr1Y8aWb2e+lH8OwRT3OCGpYuoOfeQkslYPqcNrUocvb 41/8RkyKCW6r9L8Caw08IILOOqVy5VQ6Gb32KLxfM+BFx08IKI9k37pDgpQ8PZgNImFp PY94+XIBim2XHA0gl4c26MnVvznaS1GKu32ZcskAjXz0vIYuDyajHEY5j9UMim+CmaLL HV25mDO5g8z5M9eREFBMAX/iaRvIVfskwSMTNP1dlfzwFHNVgzyz+0vawmv4OJHrVmGu vsr7qdHgCFVXgGiJkEO5Kzx5tLVFFgkZNv7CJc3L89E3TxQDEfes94rdBd/To3EXcEjD nx5w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=66AHimJNkxCoClgc7d2THsXXUt3/ugyvfeZwKZpSq3I=; fh=KWvyQxL3Ff+3WPSMjlYu+P4255AmcMULAsFol6M1vNI=; b=Si4CfF4SpacYWTaegFlSI6icKybqqMRjRaB3v9nThPyf1KU0T6owHDUWlkdm9f/gHQ rFVwZWJCKS1hCMQNwoxMBqZiCurSlCcP+Imn+g//K01338fpyzbDL6bdryArJm/hDi/c swdyJID0K7i3e6Jompztc82JYPqIrXHcnDhOGRqr2e5hjuLKdRBjS6lhIPaqN6P/qgcR VwuW0S5fNGyMVL0BKfwkSre7jq2BioUlE8eLSzU4mGaTxcw80QkYpBbzbNjhQrqoyd3L AHwBxKIEJolBB6OkjDMlh/kcmJzRfNlWeuMDOssH8rtuP9ddms8cPlK/CkKBk7oQ5Gks KtEw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=hisilicon.com dmarc=pass fromdomain=hisilicon.com); spf=pass (google.com: domain of linux-kernel+bounces-142392-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-142392-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=hisilicon.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id y1-20020a056402358100b0056e455aba3dsi1549330edc.185.2024.04.12.02.22.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Apr 2024 02:22:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-142392-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=hisilicon.com dmarc=pass fromdomain=hisilicon.com); spf=pass (google.com: domain of linux-kernel+bounces-142392-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-142392-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=hisilicon.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 4E5E61F21B30 for ; Fri, 12 Apr 2024 09:22:54 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E7E2856B88; Fri, 12 Apr 2024 09:20:55 +0000 (UTC) Received: from szxga05-in.huawei.com (szxga05-in.huawei.com [45.249.212.191]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4F5D152F92; Fri, 12 Apr 2024 09:20:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.191 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712913654; cv=none; b=FVUEhXHYiT6tQ0jfZIhqms0rRzhPte47biM/1CFK5rYPCUwrezZdYbEU6cgvba2th35E3Lq4d8KKPSFqj5dn+EY/0/Yb8sNhc0CKKi1SYOsljVjSl8+tN/9I2BWCZjDtIBaGa5yDn+teoMh+eFkfdBBW47l5pzjXyMXuRDzf030= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712913654; c=relaxed/simple; bh=6cOnzUgTFSXRZkhH3Rt3k+Ms/5yir9+ew6bLW2DitLo=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=S0xMd/B0etJvAAMda91kZLlGgJroecKrWcC0U7EUcb2eMTordFtbFEjCELawg5j6dlphWNvpiHkpQmcMFsthNAfzDV19YyaDViz42Vhv9ahvs3BUOwjpHZg4qUe4bVixvxtGlCXOTgoYHRJf1b8dINFg0cdnP/DLDJI08xYOrpM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=hisilicon.com; spf=pass smtp.mailfrom=hisilicon.com; arc=none smtp.client-ip=45.249.212.191 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=hisilicon.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=hisilicon.com Received: from mail.maildlp.com (unknown [172.19.163.17]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4VG9vm6TWyz2NW8d; Fri, 12 Apr 2024 17:17:56 +0800 (CST) Received: from kwepemi500006.china.huawei.com (unknown [7.221.188.68]) by mail.maildlp.com (Postfix) with ESMTPS id 528F01A0172; Fri, 12 Apr 2024 17:20:50 +0800 (CST) Received: from localhost.localdomain (10.67.165.2) by kwepemi500006.china.huawei.com (7.221.188.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Fri, 12 Apr 2024 17:20:49 +0800 From: Junxian Huang To: , CC: , , , Subject: [PATCH for-next 09/10] RDMA/hns: Use complete parentheses in macros Date: Fri, 12 Apr 2024 17:16:15 +0800 Message-ID: <20240412091616.370789-10-huangjunxian6@hisilicon.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20240412091616.370789-1-huangjunxian6@hisilicon.com> References: <20240412091616.370789-1-huangjunxian6@hisilicon.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To kwepemi500006.china.huawei.com (7.221.188.68) From: Chengchang Tang Use complete parentheses to ensure that macro expansion does not produce unexpected results. Fixes: a25d13cbe816 ("RDMA/hns: Add the interfaces to support multi hop addressing for the contexts in hip08") Signed-off-by: Chengchang Tang Signed-off-by: Junxian Huang --- drivers/infiniband/hw/hns/hns_roce_hem.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/infiniband/hw/hns/hns_roce_hem.h b/drivers/infiniband/hw/hns/hns_roce_hem.h index 6fb51db9682b..9c415b2541af 100644 --- a/drivers/infiniband/hw/hns/hns_roce_hem.h +++ b/drivers/infiniband/hw/hns/hns_roce_hem.h @@ -57,16 +57,16 @@ enum { }; #define check_whether_bt_num_3(type, hop_num) \ - (type < HEM_TYPE_MTT && hop_num == 2) + ((type) < HEM_TYPE_MTT && (hop_num) == 2) #define check_whether_bt_num_2(type, hop_num) \ - ((type < HEM_TYPE_MTT && hop_num == 1) || \ - (type >= HEM_TYPE_MTT && hop_num == 2)) + (((type) < HEM_TYPE_MTT && (hop_num) == 1) || \ + ((type) >= HEM_TYPE_MTT && (hop_num) == 2)) #define check_whether_bt_num_1(type, hop_num) \ - ((type < HEM_TYPE_MTT && hop_num == HNS_ROCE_HOP_NUM_0) || \ - (type >= HEM_TYPE_MTT && hop_num == 1) || \ - (type >= HEM_TYPE_MTT && hop_num == HNS_ROCE_HOP_NUM_0)) + (((type) < HEM_TYPE_MTT && (hop_num) == HNS_ROCE_HOP_NUM_0) || \ + ((type) >= HEM_TYPE_MTT && (hop_num) == 1) || \ + ((type) >= HEM_TYPE_MTT && (hop_num) == HNS_ROCE_HOP_NUM_0)) struct hns_roce_hem { void *buf; -- 2.30.0