Re: [PATCH] drm/radeon: remove unnecessary braces around conditionals.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Jan 3, 2020 at 2:34 PM Wambui Karuga <wambui.karugax@xxxxxxxxx> wrote:
>
> 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@xxxxxxxxx>

Applied. thanks!

Alex

> ---
>  drivers/gpu/drm/radeon/atombios_crtc.c     |  3 +--
>  drivers/gpu/drm/radeon/atombios_dp.c       |  3 +--
>  drivers/gpu/drm/radeon/atombios_encoders.c |  9 ++++-----
>  drivers/gpu/drm/radeon/radeon_connectors.c |  4 ++--
>  drivers/gpu/drm/radeon/radeon_vce.c        |  4 ++--
>  drivers/gpu/drm/radeon/radeon_vm.c         | 16 ++++++++--------
>  6 files changed, 18 insertions(+), 21 deletions(-)
>
> diff --git a/drivers/gpu/drm/radeon/atombios_crtc.c b/drivers/gpu/drm/radeon/atombios_crtc.c
> index da2c9e295408..be583695427a 100644
> --- a/drivers/gpu/drm/radeon/atombios_crtc.c
> +++ b/drivers/gpu/drm/radeon/atombios_crtc.c
> @@ -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)
> diff --git a/drivers/gpu/drm/radeon/atombios_dp.c b/drivers/gpu/drm/radeon/atombios_dp.c
> index 6f38375c77c8..39b342b5c495 100644
> --- a/drivers/gpu/drm/radeon/atombios_dp.c
> +++ b/drivers/gpu/drm/radeon/atombios_dp.c
> @@ -816,9 +816,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;
> diff --git a/drivers/gpu/drm/radeon/atombios_encoders.c b/drivers/gpu/drm/radeon/atombios_encoders.c
> index 2a7be5d5e7e6..cc5ee1b3af84 100644
> --- a/drivers/gpu/drm/radeon/atombios_encoders.c
> +++ b/drivers/gpu/drm/radeon/atombios_encoders.c
> @@ -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 @@ int radeon_atom_pick_dig_encoder(struct drm_encoder *encoder, int fe_idx)
>                 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;
>  }
> diff --git a/drivers/gpu/drm/radeon/radeon_connectors.c b/drivers/gpu/drm/radeon/radeon_connectors.c
> index 90d2f732affb..fe12d9d91d7a 100644
> --- a/drivers/gpu/drm/radeon/radeon_connectors.c
> +++ b/drivers/gpu/drm/radeon/radeon_connectors.c
> @@ -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);
>         }
>
> diff --git a/drivers/gpu/drm/radeon/radeon_vce.c b/drivers/gpu/drm/radeon/radeon_vce.c
> index 59db54ace428..5e8006444704 100644
> --- a/drivers/gpu/drm/radeon/radeon_vce.c
> +++ b/drivers/gpu/drm/radeon/radeon_vce.c
> @@ -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);
> diff --git a/drivers/gpu/drm/radeon/radeon_vm.c b/drivers/gpu/drm/radeon/radeon_vm.c
> index e0ad547786e8..f60fae0aed11 100644
> --- a/drivers/gpu/drm/radeon/radeon_vm.c
> +++ b/drivers/gpu/drm/radeon/radeon_vm.c
> @@ -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);
> --
> 2.17.1
>
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@xxxxxxxxxxxxxxxxxxxxx
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
amd-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/amd-gfx



[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux