diff options
author | Anton Vorontsov <avorontsov@mvista.com> | 2010-05-14 10:33:18 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-05-20 16:21:46 -0400 |
commit | 7f1cccd3ec8789e52897bc34420ca81a5e2edeab (patch) | |
tree | 8f97a2d5879b9c7e130372552a2b42b239e97d59 /drivers/usb/host/fhci.h | |
parent | 12e7eca9630c0e00284e8a3995fc5eceaa0c199e (diff) |
USB: FHCI: cq_get() should check kfifo_out()'s return value
Since commit 7acd72eb85f1c7a15e8b5eb554994949241737f1 ("kfifo: rename
kfifo_put... into kfifo_in... and kfifo_get... into kfifo_out..."),
kfifo_out() is marked __must_check, and that causes gcc to produce
lots of warnings like this:
CC drivers/usb/host/fhci-mem.o
In file included from drivers/usb/host/fhci-hcd.c:34:
drivers/usb/host/fhci.h: In function 'cq_get':
drivers/usb/host/fhci.h:520: warning: ignoring return value of 'kfifo_out', declared with attribute warn_unused_result
...
This patch fixes the issue by properly checking the return value.
Signed-off-by: Anton Vorontsov <avorontsov@mvista.com>
Cc: stable <stable@kernel.org> [.33 and .34]
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/host/fhci.h')
-rw-r--r-- | drivers/usb/host/fhci.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/usb/host/fhci.h b/drivers/usb/host/fhci.h index 649ab07308f2..71c3caaea4c1 100644 --- a/drivers/usb/host/fhci.h +++ b/drivers/usb/host/fhci.h | |||
@@ -20,6 +20,7 @@ | |||
20 | 20 | ||
21 | #include <linux/kernel.h> | 21 | #include <linux/kernel.h> |
22 | #include <linux/types.h> | 22 | #include <linux/types.h> |
23 | #include <linux/bug.h> | ||
23 | #include <linux/spinlock.h> | 24 | #include <linux/spinlock.h> |
24 | #include <linux/interrupt.h> | 25 | #include <linux/interrupt.h> |
25 | #include <linux/kfifo.h> | 26 | #include <linux/kfifo.h> |
@@ -515,9 +516,13 @@ static inline int cq_put(struct kfifo *kfifo, void *p) | |||
515 | 516 | ||
516 | static inline void *cq_get(struct kfifo *kfifo) | 517 | static inline void *cq_get(struct kfifo *kfifo) |
517 | { | 518 | { |
518 | void *p = NULL; | 519 | unsigned int sz; |
520 | void *p; | ||
521 | |||
522 | sz = kfifo_out(kfifo, (void *)&p, sizeof(p)); | ||
523 | if (sz != sizeof(p)) | ||
524 | return NULL; | ||
519 | 525 | ||
520 | kfifo_out(kfifo, (void *)&p, sizeof(p)); | ||
521 | return p; | 526 | return p; |
522 | } | 527 | } |
523 | 528 | ||