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>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 27 Jan 2014 14:49:50 +0000
From:	Ben Hutchings <ben@...adent.org.uk>
To:	Alexey Charkov <alchark@...il.com>
Cc:	netdev@...r.kernel.org, linux@...sktech.co.nz,
	devicetree@...r.kernel.org, rl@...lgate.ch,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/3] net: via-rhine: switch to generic DMA functions

On Mon, 2014-01-27 at 15:51 +0400, Alexey Charkov wrote:
> Remove legacy PCI DMA wrappers and instead use generic DMA functions
> directly in preparation for OF bus binding
> 
> Signed-off-by: Alexey Charkov <alchark@...il.com>
> Signed-off-by: Roger Luethi <rl@...lgate.ch>
> ---
>  drivers/net/ethernet/via/via-rhine.c | 56 +++++++++++++++++++-----------------
>  1 file changed, 29 insertions(+), 27 deletions(-)
> 
> diff --git a/drivers/net/ethernet/via/via-rhine.c b/drivers/net/ethernet/via/via-rhine.c
> index ef312bc..fee8732 100644
> --- a/drivers/net/ethernet/via/via-rhine.c
> +++ b/drivers/net/ethernet/via/via-rhine.c
> @@ -919,10 +919,10 @@ static int rhine_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
>  		goto err_out;
>  
>  	/* this should always be supported */
> -	rc = pci_set_dma_mask(pdev, DMA_BIT_MASK(32));
> +	rc = dma_set_mask(&pdev->dev, DMA_BIT_MASK(32));
>  	if (rc) {
>  		dev_err(&pdev->dev,
> -			"32-bit PCI DMA addresses not supported by the card!?\n");
> +			"32-bit DMA addresses not supported by the card!?\n");
>  		goto err_out;
>  	}
>  
> @@ -1094,20 +1094,22 @@ static int alloc_ring(struct net_device* dev)
>  	void *ring;
>  	dma_addr_t ring_dma;
>  
> -	ring = pci_alloc_consistent(rp->pdev,
> +	ring = dma_alloc_coherent(&rp->pdev->dev,
>  				    RX_RING_SIZE * sizeof(struct rx_desc) +
>  				    TX_RING_SIZE * sizeof(struct tx_desc),
> -				    &ring_dma);
> +				    &ring_dma,
> +					GFP_ATOMIC);
[...]

Indentation is messed up here (and in several other function calls
you're changing).  You should align the function arguments so each line
begins in the column after the opening parenthesis.

Ben.

-- 
Ben Hutchings
If at first you don't succeed, you're doing about average.

Download attachment "signature.asc" of type "application/pgp-signature" (829 bytes)

Powered by blists - more mailing lists