diff options
| author | Greg Kroah-Hartman <gregkh@suse.de> | 2010-01-27 16:49:18 -0800 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-01-27 16:49:18 -0800 |
| commit | 111fd6e66e29d3546b70c72d44b960cafac76526 (patch) | |
| tree | b485c3f4f80ca6902f927747de793361f8ba7fb9 /usb.current | |
| parent | f653687e4192a31f6a06bb8ef7401c9120d021cd (diff) | |
| download | patches-111fd6e66e29d3546b70c72d44b960cafac76526.tar.gz | |
lots of staging, one driver core, and 3 usb/kfifo patches
Diffstat (limited to 'usb.current')
3 files changed, 143 insertions, 0 deletions
diff --git a/usb.current/kfifo-don-t-use-integer-as-null-pointer.patch b/usb.current/kfifo-don-t-use-integer-as-null-pointer.patch new file mode 100644 index 00000000000000..c52bfca286194c --- /dev/null +++ b/usb.current/kfifo-don-t-use-integer-as-null-pointer.patch @@ -0,0 +1,47 @@ +From avorontsov@ru.mvista.com Wed Jan 27 16:00:42 2010 +From: Anton Vorontsov <avorontsov@ru.mvista.com> +Date: Wed, 27 Jan 2010 17:09:38 +0300 +Subject: kfifo: Don't use integer as NULL pointer +To: Andrew Morton <akpm@linux-foundation.org> +Cc: Greg Kroah-Hartman <gregkh@suse.de>, Josh Boyer <jwboyer@gmail.com>, Stefani Seibold <stefani@seibold.net>, linuxppc-dev@ozlabs.org, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org +Message-ID: <20100127140938.GC31608@oksana.dev.rtsoft.ru> +Content-Disposition: inline + + +This patch fixes following sparse warnings: + +include/linux/kfifo.h:127:25: warning: Using plain integer as NULL pointer +kernel/kfifo.c:83:21: warning: Using plain integer as NULL pointer + +Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com> +Acked-by: Stefani Seibold <stefani@seibold.net> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + + +--- + include/linux/kfifo.h | 2 +- + kernel/kfifo.c | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +--- a/include/linux/kfifo.h ++++ b/include/linux/kfifo.h +@@ -124,7 +124,7 @@ extern __must_check unsigned int kfifo_o + */ + static inline bool kfifo_initialized(struct kfifo *fifo) + { +- return fifo->buffer != 0; ++ return fifo->buffer != NULL; + } + + /** +--- a/kernel/kfifo.c ++++ b/kernel/kfifo.c +@@ -80,7 +80,7 @@ int kfifo_alloc(struct kfifo *fifo, unsi + + buffer = kmalloc(size, gfp_mask); + if (!buffer) { +- _kfifo_init(fifo, 0, 0); ++ _kfifo_init(fifo, NULL, 0); + return -ENOMEM; + } + diff --git a/usb.current/kfifo-make-kfifo_initialized-work-after-kfifo_free.patch b/usb.current/kfifo-make-kfifo_initialized-work-after-kfifo_free.patch new file mode 100644 index 00000000000000..2121e50948e0a3 --- /dev/null +++ b/usb.current/kfifo-make-kfifo_initialized-work-after-kfifo_free.patch @@ -0,0 +1,35 @@ +From avorontsov@ru.mvista.com Wed Jan 27 15:59:32 2010 +From: Anton Vorontsov <avorontsov@ru.mvista.com> +Date: Wed, 27 Jan 2010 17:09:34 +0300 +Subject: kfifo: Make kfifo_initialized work after kfifo_free +To: Andrew Morton <akpm@linux-foundation.org> +Cc: Greg Kroah-Hartman <gregkh@suse.de>, Josh Boyer <jwboyer@gmail.com>, Stefani Seibold <stefani@seibold.net>, linuxppc-dev@ozlabs.org, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org +Message-ID: <20100127140934.GA31608@oksana.dev.rtsoft.ru> +Content-Disposition: inline + + +After kfifo rework it's no longer possible to reliably know if kfifo is +usable, since after kfifo_free(), kfifo_initialized() would still return +true. The correct behaviour is needed for at least FHCI USB driver. + +This patch fixes the issue by resetting the kfifo to zero values (the +same approach is used in kfifo_alloc() if allocation failed). + +Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com> +Acked-by: Stefani Seibold <stefani@seibold.net> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + kernel/kfifo.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/kernel/kfifo.c ++++ b/kernel/kfifo.c +@@ -97,6 +97,7 @@ EXPORT_SYMBOL(kfifo_alloc); + void kfifo_free(struct kfifo *fifo) + { + kfree(fifo->buffer); ++ _kfifo_init(fifo, NULL, 0); + } + EXPORT_SYMBOL(kfifo_free); + diff --git a/usb.current/usb-fhci-fix-build-after-kfifo-rework.patch b/usb.current/usb-fhci-fix-build-after-kfifo-rework.patch new file mode 100644 index 00000000000000..74db03f185fa1b --- /dev/null +++ b/usb.current/usb-fhci-fix-build-after-kfifo-rework.patch @@ -0,0 +1,61 @@ +From avorontsov@ru.mvista.com Wed Jan 27 15:59:56 2010 +From: Anton Vorontsov <avorontsov@ru.mvista.com> +Date: Wed, 27 Jan 2010 17:09:36 +0300 +Subject: USB: FHCI: Fix build after kfifo rework +To: Andrew Morton <akpm@linux-foundation.org> +Cc: Greg Kroah-Hartman <gregkh@suse.de>, Josh Boyer <jwboyer@gmail.com>, Stefani Seibold <stefani@seibold.net>, linuxppc-dev@ozlabs.org, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org +Message-ID: <20100127140936.GB31608@oksana.dev.rtsoft.ru> +Content-Disposition: inline + + +After kfifo rework FHCI fails to build: + + CC drivers/usb/host/fhci-tds.o +drivers/usb/host/fhci-tds.c: In function 'fhci_ep0_free': +drivers/usb/host/fhci-tds.c:108: error: used struct type value where scalar is required +drivers/usb/host/fhci-tds.c:118: error: used struct type value where scalar is required +drivers/usb/host/fhci-tds.c:128: error: used struct type value where scalar is required + +This is because kfifos are no longer pointers in the ep struct. +So, instead of checking the pointers, we should now check if kfifo +is initialized. + +Reported-by: Josh Boyer <jwboyer@gmail.com> +Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com> +Acked-by: Stefani Seibold <stefani@seibold.net> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + + +--- + drivers/usb/host/fhci-tds.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +--- a/drivers/usb/host/fhci-tds.c ++++ b/drivers/usb/host/fhci-tds.c +@@ -105,7 +105,7 @@ void fhci_ep0_free(struct fhci_usb *usb) + if (ep->td_base) + cpm_muram_free(cpm_muram_offset(ep->td_base)); + +- if (ep->conf_frame_Q) { ++ if (kfifo_initialized(&ep->conf_frame_Q)) { + size = cq_howmany(&ep->conf_frame_Q); + for (; size; size--) { + struct packet *pkt = cq_get(&ep->conf_frame_Q); +@@ -115,7 +115,7 @@ void fhci_ep0_free(struct fhci_usb *usb) + cq_delete(&ep->conf_frame_Q); + } + +- if (ep->empty_frame_Q) { ++ if (kfifo_initialized(&ep->empty_frame_Q)) { + size = cq_howmany(&ep->empty_frame_Q); + for (; size; size--) { + struct packet *pkt = cq_get(&ep->empty_frame_Q); +@@ -125,7 +125,7 @@ void fhci_ep0_free(struct fhci_usb *usb) + cq_delete(&ep->empty_frame_Q); + } + +- if (ep->dummy_packets_Q) { ++ if (kfifo_initialized(&ep->dummy_packets_Q)) { + size = cq_howmany(&ep->dummy_packets_Q); + for (; size; size--) { + u8 *buff = cq_get(&ep->dummy_packets_Q); |
