Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1312098ybt; Sat, 11 Jul 2020 06:19:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyf1j2pZB7DaMOXVy6bgJd3wmsdd0o4ByPvcddwlTEVfon1vh8lG6a0pD6i7qnpFF29upAH X-Received: by 2002:a17:906:5949:: with SMTP id g9mr64304555ejr.305.1594473551570; Sat, 11 Jul 2020 06:19:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594473551; cv=none; d=google.com; s=arc-20160816; b=q2wiZpXwpsV46mCk/jfKKu1e86k+nBMV0os7aQEPq1RYmkirNhD8N5IHoYbqYwZFad kQrx3TAp1+rpABjvBxsiwoYABOUgoqyc4AU/A4nrBmQ6nZaZ4Lwy3k75c9haN8YQ9wkN WPXSmYf94gr3EfWMiqT9/P4A/8TTNjh5S4QR8C7jdO/yD2o33SgOfuI0fFDx7RQu0Q1M X4pM94XSTT54cx329CzB0U62ehVz3UsVRrt/pjSJupIyrg7LZIB4f28Ql4A1KftVYvyy AuFg6j5vSf15L5EtOREIQh0oCnqcXJN1djUtVceBDVynmFLPQ0VJSJwb28B2lKBiDqiZ Fncw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:content-disposition :mime-version:message-id:subject:cc:to:from:date:dkim-signature; bh=zWPFWZ7nY1yjdraK2wS+KgXEaieNv2NevddKOt7JQVc=; b=ODG+oq4tRaIeN9FcMlggV+h1d6XGsMrc9XKylToG6wt6gWDNy/GCczgcLyMgwHuf0O jSvQKmpIFFb8MznPPbltKP1P4tzQV5K1m3gbDStSGeyVS3/kOYr5f0By8YWanN8RRJbQ y98NQaCFzMiYYLs4jeKcfEizo5buXQtnfbkAujP+yZLYYtrj/31xFBocbIjUc7l+YBF5 0yz58zKPNtXnimHx0Zya8kkFlPgbB9/PezmV1g1HW3Naeip577QXuOT510OeDow4H7Jg FiWKiC1uAqH4pN8FqtM1xWPXUFewncoFyT8jo0oH4g+VY7JHu9Cj8SsD3tVsmlMK71QT 4iiA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=bE8Ko1Cl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u25si6084057ejr.632.2020.07.11.06.18.30; Sat, 11 Jul 2020 06:19:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=bE8Ko1Cl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728190AbgGKNQk (ORCPT + 99 others); Sat, 11 Jul 2020 09:16:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56330 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726867AbgGKNQj (ORCPT ); Sat, 11 Jul 2020 09:16:39 -0400 Received: from mail-pg1-x541.google.com (mail-pg1-x541.google.com [IPv6:2607:f8b0:4864:20::541]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7DFE4C08C5DD; Sat, 11 Jul 2020 06:16:39 -0700 (PDT) Received: by mail-pg1-x541.google.com with SMTP id d4so3785150pgk.4; Sat, 11 Jul 2020 06:16:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :user-agent; bh=zWPFWZ7nY1yjdraK2wS+KgXEaieNv2NevddKOt7JQVc=; b=bE8Ko1ClEYTQBL3sYEndGbLZzLBfu0J0T4sgcj7bcNZ3cb42+oeM7Ub5vJXLvVDmHH OMyN3JXUHVUYShw9HZ5W6KiaMxz8kPF917Tl9nl1Ez9/HLSrhtJiOgmq/fVqfLPp1UBp 5Rax4YpgPK3MDT67P/724UyGiv5ILwSU9385zAeUQuiMykw2ln2TaoCBoMoIhAeoLWWa RFezY8tVZCa2Kp0bKX27YklDhdHI8746vVO5VkFclUNG20ng6Y4B/tcuwgKbcf13p3AS jBU+LqaPqop/u1ZlBYEASSsJkHJeVeFQ4fgNQGFz5Tt2VsaCQPDoEUtW0blXUkp2W+Jj +Y7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:user-agent; bh=zWPFWZ7nY1yjdraK2wS+KgXEaieNv2NevddKOt7JQVc=; b=txDUA0j1kui3qgTnab14aam/xLFQrolmv8ybtXOg8TYHiEVEMkboiJKGInCkPvMN4S nc9GZ24GMlRN3Yy+inVVqdQ7ODk3aH/ge0wyV7g+mi8tIqJYe4ZGVvsg0ycHJYx7/qhv UPIDnyX94nKCB8uFkbbK1TY3drTWyH2cyck+R2kapAGyY+0dYrz1nG6OK+lXOoNVNuFX qwWWOZ2MepHF92KGJVw6hC/yHoDLCuidUiupU9kQlQ0AKyF2w9IP5nV1A4Es0sMaEctC llJWAMbc6YpolUOytnbtDbw5aOGZPQQpTS3vXkvoY62KdSawJV7ySHQjYUyRCv99QPUi TO7w== X-Gm-Message-State: AOAM533ch5p2cu282JP3NIjeWcZI6KSM0/sQtjzJUFNcUXP8dMPHM3cf uEACgDzHxlsMFYIS8ab2TzwmHZdX7tggWw== X-Received: by 2002:a05:6a00:84e:: with SMTP id q14mr67622989pfk.309.1594473398850; Sat, 11 Jul 2020 06:16:38 -0700 (PDT) Received: from blackclown ([103.88.82.158]) by smtp.gmail.com with ESMTPSA id k3sm8772212pjl.15.2020.07.11.06.16.36 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 11 Jul 2020 06:16:38 -0700 (PDT) Date: Sat, 11 Jul 2020 18:46:24 +0530 From: Suraj Upadhyay To: gregkh@linuxfoundation.org Cc: devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [PATCH] staging: rtl8192e: rtl8192E_dev: Remove pci-dma-compat wrapper APIs. Message-ID: <20200711131623.GA20537@blackclown> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="RnlQjJ0d97Da+TV1" Content-Disposition: inline User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --RnlQjJ0d97Da+TV1 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable The legacy API wrappers in include/linux/pci-dma-compat.h should go away as it creates unnecessary midlayering for include/linux/dma-mapping.h APIs, instead use dma-mapping.h APIs directly. The patch has been generated with the coccinelle script below and compile-tested. @@@@ - PCI_DMA_BIDIRECTIONAL + DMA_BIDIRECTIONAL @@@@ - PCI_DMA_TODEVICE + DMA_TO_DEVICE @@@@ - PCI_DMA_FROMDEVICE + DMA_FROM_DEVICE @@@@ - PCI_DMA_NONE + DMA_NONE @@ expression E1, E2, E3; @@ - pci_alloc_consistent(E1, E2, E3) + dma_alloc_coherent(&E1->dev, E2, E3, GFP_ATOMIC) @@ expression E1, E2, E3; @@ - pci_zalloc_consistent(E1, E2, E3) + dma_alloc_coherent(&E1->dev, E2, E3, GFP_ATOMIC) @@ expression E1, E2, E3, E4; @@ - pci_free_consistent(E1, E2, E3, E4) + dma_free_coherent(&E1->dev, E2, E3, E4) @@ expression E1, E2, E3, E4; @@ - pci_map_single(E1, E2, E3, E4) + dma_map_single(&E1->dev, E2, E3, (enum dma_data_direction)E4) @@ expression E1, E2, E3, E4; @@ - pci_unmap_single(E1, E2, E3, E4) + dma_unmap_single(&E1->dev, E2, E3, (enum dma_data_direction)E4) @@ expression E1, E2, E3, E4, E5; @@ - pci_map_page(E1, E2, E3, E4, E5) + dma_map_page(&E1->dev, E2, E3, E4, (enum dma_data_direction)E5) @@ expression E1, E2, E3, E4; @@ - pci_unmap_page(E1, E2, E3, E4) + dma_unmap_page(&E1->dev, E2, E3, (enum dma_data_direction)E4) @@ expression E1, E2, E3, E4; @@ - pci_map_sg(E1, E2, E3, E4) + dma_map_sg(&E1->dev, E2, E3, (enum dma_data_direction)E4) @@ expression E1, E2, E3, E4; @@ - pci_unmap_sg(E1, E2, E3, E4) + dma_unmap_sg(&E1->dev, E2, E3, (enum dma_data_direction)E4) @@ expression E1, E2, E3, E4; @@ - pci_dma_sync_single_for_cpu(E1, E2, E3, E4) + dma_sync_single_for_cpu(&E1->dev, E2, E3, (enum dma_data_direction)E4) @@ expression E1, E2, E3, E4; @@ - pci_dma_sync_single_for_device(E1, E2, E3, E4) + dma_sync_single_for_device(&E1->dev, E2, E3, (enum dma_data_direction)E4) @@ expression E1, E2, E3, E4; @@ - pci_dma_sync_sg_for_cpu(E1, E2, E3, E4) + dma_sync_sg_for_cpu(&E1->dev, E2, E3, (enum dma_data_direction)E4) @@ expression E1, E2, E3, E4; @@ - pci_dma_sync_sg_for_device(E1, E2, E3, E4) + dma_sync_sg_for_device(&E1->dev, E2, E3, (enum dma_data_direction)E4) @@ expression E1, E2; @@ - pci_dma_mapping_error(E1, E2) + dma_mapping_error(&E1->dev, E2) @@ expression E1, E2; @@ - pci_set_consistent_dma_mask(E1, E2) + dma_set_coherent_mask(&E1->dev, E2) @@ expression E1, E2; @@ - pci_set_dma_mask(E1, E2) + dma_set_mask(&E1->dev, E2) Signed-off-by: Suraj Upadhyay --- This change is proposed by Christoph Hellwig in the post https://marc.info/?l=3Dkernel-janitors&m=3D158745678307= 186&w=3D4 on kernel-janitors Mailing List. drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c b/drivers/stagi= ng/rtl8192e/rtl8192e/r8192E_dev.c index ddcd7885d190..9f869fb3eaa8 100644 --- a/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c +++ b/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c @@ -1215,9 +1215,9 @@ void rtl92e_fill_tx_desc(struct net_device *dev, str= uct tx_desc *pdesc, =20 memset((u8 *)pdesc, 0, 12); =20 - mapping =3D pci_map_single(priv->pdev, skb->data, skb->len, - PCI_DMA_TODEVICE); - if (pci_dma_mapping_error(priv->pdev, mapping)) { + mapping =3D dma_map_single(&priv->pdev->dev, skb->data, skb->len, + DMA_TO_DEVICE); + if (dma_mapping_error(&priv->pdev->dev, mapping)) { netdev_err(dev, "%s(): DMA Mapping error\n", __func__); return; } @@ -1282,10 +1282,10 @@ void rtl92e_fill_tx_cmd_desc(struct net_device *de= v, struct tx_desc_cmd *entry, struct cb_desc *cb_desc, struct sk_buff *skb) { struct r8192_priv *priv =3D rtllib_priv(dev); - dma_addr_t mapping =3D pci_map_single(priv->pdev, skb->data, skb->len, - PCI_DMA_TODEVICE); + dma_addr_t mapping =3D dma_map_single(&priv->pdev->dev, skb->data, + skb->len, DMA_TO_DEVICE); =20 - if (pci_dma_mapping_error(priv->pdev, mapping)) + if (dma_mapping_error(&priv->pdev->dev, mapping)) netdev_err(dev, "%s(): DMA Mapping error\n", __func__); memset(entry, 0, 12); entry->LINIP =3D cb_desc->bLastIniPkt; --=20 2.17.1 --RnlQjJ0d97Da+TV1 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEE7AbCa0kOsMJ4cx0j+gRsbIfe744FAl8Ju6cACgkQ+gRsbIfe 746PVQ/5AdOPy5H4YQEgLsRgxPsin6vIQ3UZ+Vr0vVs8wXO6/gwM3vRqzwC50E// kHmoWWc90Fc1bnVigYowL3tjnwErmWei0OBX52r9bJV4aSAjiJNAXjVPeMps6z4G ifOSG8gLacQBuEf+3E4gEKKwcXjaAqcOtO2mfEZLuwZEwBV3PieolxgomsfbfydH ukV9yyNS4aVXyc0uH8VGQ0EG79xYeXBrmyYzrLVI5o+kzkduKwfDITLf7FNZd/5U 78yRnSvLuqb8c+g2b3TBVkc6wWPEArgAr8BQpIP6UdJ7KRt9pMk1ls8guoaNqc5i 1iu/md3xVvR9en4BuMTCfUQJwgVxgu7q95YhSYV/Wm/mY6ZaC2paay4sARJ9IdhH cyWpopEMltqiRnhB4AaPYtkScvNRih4iEUdrPUWeL64bVLUaFQ16DVp6sxxwvRjX vAaN6wKz6RRkxpJwWtA6lmRFcUvC2Xp3xxQdpgqpMTFzBhNlxoA7AkID0hiUpX5r HCcLuKiQyzDi+tdVkHkcSLRyMI+jbylX1bWVb0MQ7mKvVNRgbGdhhoz8BV0GsUC0 frU3VT9e/qBxggOPHoGQwAjnI0+4DaB/xzfXF3b9ZbRJDT4VJ3/ZybmpYjpOMRCX 9XzrZLozt2KXFj2koVerZ/QsulfNWUuwfIwWQGHAI8u627LL4pM= =jxWP -----END PGP SIGNATURE----- --RnlQjJ0d97Da+TV1--