All of lore.kernel.org
 help / color / mirror / Atom feed
From: Laurent Vivier <laurent@vivier.eu>
To: Chen Qun <kuhn.chenqun@huawei.com>,
	qemu-devel@nongnu.org, qemu-trivial@nongnu.org
Cc: Peter Maydell <peter.maydell@linaro.org>,
	philmd@redhat.com, zhang.zhanghailiang@huawei.com,
	Euler Robot <euler.robot@huawei.com>
Subject: Re: [PATCH v4 2/3] display/blizzard: Remove redundant statement in blizzard_draw_line16_32()
Date: Tue, 24 Mar 2020 09:38:59 +0100	[thread overview]
Message-ID: <aff5ca8a-af20-a3ba-4354-5c203a9eea81@vivier.eu> (raw)
In-Reply-To: <20200324082235.27980-3-kuhn.chenqun@huawei.com>

Le 24/03/2020 à 09:22, Chen Qun a écrit :
> Clang static code analyzer show warning:
>   hw/display/blizzard.c:940:9: warning: Value stored to 'data' is never read
>         data >>= 5;
>         ^        ~
> Reported-by: Euler Robot <euler.robot@huawei.com>
> Signed-off-by: Chen Qun <kuhn.chenqun@huawei.com>
> ---
> Cc: Andrzej Zaborowski <balrogg@gmail.com>
> Cc: Peter Maydell <peter.maydell@linaro.org>
> ---
>  hw/display/blizzard.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/hw/display/blizzard.c b/hw/display/blizzard.c
> index 359e399c2a..62517bdf75 100644
> --- a/hw/display/blizzard.c
> +++ b/hw/display/blizzard.c
> @@ -937,7 +937,6 @@ static void blizzard_draw_line16_32(uint32_t *dest,
>          g = (data & 0x3f) << 2;
>          data >>= 6;
>          r = (data & 0x1f) << 3;
> -        data >>= 5;
>          *dest++ = rgb_to_pixel32(r, g, b);
>      }
>  }
> 

Perhaps it would be clearer to use extract32() to compute r, g and b?

Thanks,
Laurent


  reply	other threads:[~2020-03-24  8:40 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-24  8:22 [PATCH v4 0/3] redundant code: Fix warnings reported by Clang static code analyzer Chen Qun
2020-03-24  8:22 ` [PATCH v4 1/3] scsi/esp-pci: Remove redundant statement in esp_pci_io_write() Chen Qun
2020-03-24  8:27   ` Laurent Vivier
2020-03-24  8:22 ` [PATCH v4 2/3] display/blizzard: Remove redundant statement in blizzard_draw_line16_32() Chen Qun
2020-03-24  8:38   ` Laurent Vivier [this message]
2020-03-24  8:40     ` Laurent Vivier
2020-03-24 11:49       ` Chenqun (kuhn)
2020-03-24  8:22 ` [PATCH v4 3/3] timer/exynos4210_mct: Remove redundant statement in exynos4210_mct_write() Chen Qun
2020-03-24 10:59   ` Laurent Vivier
2020-03-24 12:22     ` Chenqun (kuhn)
2020-03-24 13:21       ` Laurent Vivier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aff5ca8a-af20-a3ba-4354-5c203a9eea81@vivier.eu \
    --to=laurent@vivier.eu \
    --cc=euler.robot@huawei.com \
    --cc=kuhn.chenqun@huawei.com \
    --cc=peter.maydell@linaro.org \
    --cc=philmd@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-trivial@nongnu.org \
    --cc=zhang.zhanghailiang@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.