[PATCH v2 1/2] mtd: sh_flctl: Setup and release DMA channels
Bastian Hecht
hechtb at googlemail.com
Sat Sep 29 07:54:08 EDT 2012
2012/9/28 Guennadi Liakhovetski <g.liakhovetski at gmx.de>:
> On Fri, 28 Sep 2012, Bastian Hecht wrote:
>
> [snip]
>
>> Oh yes, I'll add <linux/completion.h>.
>> About the forward declration: Do I really need it? We use a struct
>> pointer and I am unsure if the compiler just needs to know the name
>> and nothing more. I've tested it and included sh_flctl.h (without any
>> DMA headers) in some driver that has no idea about DMA.
>> gcc didn't complain.
>
> I'm not sure about this, I think, sometimes there might be cases, when gcc
> doesn't complain. Or (more likely) the header is pulled in via another
> one, or some other header has this forward-declaration. But in any case I
> wouldn't rely on either of those and declare what's needed explicitly.
>
>> Adding a non-pointer member
>> + struct sh_dma test;
>> lead to an error, so struct sh_dma is really unknown.
>
> Of course, the compiler has to know the size of the struct to allocate
> space for it:-)
>
Ah sure - I thought I catch any header pull-ins by this test but yeah
- it can be just forward declarations too...
So I will post a merged v3 under the new title: "mtd: sh_flctl: Add
DMA capabilty".
It includes the critics from here plus 2 other things:
- "Fall back to PIO" now actually falls back for the current read
operation and not just for future reads
- I removed the init_completion() after each DMA read. The completion
gets set up at probe time and what I read on the internet and in
researched in the sources we don't need to reset it then after each
usage.
thanks,
Bastian
More information about the linux-mtd
mailing list