This patch does the conversion of drm_alloc + memset to drm_zalloc.
The memset in loop is also superfluous and can be removed.

Signed-off-by: Mariusz Kozlowski <[EMAIL PROTECTED]>

 drivers/char/drm/drm_dma.c | 4624 -> 4475 (-149 bytes)
 drivers/char/drm/drm_dma.o | 104277 -> 103917 (-360 bytes)

 drivers/char/drm/drm_dma.c |    9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

--- linux-2.6.23-rc3-mm1.orig/drivers/char/drm/drm_dma.c
+++ linux-2.6.23-rc3-mm1/drivers/char/drm/drm_dma.c
@@ -45,17 +45,10 @@
  */
 int drm_dma_setup(struct drm_device *dev)
 {
-       int i;
-
-       dev->dma = drm_alloc(sizeof(*dev->dma), DRM_MEM_DRIVER);
+       dev->dma = drm_zalloc(sizeof(*dev->dma), DRM_MEM_DRIVER);
        if (!dev->dma)
                return -ENOMEM;

-       memset(dev->dma, 0, sizeof(*dev->dma));
-
-       for (i = 0; i <= DRM_MAX_ORDER; i++)
-               memset(&dev->dma->bufs[i], 0, sizeof(dev->dma->bufs[0]));
-
        return 0;
 }

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

Reply via email to