FUNC(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ FUNC(9) β€” the kernel API manual, but make it cute ✨

Okay bestie, buckle up, because we're diving into <pink>FUNC(9)</pink>, straight outta the Kernel API Manual πŸ’…


🌸 NAME 🌸

FUNC β€” the macro that initializes an aspeed_g7_soc1_function entry. That's it, that's the whole job, and it does it iconically. πŸ‘‘

πŸ¦‹ SYNOPSIS πŸ¦‹

FUNC (n , m , ... );

πŸŽ€ ARGUMENTS πŸŽ€

  • n β€” the name of the pin function, bestie. Just the name. 🏷️
  • m β€” a parenthesized list of mux values, and here's the tea: they map 1:1 onto the groups list. One mux value per group, no skipping, no mixing. ☝️
  • ... β€” a variable list of pin group names that are associated with this function. As many as you need, queen. πŸ’

πŸ’– DESCRIPTION πŸ’–

So this macro is out here solving complex static initialization, and honestly? The way it does it is giving main character energy. Here's the breakdown, step by step:

  1. It creates anonymous arrays for both the group names and the mux values, using C99 Compound Literals. Yes, both. Anonymous. Very mysterious, very slay. πŸ•΅οΈβ€β™€οΈ
  2. It uses VM(m) to unwrap those mux values straight into the array initializer. Unwrap, bestie, like a little gift. 🎁
  3. It calculates the number of groups via sizeof division β€” and this is the important part β€” that bypasses the __must_be_array check that ARRAY_SIZE performs. Why do we care? Because that check often fails on compound literals in the kernel environment. So we go around it. Sneaky? Maybe. Necessary? Absolutely. 😌

πŸ”₯ EXAMPLE πŸ”₯

FUNC(i2c0, (1, 4), "i2c0", "di2c0")

What this does, fr fr: it maps the "i2c0" group to mux value 1, and it maps the "di2c0" group to mux value 4. Two groups, two mux values, paired up perfectly. Look at them. Obsessed. 🫢

🌈 SEE ALSO 🌈

  • The kernel file ./drivers/pinctrl/aspeed/pinctrl-aspeed-g7-soc1.c β€” go read it, iykyk πŸ“–
  • VM(9) β€” the unwrapper in question ✨

πŸ’€ Quick vibe check before you go: those mux values in m are matched to the group names positionally, one to one. Don't shuffle them around and then act surprised. πŸ™ˆ

That's the whole page, bestie! This one came from ./drivers/pinctrl/aspeed, dated October 2026, and it lives at FUNC(9) in the Kernel API Manual. Mwah. πŸ’‹πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from