/* Write extra bytes of information from a spare area, using the given scheme.  */
void nand_flash_spare_scheme_write_extra(const struct nand_flash_spare_scheme *scheme, uint8_t *spare, const void *extra, uint8_t size, uint8_t offset)
/* Write extra bytes of information from a spare area, using the given scheme.  */
void nand_flash_spare_scheme_write_extra(const struct nand_flash_spare_scheme *scheme, uint8_t *spare, const void *extra, uint8_t size, uint8_t offset)
{
	Assert((size + offset) < scheme->extra_byte_number);
	uint32_t i;
	for (i = 0; i < size; i++) {
		spare[scheme->extra_bytes_positions[i + offset]]
				= ((uint8_t *) extra)[i];
	}
}