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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20080428130532.GU14990@parisc-linux.org>
Date:	Mon, 28 Apr 2008 07:05:32 -0600
From:	Matthew Wilcox <matthew@....cx>
To:	Matti Linnanvuori <mattilinnanvuori@...oo.com>
Cc:	jbarnes@...tuousgeek.org, linux-kernel@...r.kernel.org,
	linux-pci@...ey.karlin.mff.cuni.cz, grundler@...isc-linux.org
Subject: Re: [patch v3] doc: DMA-mapping.txt has undeclared variables [Bug 10397]

On Mon, Apr 28, 2008 at 05:58:49AM -0700, Matti Linnanvuori wrote:
> From: Matti Linnanvuori <mattilinnanvuori@...oo.com>
> 
> Consistently use pdev as the variable of type struct pci_dev *.
> Update DMA mapping documentation to use 'pdev' rather than 'dev' in 
> example code that calls routines expecting 'struct pci_device *', since 'dev' 
> might make readers think they're passing 'struct device *' parameters.
> Bug 10397.
> 
> Signed-off-by: Matti Linnanvuori <mattilinnanvuori@...oo.com>

Acked-by: Matthew Wilcox <willy@...ux.intel.com>

> -    cpu_addr = pci_alloc_consistent(dev, size, &dma_handle);
> +    cpu_addr = pci_alloc_consistent(pdev, size, &dma_handle);
>  
> -where dev is a struct pci_dev *. You should pass NULL for PCI like buses
> +where pdev is a struct pci_dev *. You should pass NULL for PCI like buses
>  where devices don't have struct pci_dev (like ISA, EISA).  This may be
>  called in interrupt context. 

The second sentence is misleading (but it's unrelated to this patch).
If you don't have a pdev, you should be using dma_alloc_coherent()
instead (see DMA-API.txt).  Want to make another patch?  ;-)

-- 
Intel are signing my paycheques ... these opinions are still mine
"Bill, look, we understand that you're interested in selling us this
operating system, but compare it to ours.  We can't possibly take such
a retrograde step."
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ