spi_nor_div_by_erase_size(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… spi_nor_div_by_erase_size β€” from the Kernel API Manual, bestie ✨

okay so picture this: you're deep in the SPI NOR code, drivers/mtd/spi-nor, and you need to do some division by an erase size. this little function is literally the main character of that exact moment. it calculates the remainder and updates the new dividend β€” and yes she πŸ’– does both, like a multitasking queen πŸ‘‘


✨ SYNOPSIS ✨

u64 spi_nor_div_by_erase_size (const struct spi_nor_erase_type *erase ,
u64 dividend , u32 *remainder );

that's the whole vibe check right there 🫢 copy it exactly, no cap.


πŸŽ€ ARGUMENTS πŸŽ€

  • erase β€” pointer to a struct that describes a SPI NOR erase type. it's giving "read the room first", because she's the one telling you what to divide by 🌸
  • dividend β€” the dividend value. just a u64, living its life, about to get divided πŸ™ˆ
  • remainder β€” pointer to a u32 remainder, and heads up bestie: it will be updated. so don't pass in something precious unless you're cool with her rewriting it 😭

πŸ‘‘ RETURN πŸ‘‘

the result of the division. that's it, that's the whole payoff ✨

lowkey reminder β€” you passed remainder as a pointer, so the leftover bits get written back through it. that's the whole point of the call πŸ’…

🌈 SEE ALSO 🌈

the source of all this is the kernel file ./drivers/mtd/spi-nor/core.c, and if you want the full friend group β€” the entire squad, no one left out β€” here's everybody:

like, the whole roster 😭 she knows everybody, iykyk πŸ’œ


okay that's the page bestie, go divide something πŸ¦‹ stay slay, and remember β€” this came from ./drivers/mtd/spi-nor, dated October 2026 ⭐ periodt πŸ’…

πŸ“¦ where this page comes from