diff options
author | Danny Al-Gaaf <danny.al-gaaf@bisect.de> | 2014-03-19 23:45:28 +0100 |
---|---|---|
committer | Danny Al-Gaaf <danny.al-gaaf@bisect.de> | 2014-04-22 20:08:27 +0200 |
commit | 0c04d6e3db792dbd979507e35d5df89f107e43be (patch) | |
tree | 5d3311c0bfb6c6a9196d09df3aba848591007e5b /src | |
parent | 13f0e8888f9ae3bcd78a57514f9a9235a903492b (diff) | |
download | gf-complete-0c04d6e3db792dbd979507e35d5df89f107e43be.tar.gz |
gf.c: fix pointless expression
Remove identical expression, reorganize code in gf_error_check()
to be identical handled trough all checks. Removed (raltmap && arg1 != 4)
check - this is dead code (arg1 is always 4 in this code path).
Fix for coverity issue from Ceph project:
CID 1193071 (#1 of 1): Same on both sides (CONSTANT_EXPRESSION_RESULT)
pointless_expression: The expression (arg1 == 4 && arg2 == 32) ||
(arg1 == 4 && arg2 == 32) does not accomplish anything because it
evaluates to either of its identical operands, arg1 == 4 && arg2 == 32.
Did you intend the operands to be different?
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Diffstat (limited to 'src')
-rw-r--r-- | src/gf.c | 11 |
1 files changed, 5 insertions, 6 deletions
@@ -338,11 +338,12 @@ int gf_error_check(int w, int mult_type, int region_type, int divide_type, if (rsse && !sse3) { _gf_errno = GF_E_SP_SSE3; return 0; } if (raltmap) { _gf_errno = GF_E_SP_8__A; return 0; } } else if (w == 16) { - if (arg1 == 4 && arg2 == 16) { - if (rsse && !sse3) { _gf_errno = GF_E_SP_SSE3; return 0; } - } else if (arg1 == 8 && (arg2 == 16 || arg2 == 8)) { + if ((arg1 == 8 && arg2 == 8) || + (arg1 == 8 && arg2 == 16)) { if (rsse || rnosse) { _gf_errno = GF_E_SP_16_S; return 0; } if (raltmap) { _gf_errno = GF_E_SP_16_A; return 0; } + } else if (arg1 == 4 && arg2 == 16) { + if (rsse && !sse3) { _gf_errno = GF_E_SP_SSE3; return 0; } } else { _gf_errno = GF_E_SP_16AR; return 0; } } else if (w == 32) { if ((arg1 == 8 && arg2 == 8) || @@ -350,10 +351,8 @@ int gf_error_check(int w, int mult_type, int region_type, int divide_type, (arg1 == 16 && arg2 == 32)) { if (rsse || rnosse) { _gf_errno = GF_E_SP_32_S; return 0; } if (raltmap) { _gf_errno = GF_E_SP_32_A; return 0; } - } else if ((arg1 == 4 && arg2 == 32) || - (arg1 == 4 && arg2 == 32)) { + } else if (arg1 == 4 && arg2 == 32) { if (rsse && !sse3) { _gf_errno = GF_E_SP_SSE3; return 0; } - if (raltmap && arg1 != 4) { _gf_errno = GF_E_SP_32_A; return 0; } if (raltmap && !sse3) { _gf_errno = GF_E_SP_32AS; return 0; } if (raltmap && rnosse) { _gf_errno = GF_E_SP_32AS; return 0; } } else { _gf_errno = GF_E_SP_32AR; return 0; } |