nand_check_erased_buf(9)
π nand_check_erased_buf(9) π
okay so this little icon is straight outta the Kernel API Manual, and it's here to check if a buffer is giving erased-NAND energy β¨
πΈ NAME πΈ
nand_check_erased_buf β check if a buffer contains (almost) only 0xff data π
β¨ SYNOPSIS β¨
int nand_check_erased_buf (void *buf , int len , int bitflips_threshold
);
π ARGUMENTS π
bufβ buffer to test, bestie π«Άlenβ buffer lengthbitflips_thresholdβ maximum number of bitflips
π DESCRIPTION π
so the whole vibe is: check if a buffer contains only 0xff, which means the underlying region has been erased and is ready to be programmed β¨ no cap.
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 the nand_check_erased_buf function exits before testing the whole buffer if the number of bitflips exceed the bitflips_threshold value π
It returns a positive number of bitflips less than or equal to bitflips_threshold, or -ERROR_CODE for bitflips in excess of the threshold π
π¦ SEE ALSO π¦
Kernel file ./drivers/mtd/nand/core.c β and here's the whole friend group:
nand_check_erased_ecc_chunk(9)nanddev_isbad(9)nanddev_markbad(9)nanddev_isreserved(9)nanddev_erase(9)nanddev_mtd_erase(9)nanddev_mtd_max_bad_blocks(9)nanddev_get_ecc_engine(9)nanddev_put_ecc_engine(9)nanddev_find_ecc_configuration(9)nanddev_ecc_engine_init(9)nanddev_ecc_engine_cleanup(9)nanddev_init(9)nanddev_cleanup(9)
later bestie β this one's from ./drivers/mtd/nand, October 2026 π
β¨
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms