Commit f8a7c1a976a6672204c7f4f0f694f33715dfa617
Committed by
Live-CD User
1 parent
5342b77c41
Exists in
master
and in
4 other branches
kfifo: Use "const" definitions
Currently kfifo cannot be used by parts of the kernel that use "const" properly as kfifo itself does not use const for passed data blocks which are indeed const. Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Showing 2 changed files with 3 additions and 3 deletions Side-by-side Diff
include/linux/kfifo.h
... | ... | @@ -38,7 +38,7 @@ |
38 | 38 | spinlock_t *lock); |
39 | 39 | extern void kfifo_free(struct kfifo *fifo); |
40 | 40 | extern unsigned int __kfifo_put(struct kfifo *fifo, |
41 | - unsigned char *buffer, unsigned int len); | |
41 | + const unsigned char *buffer, unsigned int len); | |
42 | 42 | extern unsigned int __kfifo_get(struct kfifo *fifo, |
43 | 43 | unsigned char *buffer, unsigned int len); |
44 | 44 | |
... | ... | @@ -77,7 +77,7 @@ |
77 | 77 | * bytes copied. |
78 | 78 | */ |
79 | 79 | static inline unsigned int kfifo_put(struct kfifo *fifo, |
80 | - unsigned char *buffer, unsigned int len) | |
80 | + const unsigned char *buffer, unsigned int len) | |
81 | 81 | { |
82 | 82 | unsigned long flags; |
83 | 83 | unsigned int ret; |
kernel/kfifo.c
... | ... | @@ -117,7 +117,7 @@ |
117 | 117 | * writer, you don't need extra locking to use these functions. |
118 | 118 | */ |
119 | 119 | unsigned int __kfifo_put(struct kfifo *fifo, |
120 | - unsigned char *buffer, unsigned int len) | |
120 | + const unsigned char *buffer, unsigned int len) | |
121 | 121 | { |
122 | 122 | unsigned int l; |
123 | 123 |