[PATCH 02/23] drm_agpsupport.c: drm_alloc + memset to drm_zalloc

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

 



Signed-off-by: Mariusz Kozlowski <[email protected]>

 drivers/char/drm/drm_agpsupport.c | 13896 -> 13828 (-68 bytes)
 drivers/char/drm/drm_agpsupport.o | 120046 -> 119814 (-232 bytes)

 drivers/char/drm/drm_agpsupport.c |   13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

--- linux-2.6.23-rc3-mm1.orig/drivers/char/drm/drm_agpsupport.c
+++ linux-2.6.23-rc3-mm1/drivers/char/drm/drm_agpsupport.c
@@ -216,10 +216,10 @@ int drm_agp_alloc(struct drm_device *dev

 	if (!dev->agp || !dev->agp->acquired)
 		return -EINVAL;
-	if (!(entry = drm_alloc(sizeof(*entry), DRM_MEM_AGPLISTS)))
-		return -ENOMEM;

-	memset(entry, 0, sizeof(*entry));
+	entry = drm_zalloc(sizeof(*entry), DRM_MEM_AGPLISTS);
+	if (!entry)
+		return -ENOMEM;

 	pages = (request->size + PAGE_SIZE - 1) / PAGE_SIZE;
 	type = (u32) request->type;
@@ -444,11 +444,12 @@ int drm_agp_free_ioctl(struct inode *ino
  */
 struct drm_agp_head *drm_agp_init(struct drm_device *dev)
 {
-	struct drm_agp_head *head = NULL;
+	struct drm_agp_head *head;

-	if (!(head = drm_alloc(sizeof(*head), DRM_MEM_AGPLISTS)))
+	head = drm_zalloc(sizeof(*head), DRM_MEM_AGPLISTS);
+	if (!head)
 		return NULL;
-	memset((void *)head, 0, sizeof(*head));
+
 	head->bridge = agp_find_bridge(dev->pdev);
 	if (!head->bridge) {
 		if (!(head->bridge = agp_backend_acquire(dev->pdev))) {

--
-
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/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux