[Qemu-devel] [PATCH for-2.9 1/6] disas/hppa: Remove dead code

Peter Maydell posted 6 patches 8 years, 11 months ago
[Qemu-devel] [PATCH for-2.9 1/6] disas/hppa: Remove dead code
Posted by Peter Maydell 8 years, 11 months ago
Coverity complains (CID 1302705) that the "fr0" part of the ?: in
fput_fp_reg_r() is dead.  This looks like cut-n-paste error from
fput_fp_reg(); delete the dead code.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 disas/hppa.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/disas/hppa.c b/disas/hppa.c
index 43facdc..a2d371f 100644
--- a/disas/hppa.c
+++ b/disas/hppa.c
@@ -1788,8 +1788,7 @@ fput_fp_reg_r (unsigned reg, disassemble_info *info)
   if (reg < 4)
     (*info->fprintf_func) (info->stream, "fpe%d", reg * 2 + 1);
   else
-    (*info->fprintf_func) (info->stream, "%sR",
-			   reg ? fp_reg_names[reg] : "fr0");
+    (*info->fprintf_func) (info->stream, "%sR", fp_reg_names[reg]);
 }
 
 static void
-- 
2.7.4


Re: [Qemu-devel] [PATCH for-2.9 1/6] disas/hppa: Remove dead code
Posted by Philippe Mathieu-Daudé 8 years, 11 months ago
On 03/03/2017 12:50 PM, Peter Maydell wrote:
> Coverity complains (CID 1302705) that the "fr0" part of the ?: in
> fput_fp_reg_r() is dead.  This looks like cut-n-paste error from
> fput_fp_reg(); delete the dead code.
>
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>

> ---
>  disas/hppa.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/disas/hppa.c b/disas/hppa.c
> index 43facdc..a2d371f 100644
> --- a/disas/hppa.c
> +++ b/disas/hppa.c
> @@ -1788,8 +1788,7 @@ fput_fp_reg_r (unsigned reg, disassemble_info *info)
>    if (reg < 4)
>      (*info->fprintf_func) (info->stream, "fpe%d", reg * 2 + 1);
>    else
> -    (*info->fprintf_func) (info->stream, "%sR",
> -			   reg ? fp_reg_names[reg] : "fr0");
> +    (*info->fprintf_func) (info->stream, "%sR", fp_reg_names[reg]);
>  }
>
>  static void
>