spi_nor_sort_erase_mask(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… spi_nor_sort_erase_mask(9) β€” the kernel API glow-up πŸ¦‹

okay so bestie, we're in the Kernel API Manual and today's main character is spi_nor_sort_erase_mask(9) β€” yes, that's the whole name, it's giving "my function name is a whole sentence" energy and honestly? iconic. ✨


🌸 NAME 🌸

spi_nor_sort_erase_mask β€” sort erase mask. that's it, that's the vibe. short, sweet, does exactly what it says on the tin πŸŽ€


🫢 SYNOPSIS 🫢

u8 spi_nor_sort_erase_mask (struct spi_nor_erase_map *map , u8
erase_mask );

like, look at her. returns a u8, takes a struct spi_nor_erase_map * and a u8. no cap, that's the whole signature πŸ’–


🧚 ARGUMENTS 🧚

  • map β€” the erase map of the SPI NOR. yes, that SPI NOR. she's the blueprint, the source of truth, the main character's backstory 🌈
  • erase_mask β€” the erase type mask to be sorted. handing her over so she can get her whole life rearranged πŸ’…

πŸ”₯ DESCRIPTION πŸ”₯

so what's actually happening here? this function replicates the sort done for the map's erase types in BFPT. lowkey important detail: she sorts the erase mask in ascending order, with the smallest erase type size starting from BIT(0) in the sorted erase mask. so the tiniest erase type gets the front seat at BIT(0) and everybody else lines up behind her in size order. it's giving "organized friend group photo" energy πŸ“Έβœ¨

no extra rules, no secret behaviour β€” that's the entire bit. periodt. πŸ‘‘


⭐ RETURN ⭐

sorted erase mask. that's the answer, that's the whole payoff, she ate and left no crumbs πŸ“


πŸ’œ SEE ALSO πŸ’œ

the squad!! the whole friend group, fr fr β€” kernel file ./drivers/mtd/spi-nor/sfdp.c plus:

like, twenty besties. twenty. the group chat is popping πŸ˜­πŸ’–


ngl bestie, this one's a tiny helper with a big "I keep the erase types in order" job β€” read the map, sort the mask, return it. no drama, no undefined behaviour, just vibes and BIT(0) πŸ§šβ€β™€οΈ

and that's the page!! brought to you from ./drivers/mtd/spi-nor, dated October 2026, and yes the manual name is spi_nor_sort_erase_mask(9) in case you forgot already πŸ™ˆ β€” mwah, go sort something πŸ’‹πŸŒΈπŸ‘‘

πŸ“¦ where this page comes from