From patchwork Sat Jan 13 21:13:44 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 124427 Delivered-To: patch@linaro.org Received: by 10.46.64.148 with SMTP id r20csp213131lje; Sat, 13 Jan 2018 13:14:18 -0800 (PST) X-Google-Smtp-Source: ACJfBos75gHTJtZExmCGpyA54hCPwerhXR+14lPqUxTOVKUjiRSs4+2djK0E3v9Udt/Gyo2QbeGr X-Received: by 10.98.33.82 with SMTP id h79mr7436335pfh.139.1515878058212; Sat, 13 Jan 2018 13:14:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1515878058; cv=none; d=google.com; s=arc-20160816; b=zYD6e+i5m8tNXWRM6tG9Mf6/TNGEgZCYd9oPEBs/LSKUiF6yEGIxJagEUfvgU36jth rD/651WUNyV6S7evpocz9Atz7aUjQiludheAcxIyUrU5wnIdNvmRDaUorsMgGOkskshP pzXuwpYezRM+OnAmR2qwDn/iobTq8G1JG7HBO89xEatzrxlUvMOk3+Kr24gPnNzWPDn2 bFDPDAQeSBBKIFCUdywUPi7BpI6EjZ7jYiRPulTxiJICSASPa+fP5ftyuhp1xnxdSNcR /1Vsc1ufD7uvRW9UFe9qwtcI9LmoLe75pE0YWir1GLiu9Qbyqpd2cWZQpAkoNzmBfkcQ qu8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=Ck53l2ExBTsGgcvUsyXrDJcjVPsxnhr30t2dArhzLmQ=; b=Ng4TW1HBBszMte88X8yiDYZncapRf5f6IHTuhzxe9ClloRowWQ5tjxzOKkiZ93zHR4 oiuuiW6Gs9WxeP715OWK2Nl5xN5edzfQ7Hhus8ssLvNdYHxzkLepgVfqrHcpb416/WkY erhxIsZZ/UFpFshNGFC/H/4WulHM9tWr5uYm6J4pp0MfeeRWXTakzo+krHcN6yV13oe1 b2OyjF1vr4/cXIAXKS9IDMpbBHE2j+ZxA5Mie1s+Sa9kGP+4GL5FL5et5OY2s1PtaVrZ 3Rq2oE+PZOUfvXLKhjBPRQnFeY6LvPMr7zWceMOEO6lh19S1sSdhxP+FXjjtaSqtc70j TYUQ== 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 a25si15500000pgf.603.2018.01.13.13.14.17; Sat, 13 Jan 2018 13:14:18 -0800 (PST) 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 S1754482AbeAMVOP (ORCPT + 28 others); Sat, 13 Jan 2018 16:14:15 -0500 Received: from mout.kundenserver.de ([217.72.192.75]:56505 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754173AbeAMVOO (ORCPT ); Sat, 13 Jan 2018 16:14:14 -0500 Received: from wuerfel.lan ([95.208.111.237]) by mrelayeu.kundenserver.de (mreue103 [212.227.15.145]) with ESMTPA (Nemesis) id 0MTeXQ-1eRZBt2gS0-00QQn3; Sat, 13 Jan 2018 22:13:57 +0100 From: Arnd Bergmann To: Jassi Brar Cc: Arnd Bergmann , "David S. Miller" , Ard Biesheuvel , Wei Yongjun , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] [net-next] net: netsec: use dma_addr_t for storing dma address Date: Sat, 13 Jan 2018 22:13:44 +0100 Message-Id: <20180113211355.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hMe/dr1 5iMOWmqzBJU35SPaSKaEH4fDOOM2W8EogE6k2A== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On targets that have different sizes for phys_addr_t and dma_addr_t, we get a type mismatch error: drivers/net/ethernet/socionext/netsec.c: In function 'netsec_alloc_dring': drivers/net/ethernet/socionext/netsec.c:970:9: error: passing argument 3 of 'dma_zalloc_coherent' from incompatible pointer type [-Werror=incompatible-pointer-types] The code is otherwise correct, as the address is never actually used as a physical address but only passed into a DMA register. For consistently, I'm changing the variable name as well, to clarify that this is a DMA address. Signed-off-by: Arnd Bergmann --- drivers/net/ethernet/socionext/netsec.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) -- 2.9.0 Acked-by: Ard Biesheuvel diff --git a/drivers/net/ethernet/socionext/netsec.c b/drivers/net/ethernet/socionext/netsec.c index 6c263af86b8a..f4c0b02ddad8 100644 --- a/drivers/net/ethernet/socionext/netsec.c +++ b/drivers/net/ethernet/socionext/netsec.c @@ -252,7 +252,7 @@ struct netsec_desc { }; struct netsec_desc_ring { - phys_addr_t desc_phys; + dma_addr_t desc_dma; struct netsec_desc *desc; void *vaddr; u16 pkt_cnt; @@ -953,7 +953,7 @@ static void netsec_free_dring(struct netsec_priv *priv, int id) if (dring->vaddr) { dma_free_coherent(priv->dev, DESC_SZ * DESC_NUM, - dring->vaddr, dring->desc_phys); + dring->vaddr, dring->desc_dma); dring->vaddr = NULL; } @@ -967,7 +967,7 @@ static int netsec_alloc_dring(struct netsec_priv *priv, enum ring_id id) int ret = 0; dring->vaddr = dma_zalloc_coherent(priv->dev, DESC_SZ * DESC_NUM, - &dring->desc_phys, GFP_KERNEL); + &dring->desc_dma, GFP_KERNEL); if (!dring->vaddr) { ret = -ENOMEM; goto err; @@ -1087,14 +1087,14 @@ static int netsec_reset_hardware(struct netsec_priv *priv) /* set desc_start addr */ netsec_write(priv, NETSEC_REG_NRM_RX_DESC_START_UP, - upper_32_bits(priv->desc_ring[NETSEC_RING_RX].desc_phys)); + upper_32_bits(priv->desc_ring[NETSEC_RING_RX].desc_dma)); netsec_write(priv, NETSEC_REG_NRM_RX_DESC_START_LW, - lower_32_bits(priv->desc_ring[NETSEC_RING_RX].desc_phys)); + lower_32_bits(priv->desc_ring[NETSEC_RING_RX].desc_dma)); netsec_write(priv, NETSEC_REG_NRM_TX_DESC_START_UP, - upper_32_bits(priv->desc_ring[NETSEC_RING_TX].desc_phys)); + upper_32_bits(priv->desc_ring[NETSEC_RING_TX].desc_dma)); netsec_write(priv, NETSEC_REG_NRM_TX_DESC_START_LW, - lower_32_bits(priv->desc_ring[NETSEC_RING_TX].desc_phys)); + lower_32_bits(priv->desc_ring[NETSEC_RING_TX].desc_dma)); /* set normal tx dring ring config */ netsec_write(priv, NETSEC_REG_NRM_TX_CONFIG,