xarray: Clean up xarray.h
cover xarray: Clean up xarray.h
Main portion of this change is to get rid of kernel.h included into other globally available headers. This decreases a dependency hell degree. The first patch makes it possible to avoid math.h to be included as bitops.h is implied by bitmap.h.
Andy Shevchenko (2):
xarray: Use BITS_PER_LONGS()
xarray: Don't use "proxy" headers
include/linux/xarray.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
Signature · 1 line
2.43.0.rc1.1336.g36b5255a03ac
PATCH 1/2 xarray: Use BITS_PER_LONGS()
Use BITS_PER_LONGS() instead of open coded variant.
Signed-off-by Andy Shevchenko <[email protected]>
--- include/linux/xarray.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/xarray.h +1 -1
@@ -1146,7 +1146,7 @@ static inline void xa_release(struct xarray *xa, unsigned long index)#define XA_CHUNK_SIZE (1UL << XA_CHUNK_SHIFT)#define XA_CHUNK_MASK (XA_CHUNK_SIZE - 1)#define XA_MAX_MARKS 3 -#define XA_MARK_LONGS DIV_ROUND_UP(XA_CHUNK_SIZE, BITS_PER_LONG) +#define XA_MARK_LONGS BITS_TO_LONGS(XA_CHUNK_SIZE)/* * @count is the count of every non-NULL element in the ->slots array
Signature · 1 line
2.43.0.rc1.1336.g36b5255a03ac
PATCH 2/2 xarray: Don't use "proxy" headers
In reply to Andy ShevchenkoUpdate header inclusions to follow IWYU (Include What You Use) principle.
Signed-off-by Andy Shevchenko <[email protected]>
--- include/linux/xarray.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
include/linux/xarray.h +5 -1
@@ -12,14 +12,18 @@#include <linux/bitmap.h> #include <linux/bug.h> #include <linux/compiler.h> +#include <linux/err.h> #include <linux/gfp.h> #include <linux/kconfig.h> -#include <linux/kernel.h> +#include <linux/limits.h> +#include <linux/lockdep.h> #include <linux/rcupdate.h> #include <linux/sched/mm.h> #include <linux/spinlock.h> #include <linux/types.h> +struct list_lru ; +/* * The bottom two bits of the entry determine how the XArray interprets * the contents:
Signature · 1 line
2.43.0.rc1.1336.g36b5255a03ac