提交 541a7bd6 编写于 作者: H Huazhong Tan 提交者: David S. Miller

net: hns3: remove back in struct hclge_hw

hclge_hw is embedded in hclge_dev, so use container_of instead of
back to get hclge_dev.
Signed-off-by: NHuazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: NPeng Li <lipeng321@huawei.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 43e2b1c7
...@@ -152,7 +152,7 @@ static void hclge_cmd_init_regs(struct hclge_hw *hw) ...@@ -152,7 +152,7 @@ static void hclge_cmd_init_regs(struct hclge_hw *hw)
static int hclge_cmd_csq_clean(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; struct hclge_cmq_ring *csq = &hw->cmq.csq;
u16 ntc = csq->next_to_clean; u16 ntc = csq->next_to_clean;
struct hclge_desc *desc; struct hclge_desc *desc;
...@@ -216,7 +216,7 @@ static bool hclge_is_special_opcode(u16 opcode) ...@@ -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) 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; struct hclge_desc *desc_to_use;
bool complete = false; bool complete = false;
u32 timeout = 0; u32 timeout = 0;
......
...@@ -5537,7 +5537,6 @@ static int hclge_pci_init(struct hclge_dev *hdev) ...@@ -5537,7 +5537,6 @@ static int hclge_pci_init(struct hclge_dev *hdev)
pci_set_master(pdev); pci_set_master(pdev);
hw = &hdev->hw; hw = &hdev->hw;
hw->back = hdev;
hw->io_base = pcim_iomap(pdev, 2, 0); hw->io_base = pcim_iomap(pdev, 2, 0);
if (!hw->io_base) { if (!hw->io_base) {
dev_err(&pdev->dev, "Can't map configuration register space\n"); dev_err(&pdev->dev, "Can't map configuration register space\n");
......
...@@ -190,7 +190,6 @@ struct hclge_hw { ...@@ -190,7 +190,6 @@ struct hclge_hw {
int num_vec; int num_vec;
struct hclge_cmq cmq; struct hclge_cmq cmq;
struct hclge_caps caps; struct hclge_caps caps;
void *back;
}; };
/* TQP stats */ /* TQP stats */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册