[PATCH v3] staging: lustre: libcfs: Remove new typedef in bitmap.h

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

 



Fix cfs_bitmap struct, function parameters, and variable
declarations to resolve the "Do not add new typedefs"
warning generated by checkpatch.pl in bitmap.h and meet
kernel coding style.

Signed-off-by: Lisa Nguyen <lisa@xxxxxxxxxxxxxxx>
---

Changes since v3:
- Combining the previous two patch versions into one!

 .../staging/lustre/include/linux/libcfs/bitmap.h   | 25 +++++++++++-----------
 1 file changed, 12 insertions(+), 13 deletions(-)

diff --git a/drivers/staging/lustre/include/linux/libcfs/bitmap.h b/drivers/staging/lustre/include/linux/libcfs/bitmap.h
index f3d4a89..a093d2d 100644
--- a/drivers/staging/lustre/include/linux/libcfs/bitmap.h
+++ b/drivers/staging/lustre/include/linux/libcfs/bitmap.h
@@ -36,19 +36,18 @@
 #ifndef _LIBCFS_BITMAP_H_
 #define _LIBCFS_BITMAP_H_
 
-
-typedef struct {
+struct cfs_bitmap {
 	int	     size;
 	unsigned long   data[0];
-} cfs_bitmap_t;
+};
 
 #define CFS_BITMAP_SIZE(nbits) \
-     (((nbits/BITS_PER_LONG)+1)*sizeof(long)+sizeof(cfs_bitmap_t))
+     (((nbits/BITS_PER_LONG)+1)*sizeof(long)+sizeof(struct cfs_bitmap))
 
-static inline
-cfs_bitmap_t *CFS_ALLOCATE_BITMAP(int size)
+static inline struct
+cfs_bitmap *CFS_ALLOCATE_BITMAP(int size)
 {
-	cfs_bitmap_t *ptr;
+	cfs_bitmap *ptr;
 
 	OBD_ALLOC(ptr, CFS_BITMAP_SIZE(size));
 	if (ptr == NULL)
@@ -62,38 +61,38 @@ cfs_bitmap_t *CFS_ALLOCATE_BITMAP(int size)
 #define CFS_FREE_BITMAP(ptr)	OBD_FREE(ptr, CFS_BITMAP_SIZE(ptr->size))
 
 static inline
-void cfs_bitmap_set(cfs_bitmap_t *bitmap, int nbit)
+void cfs_bitmap_set(struct cfs_bitmap *bitmap, int nbit)
 {
 	set_bit(nbit, bitmap->data);
 }
 
 static inline
-void cfs_bitmap_clear(cfs_bitmap_t *bitmap, int nbit)
+void cfs_bitmap_clear(struct cfs_bitmap *bitmap, int nbit)
 {
 	test_and_clear_bit(nbit, bitmap->data);
 }
 
 static inline
-int cfs_bitmap_check(cfs_bitmap_t *bitmap, int nbit)
+int cfs_bitmap_check(struct cfs_bitmap *bitmap, int nbit)
 {
 	return test_bit(nbit, bitmap->data);
 }
 
 static inline
-int cfs_bitmap_test_and_clear(cfs_bitmap_t *bitmap, int nbit)
+int cfs_bitmap_test_and_clear(struct cfs_bitmap *bitmap, int nbit)
 {
 	return test_and_clear_bit(nbit, bitmap->data);
 }
 
 /* return 0 is bitmap has none set bits */
 static inline
-int cfs_bitmap_check_empty(cfs_bitmap_t *bitmap)
+int cfs_bitmap_check_empty(struct cfs_bitmap *bitmap)
 {
 	return find_first_bit(bitmap->data, bitmap->size) == bitmap->size;
 }
 
 static inline
-void cfs_bitmap_copy(cfs_bitmap_t *new, cfs_bitmap_t *old)
+void cfs_bitmap_copy(struct cfs_bitmap *new, struct cfs_bitmap *old)
 {
 	int newsize;
 
-- 
1.8.1.2

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel




[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux