Skip to contentSkip to conversation

drm/radeon: remove some dead code

PATCH Applied Dan Carpenter 3 participants 3 messages Feb 7, 2017 – Feb 9, 2017

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/radeon: remove some dead code

If "rdev->bios" is NULL then we don't need to free it.

drivers/gpu/drm/radeon/radeon_bios.c +1 -3
index 00cfb5d2875f..04c0ed41374f 100644
@@ -638,10 +638,8 @@ static bool radeon_acpi_vfct_bios(struct radeon_device *rdev)
 					     vhdr->ImageLength,
 					     GFP_KERNEL);
 
-			if (!rdev->bios) {
-				kfree(rdev->bios);
+			if (!rdev->bios)
 				return false;
-			}
 			return true;
 		}
 	}
Reviewed-by on v1 1/1
#1 lore raw
Quoted 9 lines · Dan Carpenter

If "rdev->bios" is NULL then we don't need to free it.

drivers/gpu/drm/radeon/radeon_bios.c +0 -0
index 00cfb5d2875f..04c0ed41374f 100644

drivers/gpu/drm/radeon/radeon_bios.c static bool radeon_acpi_vfct_bios(struct radeon_device *rdev) · line 643

Quoted 9 lines
drivers/gpu/drm/radeon/radeon_bios.c +1 -3
@@ -638,10 +638,8 @@ static bool radeon_acpi_vfct_bios(struct radeon_device *rdev)
 					     vhdr->ImageLength,
 					     GFP_KERNEL);
 
-			if (!rdev->bios) {
-				kfree(rdev->bios);
+			if (!rdev->bios)
 				return false;
-			}
 			return true;

Could be simplified further to

			return rdev->bios != NULL;

or maybe

			return !!rdev->bios;

Either way,

Signature · 6 lines
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Applied
#2 lore raw
In reply to Dan Carpenter
Quoted 3 lines · Dan Carpenter

If "rdev->bios" is NULL then we don't need to free it.

applied. thanks!

Quoted 17 lines
drivers/gpu/drm/radeon/radeon_bios.c +1 -3
index 00cfb5d2875f..04c0ed41374f 100644
@@ -638,10 +638,8 @@ static bool radeon_acpi_vfct_bios(struct radeon_device *rdev)
                                             vhdr->ImageLength,
                                             GFP_KERNEL);
 
-                       if (!rdev->bios) {
-                               kfree(rdev->bios);
+                       if (!rdev->bios)
                                return false;
-                       }
                        return true;
                }
        }
Quoted 4 lines

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx