qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: Pavel Dovgalyuk <pavel.dovgalyuk@ispras.ru>, qemu-devel@nongnu.org
Cc: mrolnik@gmail.com, richard.henderson@linaro.org
Subject: Re: [PATCH v2 3/5] target/avr: fix avr features processing
Date: Thu, 19 Jan 2023 11:09:01 +0100	[thread overview]
Message-ID: <7616852a-a051-fc00-e799-dbaf7b843b28@linaro.org> (raw)
In-Reply-To: <167412017939.3110454.772171621078654245.stgit@pasha-ThinkPad-X280>

On 19/1/23 10:22, Pavel Dovgalyuk wrote:
> Bit vector for features has 64 bits. This patch fixes bit shifts in
> avr_feature and set_avr_feature functions to be 64-bit too.
> 
> Signed-off-by: Pavel Dovgalyuk <Pavel.Dovgalyuk@ispras.ru>
> Reviewed-by: Michael Rolnik <mrolnik@gmail.com>
> ---
>   target/avr/cpu.h |    4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/target/avr/cpu.h b/target/avr/cpu.h
> index 7c3895b65e..280edc495b 100644
> --- a/target/avr/cpu.h
> +++ b/target/avr/cpu.h
> @@ -166,12 +166,12 @@ vaddr avr_cpu_gdb_adjust_breakpoint(CPUState *cpu, vaddr addr);
>   
>   static inline int avr_feature(CPUAVRState *env, AVRFeature feature)
>   {
> -    return (env->features & (1U << feature)) != 0;
> +    return (env->features & (1ULL << feature)) != 0;
>   }
>   
>   static inline void set_avr_feature(CPUAVRState *env, int feature)
>   {
> -    env->features |= (1U << feature);
> +    env->features |= (1ULL << feature);
>   }

Consider using extract64() or BIT_ULL(). Regardless:

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>



  reply	other threads:[~2023-01-19 10:14 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-19  9:22 [PATCH v2 0/5] AVR target fixes Pavel Dovgalyuk
2023-01-19  9:22 ` [PATCH v2 1/5] target/avr: fix long address calculation Pavel Dovgalyuk
2023-01-19  9:22 ` [PATCH v2 2/5] target/avr: implement small RAM/large RAM feature Pavel Dovgalyuk
2023-01-19 18:29   ` Richard Henderson
2023-01-19  9:22 ` [PATCH v2 3/5] target/avr: fix avr features processing Pavel Dovgalyuk
2023-01-19 10:09   ` Philippe Mathieu-Daudé [this message]
2023-01-19 18:25   ` Richard Henderson
2023-01-19  9:23 ` [PATCH v2 4/5] target/avr: fix interrupt processing Pavel Dovgalyuk
2023-01-19 10:09   ` Philippe Mathieu-Daudé
2023-01-19 18:26   ` Richard Henderson
2023-01-19  9:23 ` [PATCH v2 5/5] target/avr: enable icount mode Pavel Dovgalyuk
2023-01-19 18:28   ` Richard Henderson
  -- strict thread matches above, loose matches on Subject: below --
2023-01-24  7:12 [PATCH v2 0/5] AVR target fixes Pavel Dovgalyuk
2023-01-24  7:12 ` [PATCH v2 3/5] target/avr: fix avr features processing Pavel Dovgalyuk

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=7616852a-a051-fc00-e799-dbaf7b843b28@linaro.org \
    --to=philmd@linaro.org \
    --cc=mrolnik@gmail.com \
    --cc=pavel.dovgalyuk@ispras.ru \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).