Avoid a -Wundef warning on LG_SLAB_MAXREGS.

This commit is contained in:
David Goldblatt
2020-09-16 15:19:06 -07:00
committed by David Goldblatt
parent 40cf71a06d
commit 7ad2f78663
3 changed files with 11 additions and 9 deletions

View File

@@ -183,7 +183,7 @@
#undef LG_PAGE
/* Maximum number of regions in a slab. */
#undef LG_SLAB_MAXREGS
#undef CONFIG_LG_SLAB_MAXREGS
/*
* One huge page is 2^LG_HUGEPAGE bytes. Note that this is defined even if the

View File

@@ -270,15 +270,17 @@
#define SC_LARGE_MAXCLASS (SC_MAX_BASE + (SC_NGROUP - 1) * SC_MAX_DELTA)
/* Maximum number of regions in one slab. */
#ifndef LG_SLAB_MAXREGS
#ifndef CONFIG_LG_SLAB_MAXREGS
# define SC_LG_SLAB_MAXREGS (LG_PAGE - SC_LG_TINY_MIN)
#elif (LG_SLAB_MAXREGS < (LG_PAGE - SC_LG_TINY_MIN))
# error "Unsupported SC_LG_SLAB_MAXREGS"
#else
# define SC_LG_SLAB_MAXREGS LG_SLAB_MAXREGS
# if CONFIG_LG_SLAB_MAXREGS < (LG_PAGE - SC_LG_TINY_MIN)
# error "Unsupported SC_LG_SLAB_MAXREGS"
# else
# define SC_LG_SLAB_MAXREGS CONFIG_LG_SLAB_MAXREGS
# endif
#endif
#define SC_SLAB_MAXREGS (1U << SC_LG_SLAB_MAXREGS)
#define SC_SLAB_MAXREGS (1U << SC_LG_SLAB_MAXREGS)
typedef struct sc_s sc_t;
struct sc_s {