Hi Guillaume, On 17 December 2011 14:13, Guillaume LECERF <glecerf@xxxxxxxxx> wrote: > Hi Jonas, > > 2011/12/17 Jonas Gorski <jonas.gorski@xxxxxxxxx>: >> - spareaddr = roundup(totallen, master->erasesize) + master->erasesize; >> - sparelen = master->size - spareaddr - master->erasesize; >> + spareaddr = roundup(totallen, master->erasesize) + cfelen; > > spareaddr = roundup(totallen, cfelen) + cfelen ? The intention is to align the spareaddr to the next eraseblock (cfelen can be bigger than the erasesize). Maybe writing it as spareaddr = roundup(cfelen + totallen, master->erasesize); would be cleaner. Jonas