* [PATCH 2/2] Add "const" attribute to kfifo input buffer pointers
@ 2009-08-14 20:02 David VomLehn
2009-08-14 21:46 ` kfifo: " Greg KH
0 siblings, 1 reply; 2+ messages in thread
From: David VomLehn @ 2009-08-14 20:02 UTC (permalink / raw)
To: linux-kernel; +Cc: akpm, greg, linux-kernel
Change the input buffer arguments for kfifo_put() and __kfifo_put() to have
the "const" attribute.
Signed-off-by: David VomLehn
diff --git a/include/linux/kfifo.h b/include/linux/kfifo.h
index 29f62e1..38d4578 100644
--- a/include/linux/kfifo.h
+++ b/include/linux/kfifo.h
@@ -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,8 @@ 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;
diff --git a/kernel/kfifo.c b/kernel/kfifo.c
index 26539e3..1082952 100644
--- a/kernel/kfifo.c
+++ b/kernel/kfifo.c
@@ -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;
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: kfifo: Add "const" attribute to kfifo input buffer pointers
2009-08-14 20:02 [PATCH 2/2] Add "const" attribute to kfifo input buffer pointers David VomLehn
@ 2009-08-14 21:46 ` Greg KH
0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2009-08-14 21:46 UTC (permalink / raw)
To: David VomLehn; +Cc: linux-kernel, akpm
On Fri, Aug 14, 2009 at 01:02:54PM -0700, David VomLehn wrote:
>
> Change the input buffer arguments for kfifo_put() and __kfifo_put() to have
> the "const" attribute.
Alan Cox already beat you to this one, I have a patch in my tree from
him that does this.
thanks,
greg k-h
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-08-14 21:48 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-08-14 20:02 [PATCH 2/2] Add "const" attribute to kfifo input buffer pointers David VomLehn
2009-08-14 21:46 ` kfifo: " Greg KH
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox