Skip to contentSkip to conversation

drm/bridge/analogix: remove redundant when devm_kzalloc failed

PATCH In review Bernard Zhao 2 participants 2 messages Feb 2, 2021 – Feb 4, 2021

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

PATCH 1/1 drm/bridge/analogix: remove redundant when devm_kzalloc failed

Line 1590 DRM_ERROR is redundant because devm_kzalloc() already prints an error.

---
 drivers/gpu/drm/bridge/analogix/analogix_dp_core.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/gpu/drm/bridge/analogix/analogix_dp_core.c +1 -3
index aa1bb86293fd..8f6258eb9960 100644
@@ -1586,10 +1586,8 @@ static int analogix_dp_create_bridge(struct drm_device *drm_dev,
 	int ret;
 
 	bridge = devm_kzalloc(drm_dev->dev, sizeof(*bridge), GFP_KERNEL);
-	if (!bridge) {
-		DRM_ERROR("failed to allocate for drm bridge\n");
+	if (!bridge)
 		return -ENOMEM;
-	}
 
 	dp->bridge = bridge;
 
Signature · 1 line
2.29.0
Reviewed-by on v1 1/1
#1 lore raw

Hey Bernard,

Thanks for the patch.

With the below fixed, feel free to add my r-b.

Quoted 3 lines · Bernard Zhao

Line 1590 DRM_ERROR is redundant because devm_kzalloc() already prints an error.

The line number will not be so helpful for reading this commit message in the future, so remove it and maybe just refer to DRM_ERROR being removed.

Quoted 25 lines
---
 drivers/gpu/drm/bridge/analogix/analogix_dp_core.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/gpu/drm/bridge/analogix/analogix_dp_core.c +1 -4
index aa1bb86293fd..8f6258eb9960 100644
@@ -1586,10 +1586,8 @@ static int analogix_dp_create_bridge(struct drm_device *drm_dev,
        int ret;
 
        bridge = devm_kzalloc(drm_dev->dev, sizeof(*bridge), GFP_KERNEL);
-       if (!bridge) {
-               DRM_ERROR("failed to allocate for drm bridge\n");
+       if (!bridge)
                return -ENOMEM;
-       }
 
        dp->bridge = bridge;
 
--

2.29.0