[MTD] potential division by 0 in cfi_build_cmd() and cfi_merge_status()?

Jörn Engel joern at logfs.org
Mon Jan 14 23:10:32 EST 2008


On Mon, 14 January 2008 23:06:13 -0500, Nicolas Pitre wrote:
> On Tue, 15 Jan 2008, Jörn Engel wrote:
> 
> > I don't think cfi_interleave(cfi) will ever be 0.  But the functions
> > definitely look a bit large for inlines.  Anyone having both cfi_probe
> > and jedec_probe will enjoy twice the kernel footprint from them.
> > Patches to move that code out-of-line are welcome.
> 
> Beware.
> 
> The typical use case is for your embedded system to be configured with 
> your flash arrangement and not all possible combinations available under 
> the sun.
> 
> In that case it is most likely that cfi_interleave(cfi) will simplify to 
> a constant, and making this out of line _will_ enlarge your kernel, as 
> well as possibly breaking interaction with a XIP kernel on ARM.
> 
> So please don't push this out of line.

Fair enough.

Jörn

-- 
Joern's library part 13:
http://www.chip-architect.com/



More information about the linux-mtd mailing list