- drivers-media-video-videobuf-dma-sgc-avoid-clearing-memory-twice.patch removed from -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled
     drivers/media/video/videobuf-dma-sg.c: avoid clearing memory twice
has been removed from the -mm tree.  Its filename was
     drivers-media-video-videobuf-dma-sgc-avoid-clearing-memory-twice.patch

This patch was dropped because it was merged into mainline or a subsystem tree

The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/

------------------------------------------------------
Subject: drivers/media/video/videobuf-dma-sg.c: avoid clearing memory twice
From: Christophe Jaillet <jaillet.christophe@xxxxxxxxxx>

1) Remove a useless initialisation of 'i'

2) Avoid clearing the memory allocated twice (once in 'kcalloc', once
   in 'sg_init_table')

3) Remove a test that can never trigger.  The function returns NULL in
   such a case, so we know that at this point 'pages[0]' != NULL

Signed-off-by: Christophe Jaillet <jaillet.christophe@xxxxxxxxxx>
Cc: Mauro Carvalho Chehab <mchehab@xxxxxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 drivers/media/video/videobuf-dma-sg.c |    6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff -puN drivers/media/video/videobuf-dma-sg.c~drivers-media-video-videobuf-dma-sgc-avoid-clearing-memory-twice drivers/media/video/videobuf-dma-sg.c
--- a/drivers/media/video/videobuf-dma-sg.c~drivers-media-video-videobuf-dma-sgc-avoid-clearing-memory-twice
+++ a/drivers/media/video/videobuf-dma-sg.c
@@ -80,17 +80,15 @@ struct scatterlist*
 videobuf_pages_to_sg(struct page **pages, int nr_pages, int offset)
 {
 	struct scatterlist *sglist;
-	int i = 0;
+	int i;
 
 	if (NULL == pages[0])
 		return NULL;
-	sglist = kcalloc(nr_pages, sizeof(*sglist), GFP_KERNEL);
+	sglist = kmalloc(nr_pages * sizeof(*sglist), GFP_KERNEL);
 	if (NULL == sglist)
 		return NULL;
 	sg_init_table(sglist, nr_pages);
 
-	if (NULL == pages[0])
-		goto nopage;
 	if (PageHighMem(pages[0]))
 		/* DMA to highmem pages might not work */
 		goto highmem;
_

Patches currently in -mm which might be from jaillet.christophe@xxxxxxxxxx are

linux-next.patch

--
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux