Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp977imm; Fri, 21 Sep 2018 08:43:35 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZxFrj76TEn5vzgrAUo5xrUtx3sUvvKq4DKJN4rTJVQk94od/pVpgtpI2/V3JoZqtpy67wq X-Received: by 2002:a17:902:20c6:: with SMTP id v6-v6mr45731095plg.228.1537544615215; Fri, 21 Sep 2018 08:43:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537544615; cv=none; d=google.com; s=arc-20160816; b=fqPyYGekbepvNGrMNYhQSvUm8Gf9NTVvMqkttxjIXqSEmlzA2thBl8empUW//teTKS M+SL+rXwpBupXZFR7NmbQWVdZJ3BVL23vjV6uTsGoydvQZWWPl5uQTeLzkVFEsJjZQHY HIwsh5OuHcUWg4x6zCGQqMalKvjVNhVLEaHS9qvdRvsmfQt+PI9GYn0Se/xMEpZQrkdb YBLixepRb2v56a4sj5YlOajHCXrSogh7+z9dDxizbbsxFCUdIOt28S1eEFL0yfz8jfV/ Kkauxf8HsbMYRYvQ2mT7UlKsxICI9qlZ4bkA7udrVe+adOLxgKPkC2ONlIjv/wN9TlHh c+JA== 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; bh=YJOZlXIWN7RkqwwhkdTtCJygywdS08QSMOO5kzOCM+s=; b=F0Ceg1l4KOZZ8Xkowqs4wJb/24bkwdElL6RACqOefNzyE2uycjzyiE+YYr+sEt3hNg J+W6KZsrK8UYattCTsrYl5Two2Hehb96SD2B4uXhT1Tz4ZSyE/VRWmqRhGO/+NjzPK5S n9ec8j5ft3/S8xyRiPgOQLQYuIwy0hi024CLzXumsDSROLQYIE7sjMXFCm/zlY0ggd5+ U3jMhDNHtuq/guG8jSFXJP0TqGZhkhlXMGxhjOsUiPClxuziEmZI9IzvnsZulOm1c6Lt GiflDXRxq1p0daaKgCun+hzbd2foj7wxPbh4nI/EgMEcC0QHpP/aKugta/94cGzT06iB nV2A== 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 e30-v6si1000228pgn.594.2018.09.21.08.43.18; Fri, 21 Sep 2018 08:43:35 -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 S2390517AbeIUVcZ (ORCPT + 99 others); Fri, 21 Sep 2018 17:32:25 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:42970 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727392AbeIUVcY (ORCPT ); Fri, 21 Sep 2018 17:32:24 -0400 Received: from DGGEMS401-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id D74B3FD6494F1; Fri, 21 Sep 2018 23:42:52 +0800 (CST) Received: from S00293818-DELL1.china.huawei.com (10.202.226.54) by DGGEMS401-HUB.china.huawei.com (10.3.19.201) with Microsoft SMTP Server id 14.3.399.0; Fri, 21 Sep 2018 23:42:44 +0800 From: Salil Mehta To: CC: , , , , , , , Jian Shen Subject: [PATCH net-next 02/12] net: hns3: Unify the type convert for desc.data Date: Fri, 21 Sep 2018 16:41:38 +0100 Message-ID: <20180921154148.26756-3-salil.mehta@huawei.com> X-Mailer: git-send-email 2.8.3 In-Reply-To: <20180921154148.26756-1-salil.mehta@huawei.com> References: <20180921154148.26756-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 For desc.data is already point to the address of struct member "data[6]", it's unnecessary to use '&' to get its address. This patch unifies all the type convert for dest.data, using "req = (struct name *)dest.data". Signed-off-by: Jian Shen Signed-off-by: Peng Li Signed-off-by: Salil Mehta --- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 4 ++-- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c index cf365d4..e9625ce 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c @@ -3387,7 +3387,7 @@ static int hclge_set_serdes_loopback(struct hclge_dev *hdev, bool en) struct hclge_desc desc; int ret, i = 0; - req = (struct hclge_serdes_lb_cmd *)&desc.data[0]; + req = (struct hclge_serdes_lb_cmd *)desc.data; hclge_cmd_setup_basic_desc(&desc, HCLGE_OPC_SERDES_LOOPBACK, false); if (en) { @@ -4634,7 +4634,7 @@ static int hclge_set_vlan_protocol_type(struct hclge_dev *hdev) hclge_cmd_setup_basic_desc(&desc, HCLGE_OPC_MAC_VLAN_INSERT, false); - tx_req = (struct hclge_tx_vlan_type_cfg_cmd *)&desc.data; + tx_req = (struct hclge_tx_vlan_type_cfg_cmd *)desc.data; tx_req->ot_vlan_type = cpu_to_le16(hdev->vlan_type_cfg.tx_ot_vlan_type); tx_req->in_vlan_type = cpu_to_le16(hdev->vlan_type_cfg.tx_in_vlan_type); diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c index 0282067..00bb394 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c @@ -172,7 +172,7 @@ static int hclge_pfc_pause_en_cfg(struct hclge_dev *hdev, u8 tx_rx_bitmap, u8 pfc_bitmap) { struct hclge_desc desc; - struct hclge_pfc_en_cmd *pfc = (struct hclge_pfc_en_cmd *)&desc.data; + struct hclge_pfc_en_cmd *pfc = (struct hclge_pfc_en_cmd *)desc.data; hclge_cmd_setup_basic_desc(&desc, HCLGE_OPC_CFG_PFC_PAUSE_EN, false); @@ -188,7 +188,7 @@ static int hclge_pause_param_cfg(struct hclge_dev *hdev, const u8 *addr, struct hclge_cfg_pause_param_cmd *pause_param; struct hclge_desc desc; - pause_param = (struct hclge_cfg_pause_param_cmd *)&desc.data; + pause_param = (struct hclge_cfg_pause_param_cmd *)desc.data; hclge_cmd_setup_basic_desc(&desc, HCLGE_OPC_CFG_MAC_PARA, false); @@ -207,7 +207,7 @@ int hclge_pause_addr_cfg(struct hclge_dev *hdev, const u8 *mac_addr) u8 trans_gap; int ret; - pause_param = (struct hclge_cfg_pause_param_cmd *)&desc.data; + pause_param = (struct hclge_cfg_pause_param_cmd *)desc.data; hclge_cmd_setup_basic_desc(&desc, HCLGE_OPC_CFG_MAC_PARA, true); -- 2.7.4