OSDN Git Service

freedreno/msm: fix c90 warning
authorRob Clark <robclark@freedesktop.org>
Sun, 14 Oct 2018 15:23:17 +0000 (11:23 -0400)
committerRob Clark <robclark@freedesktop.org>
Sun, 14 Oct 2018 15:23:17 +0000 (11:23 -0400)
Wasn't really sure how to switch the silly -Wdeclaration-after-statement
flag off on a per directory basis.  So make the code uglier instead.

freedreno/msm/msm_ringbuffer.c

index 594c2ba..475c65d 100644 (file)
@@ -486,6 +486,7 @@ static int msm_ringbuffer_flush(struct fd_ringbuffer *ring, uint32_t *last_start
        for (i = 0; i < msm_ring->submit.nr_cmds; i++) {
                struct msm_cmd *msm_cmd = msm_ring->cmds[i];
                struct drm_msm_gem_submit_reloc *relocs = msm_cmd->relocs;
+               struct drm_msm_gem_submit_cmd *cmd;
                unsigned nr_relocs = msm_cmd->nr_relocs;
 
                /* for reusable stateobjs, the reloc table has reloc_idx that
@@ -499,7 +500,7 @@ static int msm_ringbuffer_flush(struct fd_ringbuffer *ring, uint32_t *last_start
                                        relocs, nr_relocs);
                }
 
-               struct drm_msm_gem_submit_cmd *cmd = &msm_ring->submit.cmds[i];
+               cmd = &msm_ring->submit.cmds[i];
                cmd->relocs = VOID2U64(relocs);
                cmd->nr_relocs = nr_relocs;
        }