[Mesa-dev] [PATCH mesa] i965: drop duplicate assignments

Eric Engestrom eric.engestrom at intel.com
Thu Aug 16 15:00:16 UTC 2018


These are all already assigned when declared, a few lines above.

Signed-off-by: Eric Engestrom <eric.engestrom at intel.com>
---
Note: I'm not 100% certain the value can never change by the time this
second assignment is done, so maybe it's the initial one that should be
dropped?
---
 src/mesa/drivers/dri/i965/brw_cs.c  | 1 -
 src/mesa/drivers/dri/i965/brw_gs.c  | 1 -
 src/mesa/drivers/dri/i965/brw_tcs.c | 1 -
 src/mesa/drivers/dri/i965/brw_tes.c | 1 -
 src/mesa/drivers/dri/i965/brw_vs.c  | 1 -
 src/mesa/drivers/dri/i965/brw_wm.c  | 1 -
 6 files changed, 6 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_cs.c b/src/mesa/drivers/dri/i965/brw_cs.c
index 498c80d46a529db87cd3..a1ad3ad3436058e246c2 100644
--- a/src/mesa/drivers/dri/i965/brw_cs.c
+++ b/src/mesa/drivers/dri/i965/brw_cs.c
@@ -176,7 +176,6 @@ brw_upload_cs_prog(struct brw_context *brw)
    if (brw_disk_cache_upload_program(brw, MESA_SHADER_COMPUTE))
       return;
 
-   cp = (struct brw_program *) brw->programs[MESA_SHADER_COMPUTE];
    cp->id = key.program_string_id;
 
    MAYBE_UNUSED bool success = brw_codegen_cs_prog(brw, cp, &key);
diff --git a/src/mesa/drivers/dri/i965/brw_gs.c b/src/mesa/drivers/dri/i965/brw_gs.c
index 7263f6351e92847d603d..186a8946699bd0498b73 100644
--- a/src/mesa/drivers/dri/i965/brw_gs.c
+++ b/src/mesa/drivers/dri/i965/brw_gs.c
@@ -200,7 +200,6 @@ brw_upload_gs_prog(struct brw_context *brw)
    if (brw_disk_cache_upload_program(brw, MESA_SHADER_GEOMETRY))
       return;
 
-   gp = (struct brw_program *) brw->programs[MESA_SHADER_GEOMETRY];
    gp->id = key.program_string_id;
 
    MAYBE_UNUSED bool success = brw_codegen_gs_prog(brw, gp, &key);
diff --git a/src/mesa/drivers/dri/i965/brw_tcs.c b/src/mesa/drivers/dri/i965/brw_tcs.c
index 53611144ff5098060c68..9332e10f76814d7ad24f 100644
--- a/src/mesa/drivers/dri/i965/brw_tcs.c
+++ b/src/mesa/drivers/dri/i965/brw_tcs.c
@@ -345,7 +345,6 @@ brw_upload_tcs_prog(struct brw_context *brw)
    if (brw_disk_cache_upload_program(brw, MESA_SHADER_TESS_CTRL))
       return;
 
-   tcp = (struct brw_program *) brw->programs[MESA_SHADER_TESS_CTRL];
    if (tcp)
       tcp->id = key.program_string_id;
 
diff --git a/src/mesa/drivers/dri/i965/brw_tes.c b/src/mesa/drivers/dri/i965/brw_tes.c
index b3220a947415ed2e7efc..ace1629e6ace8d9ba4c7 100644
--- a/src/mesa/drivers/dri/i965/brw_tes.c
+++ b/src/mesa/drivers/dri/i965/brw_tes.c
@@ -203,7 +203,6 @@ brw_upload_tes_prog(struct brw_context *brw)
    if (brw_disk_cache_upload_program(brw, MESA_SHADER_TESS_EVAL))
       return;
 
-   tep = (struct brw_program *) brw->programs[MESA_SHADER_TESS_EVAL];
    tep->id = key.program_string_id;
 
    MAYBE_UNUSED bool success = brw_codegen_tes_prog(brw, tep, &key);
diff --git a/src/mesa/drivers/dri/i965/brw_vs.c b/src/mesa/drivers/dri/i965/brw_vs.c
index 69c0046bbb98c7b283ee..7ffd6bfc482f4e45d81f 100644
--- a/src/mesa/drivers/dri/i965/brw_vs.c
+++ b/src/mesa/drivers/dri/i965/brw_vs.c
@@ -349,7 +349,6 @@ brw_upload_vs_prog(struct brw_context *brw)
    if (brw_disk_cache_upload_program(brw, MESA_SHADER_VERTEX))
       return;
 
-   vp = (struct brw_program *) brw->programs[MESA_SHADER_VERTEX];
    vp->id = key.program_string_id;
 
    MAYBE_UNUSED bool success = brw_codegen_vs_prog(brw, vp, &key);
diff --git a/src/mesa/drivers/dri/i965/brw_wm.c b/src/mesa/drivers/dri/i965/brw_wm.c
index db632ed15e1be9b472f7..a78f3d6678eb807ca649 100644
--- a/src/mesa/drivers/dri/i965/brw_wm.c
+++ b/src/mesa/drivers/dri/i965/brw_wm.c
@@ -603,7 +603,6 @@ brw_upload_wm_prog(struct brw_context *brw)
    if (brw_disk_cache_upload_program(brw, MESA_SHADER_FRAGMENT))
       return;
 
-   fp = (struct brw_program *) brw->programs[MESA_SHADER_FRAGMENT];
    fp->id = key.program_string_id;
 
    MAYBE_UNUSED bool success = brw_codegen_wm_prog(brw, fp, &key,
-- 
Cheers,
  Eric



More information about the mesa-dev mailing list