[Patch 06/16] This removes unnecessary kmalloc casts and corrects a test for kmalloc failure.

From: jack
Date: Tue Jul 31 2007 - 09:12:30 EST


Signed-off-by: Jack Stone <jack@xxxxxxxxxxxxxxxxxxxxxxx>

CC: Ronald Bultje <rbultje@xxxxxxxxxxxxxxxxxxx>

---
drivers/media/video/zoran_driver.c | 12 +++---------
1 file changed, 3 insertions(+), 9 deletions(-)

Index: b/drivers/media/video/zoran_driver.c
===================================================================
--- a/drivers/media/video/zoran_driver.c
+++ b/drivers/media/video/zoran_driver.c
@@ -347,11 +347,8 @@ v4l_fbuffer_alloc (struct file *file)
if (fh->v4l_buffers.buffer_size <= MAX_KMALLOC_MEM) {
/* Use kmalloc */

- mem =
- (unsigned char *) kmalloc(fh->v4l_buffers.
- buffer_size,
- GFP_KERNEL);
- if (mem == 0) {
+ mem = kmalloc(fh->v4l_buffers.buffer_size, GFP_KERNEL);
+ if (!mem) {
dprintk(1,
KERN_ERR
"%s: v4l_fbuffer_alloc() - kmalloc for V4L buf %d failed\n",
@@ -520,10 +517,7 @@ jpg_fbuffer_alloc (struct file *file)

//if (alloc_contig) {
if (fh->jpg_buffers.need_contiguous) {
- mem =
- (unsigned long) kmalloc(fh->jpg_buffers.
- buffer_size,
- GFP_KERNEL);
+ mem = kmalloc(fh->jpg_buffers.buffer_size, GFP_KERNEL);
if (mem == 0) {
dprintk(1,
KERN_ERR

--
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/