Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp7144661imm; Wed, 27 Jun 2018 21:31:48 -0700 (PDT) X-Google-Smtp-Source: ADUXVKK1HL5hAsUIz40XztzmclvzD0Xy5MrUCVlG4dlOrSHJ626aOhjd3yYuu5jEYRPz/RxOSFZa X-Received: by 2002:a17:902:2864:: with SMTP id e91-v6mr8685569plb.240.1530160308032; Wed, 27 Jun 2018 21:31:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530160307; cv=none; d=google.com; s=arc-20160816; b=uJ1903yblJmV94ADUEDXXff55ZQtDWFHR1yTfvdpW9/JzgCVmcBt91spm8YUYIbw/8 1Vjdl3pM7I98RQwIwNVEd9fOzggo2PtNu6kFr76ftfwsh4i7nGHckxFzX4irnAwy/te+ JCy171pQxMRJA3druJeE1JU4jCnjUiEvPgg2y189o2FvmrNAzY5lYIgC/JJlFwVYEQAh LVeL2UeKp3WCd7fQZUXGpiLr2V7xNF5u8qGKK/EydSqdd8Gdq1W2RMDB5p4OtIEn/Tyn cRui8/3SIkzjA1/Rs3oI5hfISkEFire3KHlWTBNsVN3uREuCLXcfr9CquPdAletli/J1 aSfw== 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=eK8BD9RvumlbhR8V5ZXDCJ15oMa2OuubtUPCqiHkkds=; b=sEROZiBE9WfwMRKwBafhrPRptPJ36IcrA0iE6I+ECvFOgsb9JnXlctBCkbbtporg7Z N1YZABqDwet/Mn+qvXMS+C+pQNQftbLMIfCTP5l5LXxLuxc7bGKVWAHJwsD7etW6KAzQ NQsouSwhRafdWYSb+Kc7UWQyiX2Wzr/nMdW2Z76fLBdiZmFIur2hqKHUrBAWG9TcNz4C FSA6BJHzUXTQ2oS28/ZOc3wnkOftngDGt24enB859N9+RfbTlH56tcPeXMN0PtIvxXbs CdLbUyGRh1UTK7OXfmimxp6rHMtUtDbaWLwyd8plRVLDnYMGuLeAIS/kt+jKFT/ieobC 5/Lg== 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 l190-v6si5332015pgl.198.2018.06.27.21.31.33; Wed, 27 Jun 2018 21:31:47 -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 S1752301AbeF1DmU (ORCPT + 99 others); Wed, 27 Jun 2018 23:42:20 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:9181 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751107AbeF1DlR (ORCPT ); Wed, 27 Jun 2018 23:41:17 -0400 Received: from DGGEMS407-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 6978BAB89F740; Thu, 28 Jun 2018 11:41:03 +0800 (CST) Received: from linux-ioko.site (10.71.200.31) by DGGEMS407-HUB.china.huawei.com (10.3.19.207) with Microsoft SMTP Server id 14.3.382.0; Thu, 28 Jun 2018 11:40:54 +0800 From: Peng Li To: CC: , , , , , Subject: [PATCH net-next 11/11] net: hns3: use lower_32_bits and upper_32_bits Date: Thu, 28 Jun 2018 12:12:29 +0800 Message-ID: <1530159149-122284-12-git-send-email-lipeng321@huawei.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1530159149-122284-1-git-send-email-lipeng321@huawei.com> References: <1530159149-122284-1-git-send-email-lipeng321@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.71.200.31] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Huazhong Tan MACRO lower_32_bits and upper_32_bits can help to get bits 0-31 and bits 32-63 of a number, so just use it. Signed-off-by: Huazhong Tan Signed-off-by: Peng Li --- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.c index 7049d0b..383ecf0 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.c @@ -123,9 +123,9 @@ static void hclge_cmd_config_regs(struct hclge_cmq_ring *ring) if (ring->flag == HCLGE_TYPE_CSQ) { hclge_write_dev(hw, HCLGE_NIC_CSQ_BASEADDR_L_REG, - (u32)dma); + lower_32_bits(dma)); hclge_write_dev(hw, HCLGE_NIC_CSQ_BASEADDR_H_REG, - (u32)((dma >> 31) >> 1)); + upper_32_bits(dma)); hclge_write_dev(hw, HCLGE_NIC_CSQ_DEPTH_REG, (ring->desc_num >> HCLGE_NIC_CMQ_DESC_NUM_S) | HCLGE_NIC_CMQ_ENABLE); @@ -133,9 +133,9 @@ static void hclge_cmd_config_regs(struct hclge_cmq_ring *ring) hclge_write_dev(hw, HCLGE_NIC_CSQ_HEAD_REG, 0); } else { hclge_write_dev(hw, HCLGE_NIC_CRQ_BASEADDR_L_REG, - (u32)dma); + lower_32_bits(dma)); hclge_write_dev(hw, HCLGE_NIC_CRQ_BASEADDR_H_REG, - (u32)((dma >> 31) >> 1)); + upper_32_bits(dma)); hclge_write_dev(hw, HCLGE_NIC_CRQ_DEPTH_REG, (ring->desc_num >> HCLGE_NIC_CMQ_DESC_NUM_S) | HCLGE_NIC_CMQ_ENABLE); -- 2.9.3