Signed-off-by: Mariusz Kozlowski drivers/char/drm/mga_dma.c | 30418 -> 30253 (-165 bytes) drivers/char/drm/mga_dma.o | 140668 -> 140304 (-364 bytes) drivers/char/drm/mga_dma.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) --- linux-2.6.23-rc3-mm1.orig/drivers/char/drm/mga_dma.c +++ linux-2.6.23-rc3-mm1/drivers/char/drm/mga_dma.c @@ -254,23 +254,20 @@ static int mga_freelist_init(struct drm_ int i; DRM_DEBUG("count=%d\n", dma->buf_count); - dev_priv->head = drm_alloc(sizeof(drm_mga_freelist_t), DRM_MEM_DRIVER); - if (dev_priv->head == NULL) + dev_priv->head = drm_zalloc(sizeof(drm_mga_freelist_t), DRM_MEM_DRIVER); + if (!dev_priv->head) return DRM_ERR(ENOMEM); - memset(dev_priv->head, 0, sizeof(drm_mga_freelist_t)); SET_AGE(&dev_priv->head->age, MGA_BUFFER_USED, 0); for (i = 0; i < dma->buf_count; i++) { buf = dma->buflist[i]; buf_priv = buf->dev_private; - entry = drm_alloc(sizeof(drm_mga_freelist_t), DRM_MEM_DRIVER); - if (entry == NULL) + entry = drm_zalloc(sizeof(drm_mga_freelist_t), DRM_MEM_DRIVER); + if (!entry) return DRM_ERR(ENOMEM); - memset(entry, 0, sizeof(drm_mga_freelist_t)); - entry->next = dev_priv->head->next; entry->prev = dev_priv->head; SET_AGE(&entry->age, MGA_BUFFER_FREE, 0); @@ -397,12 +394,11 @@ int mga_driver_load(struct drm_device * { drm_mga_private_t *dev_priv; - dev_priv = drm_alloc(sizeof(drm_mga_private_t), DRM_MEM_DRIVER); + dev_priv = drm_zalloc(sizeof(drm_mga_private_t), DRM_MEM_DRIVER); if (!dev_priv) return DRM_ERR(ENOMEM); dev->dev_private = (void *)dev_priv; - memset(dev_priv, 0, sizeof(drm_mga_private_t)); dev_priv->usec_timeout = MGA_DEFAULT_USEC_TIMEOUT; dev_priv->chipset = flags; -- - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/