qemu-arm
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] hw/misc/nrf51_rng: Don't use BIT_MASK() when we mean BIT()


From: Philippe Mathieu-Daudé
Subject: Re: [PATCH] hw/misc/nrf51_rng: Don't use BIT_MASK() when we mean BIT()
Date: Mon, 18 Nov 2024 13:37:29 +0100
User-agent: Mozilla Thunderbird

On 8/11/24 13:56, Peter Maydell wrote:
The BIT_MASK() macro from bitops.h provides the mask of a bit
within a particular word of a multi-word bit array; it is intended
to be used with its counterpart BIT_WORD() that gives the index
of the word in the array.

In nrf51_rng we are using it for cases where we have a bit number
that we know is the index of a bit within a single word (in fact, it
happens that all the bit numbers we pass to it are zero). This
happens to give the right answer, but the macro that actually
does the job we want here is BIT().

Use BIT() instead of BIT_MASK().

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
  hw/misc/nrf51_rng.c | 10 +++++-----
  1 file changed, 5 insertions(+), 5 deletions(-)
Patch queued to hw-misc, thanks.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]