[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Minios-devel] [UNIKRAFT PATCH 6/6] include/uk: adapt bitmap.h for Unikraft
1) Add SPDX license identifier 2) Include Unikraft header 3) Fix checkpatch issues Signed-off-by: Costin Lupu <costin.lupu@xxxxxxxxx> --- include/uk/bitmap.h | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/include/uk/bitmap.h b/include/uk/bitmap.h index c323e42..13178b6 100644 --- a/include/uk/bitmap.h +++ b/include/uk/bitmap.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ /* * Copyright (c) 2013-2017 Mellanox Technologies, Ltd. * All rights reserved. @@ -29,7 +30,7 @@ #ifndef _LINUX_BITMAP_H_ #define _LINUX_BITMAP_H_ -#include <linux/bitops.h> +#include <uk/bitops.h> static inline void bitmap_zero(unsigned long *addr, const unsigned int size) @@ -138,9 +139,9 @@ bitmap_clear(unsigned long *map, unsigned int start, int nr) static inline unsigned int bitmap_find_next_zero_area_off(const unsigned long *map, - const unsigned int size, unsigned int start, - unsigned int nr, unsigned int align_mask, - unsigned int align_offset) + const unsigned int size, unsigned int start, + unsigned int nr, unsigned int align_mask, + unsigned int align_offset) { unsigned int index; unsigned int end; @@ -149,7 +150,8 @@ bitmap_find_next_zero_area_off(const unsigned long *map, retry: index = find_next_zero_bit(map, size, start); - index = (((index + align_offset) + align_mask) & ~align_mask) - align_offset; + index = (((index + align_offset) + align_mask) & ~align_mask) - + align_offset; end = index + nr; if (end > size) @@ -165,11 +167,11 @@ retry: static inline unsigned int bitmap_find_next_zero_area(const unsigned long *map, - const unsigned int size, unsigned int start, - unsigned int nr, unsigned int align_mask) + const unsigned int size, unsigned int start, + unsigned int nr, unsigned int align_mask) { return (bitmap_find_next_zero_area_off(map, size, - start, nr, align_mask, 0)); + start, nr, align_mask, 0)); } static inline int @@ -182,7 +184,7 @@ bitmap_find_free_region(unsigned long *bitmap, int bits, int order) if (!linux_reg_op(bitmap, pos, order, REG_OP_ISFREE)) continue; linux_reg_op(bitmap, pos, order, REG_OP_ALLOC); - return (pos); + return pos; } return (-ENOMEM); } @@ -193,7 +195,7 @@ bitmap_allocate_region(unsigned long *bitmap, int pos, int order) if (!linux_reg_op(bitmap, pos, order, REG_OP_ISFREE)) return (-EBUSY); linux_reg_op(bitmap, pos, order, REG_OP_ALLOC); - return (0); + return 0; } static inline void @@ -223,7 +225,7 @@ bitmap_weight(unsigned long *addr, const unsigned int size) static inline int bitmap_equal(const unsigned long *pa, - const unsigned long *pb, unsigned size) + const unsigned long *pb, unsigned int size) { const unsigned int end = BIT_WORD(size); const unsigned int tail = size & (BITS_PER_LONG - 1); @@ -245,7 +247,7 @@ bitmap_equal(const unsigned long *pa, static inline void bitmap_complement(unsigned long *dst, const unsigned long *src, - const unsigned int size) + const unsigned int size) { const unsigned int end = BITS_TO_LONGS(size); unsigned int i; @@ -256,7 +258,7 @@ bitmap_complement(unsigned long *dst, const unsigned long *src, static inline void bitmap_or(unsigned long *dst, const unsigned long *src1, - const unsigned long *src2, const unsigned int size) + const unsigned long *src2, const unsigned int size) { const unsigned int end = BITS_TO_LONGS(size); unsigned int i; @@ -267,7 +269,7 @@ bitmap_or(unsigned long *dst, const unsigned long *src1, static inline void bitmap_and(unsigned long *dst, const unsigned long *src1, - const unsigned long *src2, const unsigned int size) + const unsigned long *src2, const unsigned int size) { const unsigned int end = BITS_TO_LONGS(size); unsigned int i; @@ -278,7 +280,7 @@ bitmap_and(unsigned long *dst, const unsigned long *src1, static inline void bitmap_xor(unsigned long *dst, const unsigned long *src1, - const unsigned long *src2, const unsigned int size) + const unsigned long *src2, const unsigned int size) { const unsigned int end = BITS_TO_LONGS(size); unsigned int i; -- 2.11.0 _______________________________________________ Minios-devel mailing list Minios-devel@xxxxxxxxxxxxxxxxxxxx https://lists.xenproject.org/mailman/listinfo/minios-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |