Skip to main content

Linux nerd's definitions

ffs

Find First Set. Used in Linux programming as a quick way to find which is the first bit of a word, starting from the least significant bit, that is set.
From the Linux kernel arch/x86/kernel/cpu/mtrr/generic.c:

high_width = ffs(size_or_mask & 0xffffffffUL) - 1;

high_width becomes the bit position of the least significant bit set in size_or_mask. Note, the least significant bit for ffs is 1, not 0, because 0 is returned if no bit is set. The -1 is used to convert the result of ffs() to the standard bit numbering.
by Linux nerd June 12, 2011
mugGet the ffs mug.

Share this definition

Sign in to vote

We'll email you a link to sign in instantly.

Or

Check your email

We sent a link to

Open your email