drm/radeon: remove boolean checks in if statements.
Subsystems (2)
PATCH 1/1 drm/radeon: remove boolean checks in if statements.
Remove unnecessary variable comparisions to true/false in if statements and check the value of the variable directly.
Signed-off-by Wambui Karuga <[email protected]>
--- drivers/gpu/drm/radeon/cik_sdma.c | 2 +- drivers/gpu/drm/radeon/r100.c | 2 +- drivers/gpu/drm/radeon/r600.c | 2 +- drivers/gpu/drm/radeon/radeon_bios.c | 12 ++++++------ drivers/gpu/drm/radeon/radeon_connectors.c | 4 ++-- drivers/gpu/drm/radeon/radeon_display.c | 4 ++-- drivers/gpu/drm/radeon/radeon_legacy_encoders.c | 4 ++-- drivers/gpu/drm/radeon/radeon_pm.c | 2 +- 8 files changed, 16 insertions(+), 16 deletions(-)
drivers/gpu/drm/radeon/cik_sdma.c +1 -1
@@ -333,7 +333,7 @@ void cik_sdma_enable(struct radeon_device *rdev, bool enable)u32 me_cntl, reg_offset;int i; -if (enable == false) { +if (!enable) {cik_sdma_gfx_stop (rdev);cik_sdma_rlc_stop (rdev); }
drivers/gpu/drm/radeon/r100.c +1 -1
@@ -2815,7 +2815,7 @@ void r100_vga_set_state(struct radeon_device *rdev, bool state)uint32_t temp; temp =RREG32 (RADEON_CONFIG_CNTL ); -if (state == false) { +if (!state) { temp &= ~RADEON_CFG_VGA_RAM_EN ; temp |=RADEON_CFG_VGA_IO_DIS ; }else {
drivers/gpu/drm/radeon/r600.c +1 -1
@@ -3191,7 +3191,7 @@ void r600_vga_set_state(struct radeon_device *rdev, bool state)uint32_t temp; temp =RREG32 (CONFIG_CNTL ); -if (state == false) { +if (!state) { temp &= ~(1 <<0 ); temp |= (1 <<1 ); }else {
drivers/gpu/drm/radeon/radeon_bios.c +6 -6
@@ -664,17 +664,17 @@ bool radeon_get_bios(struct radeon_device *rdev)uint16_t tmp; r =radeon_atrm_get_bios (rdev); -if (r == false) +if (!r) r =radeon_acpi_vfct_bios (rdev); -if (r == false) +if (!r) r =igp_read_bios_from_vram (rdev); -if (r == false) +if (!r) r =radeon_read_bios (rdev); -if (r == false) +if (!r) r =radeon_read_disabled_bios (rdev); -if (r == false) +if (!r) r =radeon_read_platform_bios (rdev); -if (r == false || rdev->bios ==NULL ) { +if (!r || rdev->bios ==NULL ) {DRM_ERROR ("Unable to locate a BIOS ROM\n" ); rdev->bios =NULL ;return false;
drivers/gpu/drm/radeon/radeon_connectors.c +2 -2
@@ -440,7 +440,7 @@ radeon_connector_analog_encoder_conflict_solve(struct drm_connector *connector,if (radeon_conflict->use_digital)continue ; -if (priority == true) { +if (priority) {DRM_DEBUG_KMS ("1: conflicting encoders switching off %s\n" , conflict->name); DRM_DEBUG_KMS("in favor of %s\n",
@@ -700,7 +700,7 @@ static int radeon_connector_set_property(struct drm_connector *connector, structelse ret =radeon_legacy_get_tmds_info_from_combios (radeon_encoder, tmds); } -if (val ==1 || ret == false) { +if (val ==1 || !ret) {radeon_legacy_get_tmds_info_from_table (radeon_encoder, tmds); }radeon_property_change_mode (&radeon_encoder->base);
drivers/gpu/drm/radeon/radeon_display.c +2 -2
@@ -847,11 +847,11 @@ static bool radeon_setup_enc_conn(struct drm_device *dev)if (rdev->bios) {if (rdev->is_atom_bios) { ret =radeon_get_atom_connector_info_from_supported_devices_table (dev); -if (ret == false) +if (!ret) ret =radeon_get_atom_connector_info_from_object_table (dev); }else { ret =radeon_get_legacy_connector_info_from_bios (dev); -if (ret == false) +if (!ret) ret =radeon_get_legacy_connector_info_from_table (dev); } }else {
drivers/gpu/drm/radeon/radeon_legacy_encoders.c +2 -2
@@ -1712,7 +1712,7 @@ static struct radeon_encoder_int_tmds *radeon_legacy_get_tmds_info(struct radeonelse ret =radeon_legacy_get_tmds_info_from_combios (encoder, tmds); -if (ret == false) +if (!ret)radeon_legacy_get_tmds_info_from_table (encoder, tmds);return tmds;
@@ -1735,7 +1735,7 @@ static struct radeon_encoder_ext_tmds *radeon_legacy_get_ext_tmds_info(struct ra ret =radeon_legacy_get_ext_tmds_info_from_combios (encoder, tmds); -if (ret == false) +if (!ret)radeon_legacy_get_ext_tmds_info_from_table (encoder, tmds);return tmds;
drivers/gpu/drm/radeon/radeon_pm.c +1 -1
@@ -1789,7 +1789,7 @@ static bool radeon_pm_debug_check_in_vbl(struct radeon_device *rdev, bool finishu32 stat_crtc =0 ;bool in_vbl =radeon_pm_in_vbl (rdev); -if (in_vbl == false) +if (!in_vbl)DRM_DEBUG_DRIVER ("not in vbl for pm change %08x at %s\n" , stat_crtc, finish ?"exit" :"entry" );return in_vbl;
Signature · 1 line
2.17.1
Alex Deucher
AppliedQuoted 5 lines · Wambui Karuga
Remove unnecessary variable comparisions to true/false in if statements and check the value of the variable directly.
Signed-off-by Wambui Karuga <[email protected]>
Applied. Thanks!
Alex
Quoted 156 lines
--- drivers/gpu/drm/radeon/cik_sdma.c | 2 +- drivers/gpu/drm/radeon/r100.c | 2 +- drivers/gpu/drm/radeon/r600.c | 2 +- drivers/gpu/drm/radeon/radeon_bios.c | 12 ++++++------ drivers/gpu/drm/radeon/radeon_connectors.c | 4 ++-- drivers/gpu/drm/radeon/radeon_display.c | 4 ++-- drivers/gpu/drm/radeon/radeon_legacy_encoders.c | 4 ++-- drivers/gpu/drm/radeon/radeon_pm.c | 2 +- 8 files changed, 16 insertions(+), 16 deletions(-)drivers/gpu/drm/radeon/cik_sdma.c +1
-1@@ -333,7 +333,7 @@ void cik_sdma_enable(struct radeon_device *rdev, bool enable)u32 me_cntl, reg_offset;int i; -if (enable == false) { +if (!enable) {cik_sdma_gfx_stop (rdev);cik_sdma_rlc_stop (rdev); }drivers/gpu/drm/radeon/r100.c +1
-1@@ -2815,7 +2815,7 @@ void r100_vga_set_state(struct radeon_device *rdev, bool state)uint32_t temp; temp =RREG32 (RADEON_CONFIG_CNTL ); -if (state == false) { +if (!state) { temp &= ~RADEON_CFG_VGA_RAM_EN ; temp |=RADEON_CFG_VGA_IO_DIS ; }else {drivers/gpu/drm/radeon/r600.c +1
-1@@ -3191,7 +3191,7 @@ void r600_vga_set_state(struct radeon_device *rdev, bool state)uint32_t temp; temp =RREG32 (CONFIG_CNTL ); -if (state == false) { +if (!state) { temp &= ~(1 <<0 ); temp |= (1 <<1 ); }else {drivers/gpu/drm/radeon/radeon_bios.c +6
-6@@ -664,17 +664,17 @@ bool radeon_get_bios(struct radeon_device *rdev)uint16_t tmp; r =radeon_atrm_get_bios (rdev); -if (r == false) +if (!r) r =radeon_acpi_vfct_bios (rdev); -if (r == false) +if (!r) r =igp_read_bios_from_vram (rdev); -if (r == false) +if (!r) r =radeon_read_bios (rdev); -if (r == false) +if (!r) r =radeon_read_disabled_bios (rdev); -if (r == false) +if (!r) r =radeon_read_platform_bios (rdev); -if (r == false || rdev->bios ==NULL ) { +if (!r || rdev->bios ==NULL ) {DRM_ERROR ("Unable to locate a BIOS ROM\n" ); rdev->bios =NULL ;return false;drivers/gpu/drm/radeon/radeon_connectors.c +2
-2@@ -440,7 +440,7 @@ radeon_connector_analog_encoder_conflict_solve(struct drm_connector *connector,if (radeon_conflict->use_digital)continue ; -if (priority == true) { +if (priority) {DRM_DEBUG_KMS ("1: conflicting encoders switching off %s\n" , conflict->name); DRM_DEBUG_KMS("in favor of %s\n",@@ -700,7 +700,7 @@ static int radeon_connector_set_property(struct drm_connector *connector, structelse ret =radeon_legacy_get_tmds_info_from_combios (radeon_encoder, tmds); } -if (val ==1 || ret == false) { +if (val ==1 || !ret) {radeon_legacy_get_tmds_info_from_table (radeon_encoder, tmds); }radeon_property_change_mode (&radeon_encoder->base);drivers/gpu/drm/radeon/radeon_display.c +2
-2@@ -847,11 +847,11 @@ static bool radeon_setup_enc_conn(struct drm_device *dev)if (rdev->bios) {if (rdev->is_atom_bios) { ret =radeon_get_atom_connector_info_from_supported_devices_table (dev); -if (ret == false) +if (!ret) ret =radeon_get_atom_connector_info_from_object_table (dev); }else { ret =radeon_get_legacy_connector_info_from_bios (dev); -if (ret == false) +if (!ret) ret =radeon_get_legacy_connector_info_from_table (dev); } }else {drivers/gpu/drm/radeon/radeon_legacy_encoders.c +2
-2@@ -1712,7 +1712,7 @@ static struct radeon_encoder_int_tmds *radeon_legacy_get_tmds_info(struct radeonelse ret =radeon_legacy_get_tmds_info_from_combios (encoder, tmds); -if (ret == false) +if (!ret)radeon_legacy_get_tmds_info_from_table (encoder, tmds);return tmds;@@ -1735,7 +1735,7 @@ static struct radeon_encoder_ext_tmds *radeon_legacy_get_ext_tmds_info(struct ra ret =radeon_legacy_get_ext_tmds_info_from_combios (encoder, tmds); -if (ret == false) +if (!ret)radeon_legacy_get_ext_tmds_info_from_table (encoder, tmds);return tmds;drivers/gpu/drm/radeon/radeon_pm.c +1
-2@@ -1789,7 +1789,7 @@ static bool radeon_pm_debug_check_in_vbl(struct radeon_device *rdev, bool finishu32 stat_crtc =0 ;bool in_vbl =radeon_pm_in_vbl (rdev); -if (in_vbl == false) +if (!in_vbl)DRM_DEBUG_DRIVER ("not in vbl for pm change %08x at %s\n" , stat_crtc, finish ?"exit" :"entry" );return in_vbl; --2.17.1
Quoted 4 lines
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel