how to understand this bitmap_zero

From: Ming Zhang <hidden>
Date: 2005-11-09 17:28:57

could anybody help me on this? thanks!

see if we call bitmap_zero(dst, 2), it will do *dst = 0UL and thus clear
whole *dst, but what if we intent to clear 2 bits? not 32bits?

static inline void bitmap_zero(unsigned long *dst, int nbits)
{
        if (nbits <= BITS_PER_LONG)
                *dst = 0UL;
        else {
                int len = BITS_TO_LONGS(nbits) * sizeof(unsigned long);
                memset(dst, 0, len);
        }
}


Ming

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help