From patchwork Fri Sep 21 15:41:38 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Salil Mehta X-Patchwork-Id: 147289 Delivered-To: patch@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp970779ljw; Fri, 21 Sep 2018 08:43:02 -0700 (PDT) X-Google-Smtp-Source: ANB0VdbMEzelGjy1ttPOv4u3JHmIcUwul86WjqYSS4oCw5rBRuaRkAW1apscoFex/5BGc8saZL1+ X-Received: by 2002:a17:902:bc8b:: with SMTP id bb11-v6mr44322829plb.112.1537544582052; Fri, 21 Sep 2018 08:43:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537544582; cv=none; d=google.com; s=arc-20160816; b=tqVrhSamk0ultVNRAl9MrEoQcJxGSzlfp4InEo7QZguUwm+0qpfqhAUjgPiGbtoXdU tOGprqAzli62CU8vpSpERkHDuElIlf9lk5Th6KHJAJ0ma0f0bNPQj0vvNXkHPxESUbaT 9sNZdW31OBQNlF/vun68EpPr88Yw47irMqqwDxZm2eWcbklQJnP1OiBVC8Ek6xP9HfdC VLQbFntWDN1XP5G84bD1+8stCDWhme4oEf/Y7HGZoYPgdRo438wLQEI+EFWMLc+2IfV6 bC+XMp8UCYHt8o/A8W97EqSMS1m6POkHUZXXvrUPQlNDtC813DSve/zwjDxExLf8Ap1o tPdA== 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 g38-v6si2393882pgm.193.2018.09.21.08.43.01; Fri, 21 Sep 2018 08:43:02 -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 S2390524AbeIUVcZ (ORCPT + 32 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 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(-) -- 2.7.4 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);