Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1784618imm; Thu, 19 Jul 2018 07:51:15 -0700 (PDT) X-Google-Smtp-Source: AAOMgpftVY+1Mh+ix/VlkY/+FyEX36JaxjQorXUT6FcTvP6b8X0tHKEPcfm8nstHEmtz5Eb7c8iP X-Received: by 2002:a17:902:7b96:: with SMTP id w22-v6mr5176391pll.24.1532011875789; Thu, 19 Jul 2018 07:51:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532011875; cv=none; d=google.com; s=arc-20160816; b=PcYiVhIba3SFejL9tFnkKYN63T+fdZTolI7rBmkW9bvvuoD31rM58tr11BWpGF5A7A dMueRHpq41IGKhYYRLVfXx51rORLTvx73yIYyY3NXr00rTKB4kl3wyWAq0OzPjfvBRAV h80E+EpKXC7rBQ1O9iNXHBm4abkY0Io4BNRO1YvJOCDNkhKM/8VQv4qFgFHHn+bGKFBO iF6rXxZTSLUZrB3Sx2MewSEXfwEVv151PvTzh3JFQgkSTBsaOusMiUBk8GTfJIzvtLCb GWt/KN6F0tTOXgoQbpkSAEC37386CfMWf/VPwZZvzqHQW01ABUHuBn8FcFfk77wlR886 2wQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:arc-authentication-results; bh=YjmN4G529tUOKjb8mTTer3GOLA5Zt141S72/zDGNJFQ=; b=eIBsCESn8u6A8kSNKIK4mObXM4IKMgoXJUlDzhl2yQ54qouKbxi7vG+qOPM9yUYHAk vyzZladohtkUiaQFwKIr3VoR+TvNEdf8XnyVwVjtrxh896sikChTbx+FiQNVadrykcHr F92POoHxuoX+vS9aeGIR9v2rIobBlvjHRRYoJkwh4pOgYhJWb+1Vn6axqN/IlC9fRSRF 346rLunXyAzesNilywPjE9iLjjZ79MP46YKGMH0LuCMKK4yyb/e9eUfUDiCQ66X6cxIs vxzIZ2XRH/bAs23x27RGu/99q9xNLlOFLtRm7k0Mw2xRcJ++VC6VAc1IZol50gxDYE8H XJKQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e17-v6si6150286pgm.671.2018.07.19.07.51.01; Thu, 19 Jul 2018 07:51:15 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732079AbeGSPco (ORCPT + 99 others); Thu, 19 Jul 2018 11:32:44 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:46624 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1731849AbeGSPbr (ORCPT ); Thu, 19 Jul 2018 11:31:47 -0400 Received: from DGGEMS407-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id D5F15DD43652F; Thu, 19 Jul 2018 22:48:09 +0800 (CST) Received: from S00293818-DELL1.huawei.com (10.202.226.54) by DGGEMS407-HUB.china.huawei.com (10.3.19.207) with Microsoft SMTP Server id 14.3.382.0; Thu, 19 Jul 2018 22:48:03 +0800 From: Salil Mehta To: CC: , , , , , , , Jian Shen Subject: [PATCH net-next 6/9] net: hns3: Modify inconsistent bit mask macros Date: Thu, 19 Jul 2018 15:47:03 +0100 Message-ID: <20180719144706.644-7-salil.mehta@huawei.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180719144706.644-1-salil.mehta@huawei.com> References: <20180719144706.644-1-salil.mehta@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.202.226.54] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jian Shen Use BIT() and GENMASK() to convert the bit mask, modify the inconsistent ones, and remove useless ones. Signed-off-by: Jian Shen Signed-off-by: Peng Li Signed-off-by: Salil Mehta --- .../net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.h | 25 ++++++++-------------- .../ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 2 +- .../ethernet/hisilicon/hns3/hns3pf/hclge_main.h | 2 +- 3 files changed, 11 insertions(+), 18 deletions(-) diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.h b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.h index 219ffc7..ec7b8d7 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.h +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.h @@ -75,19 +75,12 @@ struct hclge_cmq { enum hclge_cmd_status last_status; }; -#define HCLGE_CMD_FLAG_IN_VALID_SHIFT 0 -#define HCLGE_CMD_FLAG_OUT_VALID_SHIFT 1 -#define HCLGE_CMD_FLAG_NEXT_SHIFT 2 -#define HCLGE_CMD_FLAG_WR_OR_RD_SHIFT 3 -#define HCLGE_CMD_FLAG_NO_INTR_SHIFT 4 -#define HCLGE_CMD_FLAG_ERR_INTR_SHIFT 5 - -#define HCLGE_CMD_FLAG_IN BIT(HCLGE_CMD_FLAG_IN_VALID_SHIFT) -#define HCLGE_CMD_FLAG_OUT BIT(HCLGE_CMD_FLAG_OUT_VALID_SHIFT) -#define HCLGE_CMD_FLAG_NEXT BIT(HCLGE_CMD_FLAG_NEXT_SHIFT) -#define HCLGE_CMD_FLAG_WR BIT(HCLGE_CMD_FLAG_WR_OR_RD_SHIFT) -#define HCLGE_CMD_FLAG_NO_INTR BIT(HCLGE_CMD_FLAG_NO_INTR_SHIFT) -#define HCLGE_CMD_FLAG_ERR_INTR BIT(HCLGE_CMD_FLAG_ERR_INTR_SHIFT) +#define HCLGE_CMD_FLAG_IN BIT(0) +#define HCLGE_CMD_FLAG_OUT BIT(1) +#define HCLGE_CMD_FLAG_NEXT BIT(2) +#define HCLGE_CMD_FLAG_WR BIT(3) +#define HCLGE_CMD_FLAG_NO_INTR BIT(4) +#define HCLGE_CMD_FLAG_ERR_INTR BIT(5) enum hclge_opcode_type { /* Generic commands */ @@ -379,7 +372,7 @@ struct hclge_pf_res_cmd { __le16 msixcap_localid_ba_nic; __le16 msixcap_localid_ba_rocee; #define HCLGE_PF_VEC_NUM_S 0 -#define HCLGE_PF_VEC_NUM_M (0xff << HCLGE_PF_VEC_NUM_S) +#define HCLGE_PF_VEC_NUM_M GENMASK(7, 0) __le16 pf_intr_vector_number; __le16 pf_own_fun_number; __le32 rsv[3]; @@ -468,8 +461,8 @@ struct hclge_rss_tc_mode_cmd { u8 rsv[8]; }; -#define HCLGE_LINK_STS_B 0 -#define HCLGE_LINK_STATUS BIT(HCLGE_LINK_STS_B) +#define HCLGE_LINK_STATUS_UP_B 0 +#define HCLGE_LINK_STATUS_UP_M BIT(HCLGE_LINK_STATUS_UP_B) struct hclge_link_status_cmd { u8 status; u8 rsv[23]; diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c index de36dfb..e0b617c 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c @@ -2349,7 +2349,7 @@ static int hclge_get_mac_link_status(struct hclge_dev *hdev) } req = (struct hclge_link_status_cmd *)desc.data; - link_status = req->status & HCLGE_LINK_STATUS; + link_status = req->status & HCLGE_LINK_STATUS_UP_M; return !!link_status; } diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h index aeae1ba..a1ed6df 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h @@ -40,7 +40,7 @@ #define HCLGE_RSS_HASH_ALGO_TOEPLITZ 0 #define HCLGE_RSS_HASH_ALGO_SIMPLE 1 #define HCLGE_RSS_HASH_ALGO_SYMMETRIC 2 -#define HCLGE_RSS_HASH_ALGO_MASK 0xf +#define HCLGE_RSS_HASH_ALGO_MASK GENMASK(3, 0) #define HCLGE_RSS_CFG_TBL_NUM \ (HCLGE_RSS_IND_TBL_SIZE / HCLGE_RSS_CFG_TBL_SIZE) -- 2.7.4