drm/radeon: remove unnecessary braces around conditionals.
authorWambui Karuga <wambui.karugax@gmail.com>
Fri, 3 Jan 2020 13:20:35 +0000 (16:20 +0300)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 7 Jan 2020 17:04:13 +0000 (12:04 -0500)
As single statement conditionals do not need to be wrapped around
braces, the unnecessary braces can be removed.

Signed-off-by: Wambui Karuga <wambui.karugax@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/radeon/atombios_crtc.c
drivers/gpu/drm/radeon/atombios_dp.c
drivers/gpu/drm/radeon/atombios_encoders.c
drivers/gpu/drm/radeon/radeon_connectors.c
drivers/gpu/drm/radeon/radeon_vce.c
drivers/gpu/drm/radeon/radeon_vm.c

index da2c9e2954086aa8a4d328ba64281ebece721cf9..be583695427ad24bd99ce181e6dc0cc9422eee5e 100644 (file)
@@ -244,9 +244,8 @@ static void atombios_blank_crtc(struct drm_crtc *crtc, int state)
 
        atom_execute_table(rdev->mode_info.atom_context, index, (uint32_t *)&args);
 
-       if (ASIC_IS_DCE8(rdev)) {
+       if (ASIC_IS_DCE8(rdev))
                WREG32(vga_control_regs[radeon_crtc->crtc_id], vga_control);
-       }
 }
 
 static void atombios_powergate_crtc(struct drm_crtc *crtc, int state)
index 911735f8d5de32526fe6f6aff46ac458bbe5fb25..15b00a347560294ec7d1da9ca1023134ab87991e 100644 (file)
@@ -813,9 +813,8 @@ void radeon_dp_link_train(struct drm_encoder *encoder,
        dp_info.use_dpencoder = true;
        index = GetIndexIntoMasterTable(COMMAND, DPEncoderService);
        if (atom_parse_cmd_header(rdev->mode_info.atom_context, index, &frev, &crev)) {
-               if (crev > 1) {
+               if (crev > 1)
                        dp_info.use_dpencoder = false;
-               }
        }
 
        dp_info.enc_id = 0;
index 2a7be5d5e7e6403eb2f4266e79b5fa6a4be83ab2..cc5ee1b3af84f27462ddcaf64b33d20ceab3c96a 100644 (file)
@@ -1885,11 +1885,10 @@ atombios_set_encoder_crtc_source(struct drm_encoder *encoder)
                        if (ASIC_IS_AVIVO(rdev))
                                args.v1.ucCRTC = radeon_crtc->crtc_id;
                        else {
-                               if (radeon_encoder->encoder_id == ENCODER_OBJECT_ID_INTERNAL_DAC1) {
+                               if (radeon_encoder->encoder_id == ENCODER_OBJECT_ID_INTERNAL_DAC1)
                                        args.v1.ucCRTC = radeon_crtc->crtc_id;
-                               } else {
+                               else
                                        args.v1.ucCRTC = radeon_crtc->crtc_id << 2;
-                               }
                        }
                        switch (radeon_encoder->encoder_id) {
                        case ENCODER_OBJECT_ID_INTERNAL_TMDS1:
@@ -2234,9 +2233,9 @@ assigned:
                DRM_ERROR("Got encoder index incorrect - returning 0\n");
                return 0;
        }
-       if (rdev->mode_info.active_encoders & (1 << enc_idx)) {
+       if (rdev->mode_info.active_encoders & (1 << enc_idx))
                DRM_ERROR("chosen encoder in use %d\n", enc_idx);
-       }
+
        rdev->mode_info.active_encoders |= (1 << enc_idx);
        return enc_idx;
 }
index 90d2f732affb6db37d06b83f43c54dca1f6805b5..fe12d9d91d7a586d6eb5ffe0f596ee7a6532863b 100644 (file)
@@ -700,9 +700,9 @@ static int radeon_connector_set_property(struct drm_connector *connector, struct
                        else
                                ret = radeon_legacy_get_tmds_info_from_combios(radeon_encoder, tmds);
                }
-               if (val == 1 || !ret) {
+               if (val == 1 || !ret)
                        radeon_legacy_get_tmds_info_from_table(radeon_encoder, tmds);
-               }
+
                radeon_property_change_mode(&radeon_encoder->base);
        }
 
index 59db54ace428d883c458a5ed1a3e52456ade7c86..5e80064447046961e12f7da226a53ddacf82ef59 100644 (file)
@@ -388,9 +388,9 @@ int radeon_vce_get_create_msg(struct radeon_device *rdev, int ring,
                ib.ptr[i] = cpu_to_le32(0x0);
 
        r = radeon_ib_schedule(rdev, &ib, NULL, false);
-       if (r) {
+       if (r)
                DRM_ERROR("radeon: failed to schedule ib (%d).\n", r);
-       }
+
 
        if (fence)
                *fence = radeon_fence_ref(ib.fence);
index e0ad547786e89c8029da32b8b6bb73db2bd98707..f60fae0aed11b96a7191bfa7e2875934cdb44819 100644 (file)
@@ -296,9 +296,9 @@ struct radeon_bo_va *radeon_vm_bo_find(struct radeon_vm *vm,
        struct radeon_bo_va *bo_va;
 
        list_for_each_entry(bo_va, &bo->va, bo_list) {
-               if (bo_va->vm == vm) {
+               if (bo_va->vm == vm)
                        return bo_va;
-               }
+
        }
        return NULL;
 }
@@ -323,9 +323,9 @@ struct radeon_bo_va *radeon_vm_bo_add(struct radeon_device *rdev,
        struct radeon_bo_va *bo_va;
 
        bo_va = kzalloc(sizeof(struct radeon_bo_va), GFP_KERNEL);
-       if (bo_va == NULL) {
+       if (bo_va == NULL)
                return NULL;
-       }
+
        bo_va->vm = vm;
        bo_va->bo = bo;
        bo_va->it.start = 0;
@@ -947,9 +947,9 @@ int radeon_vm_bo_update(struct radeon_device *rdev,
 
        if (mem) {
                addr = (u64)mem->start << PAGE_SHIFT;
-               if (mem->mem_type != TTM_PL_SYSTEM) {
+               if (mem->mem_type != TTM_PL_SYSTEM)
                        bo_va->flags |= RADEON_VM_PAGE_VALID;
-               }
+
                if (mem->mem_type == TTM_PL_TT) {
                        bo_va->flags |= RADEON_VM_PAGE_SYSTEM;
                        if (!(bo_va->bo->flags & (RADEON_GEM_GTT_WC | RADEON_GEM_GTT_UC)))
@@ -1233,9 +1233,9 @@ void radeon_vm_fini(struct radeon_device *rdev, struct radeon_vm *vm)
        struct radeon_bo_va *bo_va, *tmp;
        int i, r;
 
-       if (!RB_EMPTY_ROOT(&vm->va.rb_root)) {
+       if (!RB_EMPTY_ROOT(&vm->va.rb_root))
                dev_err(rdev->dev, "still active bo inside vm\n");
-       }
+
        rbtree_postorder_for_each_entry_safe(bo_va, tmp,
                                             &vm->va.rb_root, it.rb) {
                interval_tree_remove(&bo_va->it, &vm->va);