Skip to contentSkip to conversation

kfifo: make '__n' local variables *unsigned int*

PATCH New Sergey Shtylyov 1 participant 1 message Feb 26, 2022 Kfifo

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kfifo: make '__n' local variables *unsigned int*

The '__n' local variables in kfifo_{in|out|out_peek}() are declared as *unsigned long* for some strange reason -- the underlying __kfifo_*() functions take *unsigned int* for the corresponding 'len' parameters. Fix those declarations to *unsigned int*...

---
This patch is against Linus Torvalds' 'linux.git' repo.

 include/linux/kfifo.h |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
include/linux/kfifo.h +3 -3
Index: usb/include/linux/kfifo.h
===================================================================
@@ -520,7 +520,7 @@ __kfifo_uint_must_check_helper( \
 ({ \
 	typeof((fifo) + 1) __tmp = (fifo); \
 	typeof(__tmp->ptr_const) __buf = (buf); \
-	unsigned long __n = (n); \
+	unsigned int __n = (n); \
 	const size_t __recsize = sizeof(*__tmp->rectype); \
 	struct __kfifo *__kfifo = &__tmp->kfifo; \
 	(__recsize) ?\
@@ -589,7 +589,7 @@ __kfifo_uint_must_check_helper( \
 ({ \
 	typeof((fifo) + 1) __tmp = (fifo); \
 	typeof(__tmp->ptr) __buf = (buf); \
-	unsigned long __n = (n); \
+	unsigned int __n = (n); \
 	const size_t __recsize = sizeof(*__tmp->rectype); \
 	struct __kfifo *__kfifo = &__tmp->kfifo; \
 	(__recsize) ?\
@@ -819,7 +819,7 @@ __kfifo_uint_must_check_helper( \
 ({ \
 	typeof((fifo) + 1) __tmp = (fifo); \
 	typeof(__tmp->ptr) __buf = (buf); \
-	unsigned long __n = (n); \
+	unsigned int __n = (n); \
 	const size_t __recsize = sizeof(*__tmp->rectype); \
 	struct __kfifo *__kfifo = &__tmp->kfifo; \
 	(__recsize) ? \