[PATCH v2 0/2] chardev/char-mux: tweak mux bitset operations

Roman Penyaev posted 2 patches 3 days, 4 hours ago
chardev/char-mux.c | 15 +++++++--------
1 file changed, 7 insertions(+), 8 deletions(-)
[PATCH v2 0/2] chardev/char-mux: tweak mux bitset operations
Posted by Roman Penyaev 3 days, 4 hours ago
Patchset tweaks bitset operations by changing a constant to unsigned
long, introduces a static compile check and simplifies bitset operations.

v1..v2:

Rebase on latest master, incorporate review tags.

Roman Penyaev (2):
  chardev/char-mux: shift unsigned long to avoid 32-bit overflow
  chardev/char-mux: make boolean bit check instead of find_next_bit()

 chardev/char-mux.c | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)


Signed-off-by: Roman Penyaev <r.peniaev@gmail.com>
Reviewed-by: "Marc-André Lureau" <marcandre.lureau@redhat.com>
Cc: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Clément Mathieu--Drif <clement.mathieu--drif@eviden.com>
Cc: qemu-devel@nongnu.org


-- 
2.34.1


Re: [PATCH v2 0/2] chardev/char-mux: tweak mux bitset operations
Posted by Paolo Bonzini 2 days, 21 hours ago
Queued, with just one change:

> Also add a static compile check that MAX_MUX never bigger than
> `sizeof(d->mux_bitset)`.

This needs to be multiplied by CHAR_BIT.

Paolo

On 11/20/24 08:53, Roman Penyaev wrote:
> Patchset tweaks bitset operations by changing a constant to unsigned
> long, introduces a static compile check and simplifies bitset operations.
> 
> v1..v2:
> 
> Rebase on latest master, incorporate review tags.
> 
> Roman Penyaev (2):
>    chardev/char-mux: shift unsigned long to avoid 32-bit overflow
>    chardev/char-mux: make boolean bit check instead of find_next_bit()
> 
>   chardev/char-mux.c | 15 +++++++--------
>   1 file changed, 7 insertions(+), 8 deletions(-)
> 
> 
> Signed-off-by: Roman Penyaev <r.peniaev@gmail.com>
> Reviewed-by: "Marc-André Lureau" <marcandre.lureau@redhat.com>
> Cc: Peter Maydell <peter.maydell@linaro.org>
> Reviewed-by: Clément Mathieu--Drif <clement.mathieu--drif@eviden.com>
> Cc: qemu-devel@nongnu.org
> 
>