Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp1328874ybg; Wed, 29 Jul 2020 11:14:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy9B0bUmAaqAxYA80BpZXJIZNj/FZGs9q2+gN9ICWqZ7TZDPjc+Sd4xyinmYx47f2JbesXI X-Received: by 2002:a17:906:6d41:: with SMTP id a1mr11731226ejt.384.1596046452715; Wed, 29 Jul 2020 11:14:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596046452; cv=none; d=google.com; s=arc-20160816; b=HyTkaTr8ixSs5qlpC2EgHgS9fkoH351t2zoCWYgaQL/7BrIQhlMtDB6WlKJWGRKzHO pw4v0lIws136KkTsZqHBaysw4aSS7BbhEDY4E7QADYFdt3mFSRkLSE6BFawkS8iAFIAm pwFGA3JgnK+dOnxEZrXPMxlMuypGHiRHERBM38o3XeyfO19IE9PPnfhx24NswycsKwxe igk1tW+ZcKmLzSd6EhLNtGarOfePf1tlPvk/IgNiNNrUHoo0v0gA2fNloteaWhOjHrEi 6wCILWylF0S22cecC2qE2BKo8hu8rbHNfP9ezwUKrdWuZDWIucuLsWzcaEQ5utt3mEOR Q9ew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=FjVLtakLnkTChcyRfYnpNb/VSLaNgBesDn6ACtOCpfA=; b=WzVJqnuBK88b+Sy9andBQET74hQVPcsnC6oUZL7/1UWdD4EUaEPgHHFsWmkHT05kUe ec2WXlQCT1ioLvn922lz6xR4qqHzOc2Lk00Ut9jmT2mIjkAOW3stedV+o45Kn4yx46ll gTY+CCkr/H4lrkIuU1VDn8zVyzIMUSBdzqCDbeVJrOVUbJOpE/cQGCdOKyh5eaJGDqLs RkooAOFsScgdbhX3cH0nBXMVyqz28aEj+K3r/J17cx5FsCt4DPhdo02tLiCWce9byjnY I4iREqk2HvPkzEW5rj91uu8W69L5WVa4y6lnAQKwnAXLx9yCZbN0fuxXI6Tq839ivWJR g6GA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Z3aw98rP; 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 r20si1589202ejz.158.2020.07.29.11.13.50; Wed, 29 Jul 2020 11:14:12 -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=Z3aw98rP; 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 S1727885AbgG2SKi (ORCPT + 99 others); Wed, 29 Jul 2020 14:10:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37518 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727866AbgG2SKg (ORCPT ); Wed, 29 Jul 2020 14:10:36 -0400 Received: from mail-pf1-x444.google.com (mail-pf1-x444.google.com [IPv6:2607:f8b0:4864:20::444]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 74C3AC061794; Wed, 29 Jul 2020 11:10:36 -0700 (PDT) Received: by mail-pf1-x444.google.com with SMTP id w126so13174165pfw.8; Wed, 29 Jul 2020 11:10:36 -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:references:mime-version :content-disposition:in-reply-to:user-agent; bh=FjVLtakLnkTChcyRfYnpNb/VSLaNgBesDn6ACtOCpfA=; b=Z3aw98rPf2c2EdoB8RwBsFO0TgAEQ1qheF+QYl7XJ77U5H4WeC2uHZ5lXbEngQr3vq 1SnRyQkmviqW7mJjaXZ0UHdaqgNjyX+7CIN5DIwQT+vH1l5X9vQIGlFufr7cnAtQdtge LkJkAueCZpW3eMIM8GVg9NmPuX9yc6uZYsNzcQzfyWyoNrfNUYsU9UnHM5YZDTCv+7u8 SG7iGE8qokUOsKVC94Df2l4z4kFg7n4WDDuCHutISnMJPC5OGT9wCoLFgGCBB7BUN+qN MY1rC20niX8qO1FhgfbxNcO7ky3VTVS715gsv8qD2X+2S+6IHPlelwxI9qOK6zmEaFQN J0/A== 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:references :mime-version:content-disposition:in-reply-to:user-agent; bh=FjVLtakLnkTChcyRfYnpNb/VSLaNgBesDn6ACtOCpfA=; b=h21v3dKb/5ehC056kFWSg7E4jmjMWvOBu3eOKK7dZo2TjZtzLCcK7SSYhuJLzwyfmV yzUFeQ7ylguJ/n/kamy9Pq75UtVlNPhINWLGFlNh0WUyQwuTH9OqVFgRUxq86TO6Y0/C We2LYN0AarMpZ+eQQ+Y3Lu3KWDf7Iz7npiadqBJYPEQkMuut9oDMGD3uMhfeErurf6M3 JfIXoZqaaK0qPabPH9f0hd+KgpKXXA2nVda8vrCcJsUNdggYVMBijGzvTXYJ/to0a7++ g8HB++1K8de0hdN0ccFczCESedh5rnmpfmNvFHcgjxSlozX3K3PGBcLo5/AGfl1aRA0h BAjw== X-Gm-Message-State: AOAM531aaTgfxr4A+YzUOF3dLCM4wWcWIVzGaa1oBOWn8gwGtHHZSz6Q Q/9KtJN2YflP9reorPbiG4Y= X-Received: by 2002:a62:1dc3:: with SMTP id d186mr15379797pfd.93.1596046235902; Wed, 29 Jul 2020 11:10:35 -0700 (PDT) Received: from blackclown ([103.88.82.91]) by smtp.gmail.com with ESMTPSA id f131sm3146938pgc.14.2020.07.29.11.10.31 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 29 Jul 2020 11:10:35 -0700 (PDT) Date: Wed, 29 Jul 2020 23:40:21 +0530 From: Suraj Upadhyay To: jejb@linux.ibm.com, martin.petersen@oracle.com, sathya.prakash@broadcom.com, sreekanth.reddy@broadcom.com, suganath-prabu.subramani@broadcom.com, MPT-FusionLinux.pdl@broadcom.com Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@linux-kernel.org Subject: [PATCH 4/7] scsi: mpt3sas: Remove pci-dma-compat wrapper APIs. Message-ID: References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="sdtB3X0nJg68CQEu" Content-Disposition: inline In-Reply-To: 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 --sdtB3X0nJg68CQEu 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. 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_) @@ expression E1, E2, E3; @@ - pci_zalloc_consistent(E1, E2, E3) + dma_alloc_coherent(&E1->dev, E2, E3, GFP_) @@ 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, E4) @@ expression E1, E2, E3, E4; @@ - pci_unmap_single(E1, E2, E3, E4) + dma_unmap_single(&E1->dev, E2, E3, E4) @@ expression E1, E2, E3, E4, E5; @@ - pci_map_page(E1, E2, E3, E4, E5) + dma_map_page(&E1->dev, E2, E3, E4, E5) @@ expression E1, E2, E3, E4; @@ - pci_unmap_page(E1, E2, E3, E4) + dma_unmap_page(&E1->dev, E2, E3, E4) @@ expression E1, E2, E3, E4; @@ - pci_map_sg(E1, E2, E3, E4) + dma_map_sg(&E1->dev, E2, E3, E4) @@ expression E1, E2, E3, E4; @@ - pci_unmap_sg(E1, E2, E3, E4) + dma_unmap_sg(&E1->dev, E2, E3, 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, 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, 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, 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, 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 --- drivers/scsi/mpt3sas/mpt3sas_ctl.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/scsi/mpt3sas/mpt3sas_ctl.c b/drivers/scsi/mpt3sas/mpt3= sas_ctl.c index 43260306668c..94698ad1cad7 100644 --- a/drivers/scsi/mpt3sas/mpt3sas_ctl.c +++ b/drivers/scsi/mpt3sas/mpt3sas_ctl.c @@ -3384,12 +3384,10 @@ host_trace_buffer_enable_store(struct device *cdev, && (ioc->diag_buffer_status[MPI2_DIAG_BUF_TYPE_TRACE] & MPT3_DIAG_BUFFER_IS_APP_OWNED)) { - pci_free_consistent(ioc->pdev, - ioc->diag_buffer_sz[ - MPI2_DIAG_BUF_TYPE_TRACE], - ioc->diag_buffer[MPI2_DIAG_BUF_TYPE_TRACE], - ioc->diag_buffer_dma[ - MPI2_DIAG_BUF_TYPE_TRACE]); + dma_free_coherent(&ioc->pdev->dev, + ioc->diag_buffer_sz[MPI2_DIAG_BUF_TYPE_TRACE], + ioc->diag_buffer[MPI2_DIAG_BUF_TYPE_TRACE], + ioc->diag_buffer_dma[MPI2_DIAG_BUF_TYPE_TRACE]); ioc->diag_buffer[MPI2_DIAG_BUF_TYPE_TRACE] =3D NULL; } --=20 2.17.1 --sdtB3X0nJg68CQEu Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEE7AbCa0kOsMJ4cx0j+gRsbIfe744FAl8hu4wACgkQ+gRsbIfe 744pnQ/+L1/0iu3tEgfAUIuv1dK2wl3gSobE6p6zDAYTZKmFqCGuedXizHG1HCc4 LEnwZ8bBm8WGSC9AEzJEgpvxCKCLQDIrSGa11E4QShNJdx1tl689CdTMAwob2YVJ F4SJJFDeRf7BbGROlUVV+Vdpg3e0G+HXIYtlPM31pCsV1tboAjNRPz6IgVXwWJwW ylgmj1GZbJAXa8OnJZ1BVc+lebwxgJnPrCUjR5oFd0Z230ymZY6XM4iCRVKeIDaZ uPhfjjR7b4ECIS2ZeYtvXLNb54t0wSXByMc2aeLhdTxCS2XruTL+PTsyDmnTSgF2 Jxl9KjF4JxoOU5JCi3Df++PpHFH2lbezOhVauGz1EBex6jtBuhVRxADjfp8+oRAM ULpcGJ3ipGCh6OoeWPt4Ge3bpfUQmibnHxaDsxxEibtWZ4tbhxPE+yvfBWbrYu+U 3L9nUFDUhjHHSFdfEI2AfBgo0wzGOoNt1t2SWNE8xJPwAActVxk6rNFjlj3WgzEd N4ibYk1K3TdC9cx4z8MpQaP1W1C0cJk4qJ7QVO8OzLC20LTN8CpSRoIKylwJbDNe NM08fSaum+XzVTHTcBIRQhVwgKFRKnxTtt7xs4Y2AXGyKp/HvGptTG/PbJqJhwC7 jsGh7y1Uue0+bxEYAngEDUIieVd9BVdRRJYAMrnDwwrcv+AX1qU= =b4xk -----END PGP SIGNATURE----- --sdtB3X0nJg68CQEu--