lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20170208184200.GM16878@collabora.com>
Date:   Wed, 8 Feb 2017 19:42:00 +0100
From:   Peter Senna Tschudin <peter.senna@...labora.com>
To:     Romain Perier <romain.perier@...labora.com>
Cc:     Dan Williams <dan.j.williams@...el.com>,
        Doug Ledford <dledford@...hat.com>,
        Sean Hefty <sean.hefty@...el.com>,
        Hal Rosenstock <hal.rosenstock@...il.com>,
        jeffrey.t.kirsher@...el.com,
        "David S. Miller" <davem@...emloft.net>, stas.yakovlev@...il.com,
        "James E.J. Bottomley" <jejb@...ux.vnet.ibm.com>,
        "Martin K. Petersen" <martin.petersen@...cle.com>,
        Felipe Balbi <balbi@...nel.org>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        linux-rdma@...r.kernel.org, netdev@...r.kernel.org,
        linux-usb@...r.kernel.org, linux-scsi@...r.kernel.org,
        linux-kernel@...r.kernel.org,
        Peter Senna Tschudin <peter.senna@...labora.co.uk>
Subject: Re: [RFC 13/19] scsi: mvsas: Replace PCI pool old API

On Wed, Feb 08, 2017 at 05:34:51PM +0100, Romain Perier wrote:
> The PCI pool API is deprecated. This commits replaces the PCI pool old
> API by the appropriated function with the DMA pool API.
> 
> Signed-off-by: Romain Perier <romain.perier@...labora.com>
> ---
>  drivers/scsi/mvsas/mv_init.c | 4 ++--
>  drivers/scsi/mvsas/mv_sas.c  | 6 +++---
>  2 files changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/scsi/mvsas/mv_init.c b/drivers/scsi/mvsas/mv_init.c
> index 8280046..451ba93 100644
> --- a/drivers/scsi/mvsas/mv_init.c
> +++ b/drivers/scsi/mvsas/mv_init.c
> @@ -126,7 +126,7 @@ static void mvs_free(struct mvs_info *mvi)
>  		slot_nr = MVS_CHIP_SLOT_SZ;
>  
>  	if (mvi->dma_pool)
dma_pool_destroy(NULL) is safe and this check is probably not required

> -		pci_pool_destroy(mvi->dma_pool);
> +		dma_pool_destroy(mvi->dma_pool);
>  
>  	if (mvi->tx)
>  		dma_free_coherent(mvi->dev,
> @@ -296,7 +296,7 @@ static int mvs_alloc(struct mvs_info *mvi, struct Scsi_Host *shost)
>  		goto err_out;
>  
>  	sprintf(pool_name, "%s%d", "mvs_dma_pool", mvi->id);
> -	mvi->dma_pool = pci_pool_create(pool_name, mvi->pdev, MVS_SLOT_BUF_SZ, 16, 0);
> +	mvi->dma_pool = dma_pool_create(pool_name, &mvi->pdev->dev, MVS_SLOT_BUF_SZ, 16, 0);
line over 80.

>  	if (!mvi->dma_pool) {
>  			printk(KERN_DEBUG "failed to create dma pool %s.\n", pool_name);
>  			goto err_out;
> diff --git a/drivers/scsi/mvsas/mv_sas.c b/drivers/scsi/mvsas/mv_sas.c
> index c7cc803..ee81d10 100644
> --- a/drivers/scsi/mvsas/mv_sas.c
> +++ b/drivers/scsi/mvsas/mv_sas.c
> @@ -790,7 +790,7 @@ static int mvs_task_prep(struct sas_task *task, struct mvs_info *mvi, int is_tmf
>  	slot->n_elem = n_elem;
>  	slot->slot_tag = tag;
>  
> -	slot->buf = pci_pool_alloc(mvi->dma_pool, GFP_ATOMIC, &slot->buf_dma);
> +	slot->buf = dma_pool_alloc(mvi->dma_pool, GFP_ATOMIC, &slot->buf_dma);
>  	if (!slot->buf) {
>  		rc = -ENOMEM;
>  		goto err_out_tag;
> @@ -840,7 +840,7 @@ static int mvs_task_prep(struct sas_task *task, struct mvs_info *mvi, int is_tmf
>  	return rc;
>  
>  err_out_slot_buf:
> -	pci_pool_free(mvi->dma_pool, slot->buf, slot->buf_dma);
> +	dma_pool_free(mvi->dma_pool, slot->buf, slot->buf_dma);
>  err_out_tag:
>  	mvs_tag_free(mvi, tag);
>  err_out:
> @@ -918,7 +918,7 @@ static void mvs_slot_task_free(struct mvs_info *mvi, struct sas_task *task,
>  	}
>  
>  	if (slot->buf) {
> -		pci_pool_free(mvi->dma_pool, slot->buf, slot->buf_dma);
> +		dma_pool_free(mvi->dma_pool, slot->buf, slot->buf_dma);
>  		slot->buf = NULL;
>  	}
>  	list_del_init(&slot->entry);
> -- 
> 2.9.3
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ