Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp7114577imm; Wed, 27 Jun 2018 20:43:11 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIodGu0pkvE0dvQgyUbZWesifTSajmClGGOe6G+EqI4vW8BmqWEeZayzFAYkZNeKjFDVOwe X-Received: by 2002:a17:902:1703:: with SMTP id i3-v6mr8544171pli.263.1530157391133; Wed, 27 Jun 2018 20:43:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530157391; cv=none; d=google.com; s=arc-20160816; b=jjmXyqRFUBdeMfpGDt9X4pX9ZchEC/B9hRoth0/MbqpBHHSxSif+uKMp0oGI9m1H40 Bo3rf97WLPh8qx+ll6+Rm3w0tTjZ356SA7UkvGOpyt0q1REfWz4Lc+BvlDI9Ryl9p6kE KfhJDVbYWKG9CbV/L3yJ3SXr1qHj0jlJetdjh3rVVLTaNM+we18rvg7fXcgExG4o4AtR M3YAmgEmHgv3WzGsMdJxRs6ZVfQFPXUv/tAQCdg17nPGrXokdGKOnAMUoGUOerpYuW/1 iU0qZ1aT9Oj5CHw+/0ki1wNiatUkEH9b3vUeDFuSEBSx10544hCXCxYYTs7wRRsqIX7R t9ow== 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=kSXYaZ4DL13k0hWBwNe8dJn7vVrJJPHUuEarbXiY0IY=; b=sKw1hLoRCX0cb4MVXdOhzS8roBn1YYucHRQuEA1DwSjIDXSlOTbfIj5QS0Phz0YTiX HbAQ3+rJXXv3jPsGaf5DW2QxfA92cd/KkvkzOay9hg2BhAhytpJa3ESaw+QdiHssNgTH zrt97VRdPYWRDGZT2ryWLQhASJvAb6GuH/7rU5Z0aA4u3yFHM9isyKvCPT4IwGVmGH12 PRjyICRpywyoADnq9V3fC4P3X7pjc09YKoSkS1RUNN7myVnnMQ49IUwIFPyIJUhJh4AB naYVfnFr10wUKcIfERLFpPgsageNnKE4DI8SyV7wcl2TPNt7TlwY0fgEvzEAaChQ4sTa /C7g== 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 t15-v6si5201116pgs.647.2018.06.27.20.42.57; Wed, 27 Jun 2018 20:43:11 -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 S1753160AbeF1DlN (ORCPT + 99 others); Wed, 27 Jun 2018 23:41:13 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:52488 "EHLO huawei.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1751107AbeF1DlH (ORCPT ); Wed, 27 Jun 2018 23:41:07 -0400 Received: from DGGEMS407-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 83B2965CD79E7; Thu, 28 Jun 2018 11:41:02 +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 10/11] net: hns3: remove back in struct hclge_hw Date: Thu, 28 Jun 2018 12:12:28 +0800 Message-ID: <1530159149-122284-11-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 hclge_hw is embedded in hclge_dev, so use container_of instead of back to get hclge_dev. Signed-off-by: Huazhong Tan Signed-off-by: Peng Li --- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.c | 4 ++-- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 1 - drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h | 1 - 3 files changed, 2 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 c36d647..7049d0b 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.c @@ -152,7 +152,7 @@ static void hclge_cmd_init_regs(struct hclge_hw *hw) static int hclge_cmd_csq_clean(struct hclge_hw *hw) { - struct hclge_dev *hdev = (struct hclge_dev *)hw->back; + struct hclge_dev *hdev = container_of(hw, struct hclge_dev, hw); struct hclge_cmq_ring *csq = &hw->cmq.csq; u16 ntc = csq->next_to_clean; struct hclge_desc *desc; @@ -216,7 +216,7 @@ static bool hclge_is_special_opcode(u16 opcode) **/ int hclge_cmd_send(struct hclge_hw *hw, struct hclge_desc *desc, int num) { - struct hclge_dev *hdev = (struct hclge_dev *)hw->back; + struct hclge_dev *hdev = container_of(hw, struct hclge_dev, hw); struct hclge_desc *desc_to_use; bool complete = false; u32 timeout = 0; diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c index 805c780..14a6991 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c @@ -5537,7 +5537,6 @@ static int hclge_pci_init(struct hclge_dev *hdev) pci_set_master(pdev); hw = &hdev->hw; - hw->back = hdev; hw->io_base = pcim_iomap(pdev, 2, 0); if (!hw->io_base) { dev_err(&pdev->dev, "Can't map configuration register space\n"); diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h index 7488534..71d38b8 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h @@ -190,7 +190,6 @@ struct hclge_hw { int num_vec; struct hclge_cmq cmq; struct hclge_caps caps; - void *back; }; /* TQP stats */ -- 2.9.3