소스 검색

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>
Alan Cox 15 년 전
부모
커밋
f8a7c1a976
2개의 변경된 파일3개의 추가작업 그리고 3개의 파일을 삭제
  1. 2 2
      include/linux/kfifo.h
  2. 1 1
      kernel/kfifo.c

+ 2 - 2
include/linux/kfifo.h

@@ -38,7 +38,7 @@ extern struct kfifo *kfifo_alloc(unsigned int size, gfp_t gfp_mask,
 				 spinlock_t *lock);
 				 spinlock_t *lock);
 extern void kfifo_free(struct kfifo *fifo);
 extern void kfifo_free(struct kfifo *fifo);
 extern unsigned int __kfifo_put(struct kfifo *fifo,
 extern unsigned int __kfifo_put(struct kfifo *fifo,
-				unsigned char *buffer, unsigned int len);
+				const unsigned char *buffer, unsigned int len);
 extern unsigned int __kfifo_get(struct kfifo *fifo,
 extern unsigned int __kfifo_get(struct kfifo *fifo,
 				unsigned char *buffer, unsigned int len);
 				unsigned char *buffer, unsigned int len);
 
 
@@ -77,7 +77,7 @@ static inline void kfifo_reset(struct kfifo *fifo)
  * bytes copied.
  * bytes copied.
  */
  */
 static inline unsigned int kfifo_put(struct kfifo *fifo,
 static inline unsigned int kfifo_put(struct kfifo *fifo,
-				     unsigned char *buffer, unsigned int len)
+				const unsigned char *buffer, unsigned int len)
 {
 {
 	unsigned long flags;
 	unsigned long flags;
 	unsigned int ret;
 	unsigned int ret;

+ 1 - 1
kernel/kfifo.c

@@ -117,7 +117,7 @@ EXPORT_SYMBOL(kfifo_free);
  * writer, you don't need extra locking to use these functions.
  * writer, you don't need extra locking to use these functions.
  */
  */
 unsigned int __kfifo_put(struct kfifo *fifo,
 unsigned int __kfifo_put(struct kfifo *fifo,
-			 unsigned char *buffer, unsigned int len)
+			const unsigned char *buffer, unsigned int len)
 {
 {
 	unsigned int l;
 	unsigned int l;