what's with DECLARE_KFIFO, INIT_KFIFO, DEFINE_KFIFO?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



  from <linux/kfifo.h>:

#define DECLARE_KFIFO(name, size) \
union { \
        struct kfifo name; \
        unsigned char name##kfifo_buffer[size + sizeof(struct kfifo)]; \
}
...
#define INIT_KFIFO(name) \
        name = __kfifo_initializer(sizeof(name##kfifo_buffer) - \
                                sizeof(struct kfifo), name##kfifo_buffer)
...
#define DEFINE_KFIFO(name, size) \
        unsigned char name##kfifo_buffer[size]; \
        struct kfifo name = __kfifo_initializer(size, name##kfifo_buffer)
...

  but the surrounding comments imply that all kfifo sizes *must* be a
power of two, yet i see no enforcement of that restriction.  and,
AFAICT, there is absolutely *no* usage of any of those macros anywhere
in the source tree.  the current kfifo routines appear to be
implemented in kernel/kfifo.c, so what is the value of those KFIFO
macros?

rday
--

========================================================================
Robert P. J. Day                               Waterloo, Ontario, CANADA

            Linux Consulting, Training and Kernel Pedantry.

Web page:                                          http://crashcourse.ca
Twitter:                                       http://twitter.com/rpjday
========================================================================

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux