diff mbox series

drm/radeon: simplify if-if to if-else

Message ID 20220401025930.16365-1-guozhengkui@vivo.com (mailing list archive)
State New, archived
Headers show
Series drm/radeon: simplify if-if to if-else | expand

Commit Message

Guo Zhengkui April 1, 2022, 2:59 a.m. UTC
Replace `if (!ret)` with `else` for simplification.

Signed-off-by: Guo Zhengkui <guozhengkui@vivo.com>
---
 drivers/gpu/drm/radeon/radeon_pm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Alex Deucher April 5, 2022, 1:23 p.m. UTC | #1
Applied.  Thanks!

Alex

On Thu, Mar 31, 2022 at 11:00 PM Guo Zhengkui <guozhengkui@vivo.com> wrote:
>
> Replace `if (!ret)` with `else` for simplification.
>
> Signed-off-by: Guo Zhengkui <guozhengkui@vivo.com>
> ---
>  drivers/gpu/drm/radeon/radeon_pm.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/radeon/radeon_pm.c b/drivers/gpu/drm/radeon/radeon_pm.c
> index c67b6ddb29a4..e765abcb3b01 100644
> --- a/drivers/gpu/drm/radeon/radeon_pm.c
> +++ b/drivers/gpu/drm/radeon/radeon_pm.c
> @@ -1629,7 +1629,7 @@ int radeon_pm_late_init(struct radeon_device *rdev)
>                         ret = device_create_file(rdev->dev, &dev_attr_power_method);
>                         if (ret)
>                                 DRM_ERROR("failed to create device file for power method\n");
> -                       if (!ret)
> +                       else
>                                 rdev->pm.sysfs_initialized = true;
>                 }
>         }
> --
> 2.20.1
>
diff mbox series

Patch

diff --git a/drivers/gpu/drm/radeon/radeon_pm.c b/drivers/gpu/drm/radeon/radeon_pm.c
index c67b6ddb29a4..e765abcb3b01 100644
--- a/drivers/gpu/drm/radeon/radeon_pm.c
+++ b/drivers/gpu/drm/radeon/radeon_pm.c
@@ -1629,7 +1629,7 @@  int radeon_pm_late_init(struct radeon_device *rdev)
 			ret = device_create_file(rdev->dev, &dev_attr_power_method);
 			if (ret)
 				DRM_ERROR("failed to create device file for power method\n");
-			if (!ret)
+			else
 				rdev->pm.sysfs_initialized = true;
 		}
 	}