kfifo: Use "const" definitions
authorAlan Cox <alan@linux.intel.com>
Sat, 19 Sep 2009 20:13:17 +0000 (13:13 -0700)
committerLive-CD User <linux@linux.site>
Sat, 19 Sep 2009 20:13:17 +0000 (13:13 -0700)
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>
include/linux/kfifo.h
kernel/kfifo.c

index 29f62e1733ff4e23c61e4f25c75d6e5498e4ab93..ad6bdf5a5970c5fdbceb6b5c440a196b7a620b22 100644 (file)
@@ -38,7 +38,7 @@ extern struct kfifo *kfifo_alloc(unsigned int size, gfp_t gfp_mask,
                                 spinlock_t *lock);
 extern void kfifo_free(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,
                                unsigned char *buffer, unsigned int len);
 
@@ -77,7 +77,7 @@ static inline void kfifo_reset(struct kfifo *fifo)
  * bytes copied.
  */
 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 int ret;
index 26539e3228e50f81ca892122a23b6bd1fcf98fe6..3765ff3c1bbe780118d6c04ec6391056dfda8f8a 100644 (file)
@@ -117,7 +117,7 @@ EXPORT_SYMBOL(kfifo_free);
  * writer, you don't need extra locking to use these functions.
  */
 unsigned int __kfifo_put(struct kfifo *fifo,
-                        unsigned char *buffer, unsigned int len)
+                       const unsigned char *buffer, unsigned int len)
 {
        unsigned int l;