nand_check_erased_buf(9)

nand_check_erased_buf9

Check if a buffer contains (almost) only 0xff data

Usage

int nand_check_erased_buf(void * buf, int len, int bitflips_threshold);

Arguments

buf

buffer to test

len

buffer length

bitflips_threshold

maximum number of bitflips

Overview

Check if a buffer contains only 0xff, which means the underlying region has been erased and is ready to be programmed. The bitflips_threshold specify the maximum number of bitflips before considering the region is not erased.

Note

The logic of this function has been extracted from the memweight implementation, except that nand_check_erased_buf function exit before testing the whole buffer if the number of bitflips exceed the bitflips_threshold value.

Returns a positive number of bitflips less than or equal to bitflips_threshold, or -ERROR_CODE for bitflips in excess of the threshold.

Author

Thomas Gleixner <[email protected]>

Author.

From linux-manual-4.9 4.9.228-1 in Debian 9 (Stretch). Parsed by carta from the page's man source.