mbox series

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

Message ID 20241120075321.27143-1-r.peniaev@gmail.com (mailing list archive)
Headers show
Series chardev/char-mux: tweak mux bitset operations | expand

Message

Roman Penyaev Nov. 20, 2024, 7:53 a.m. UTC
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

Comments

Paolo Bonzini Nov. 20, 2024, 2:44 p.m. UTC | #1
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
> 
>
Roman Penyaev Nov. 25, 2024, 1:46 p.m. UTC | #2
Hi Paolo,

Do I need to resend the fixed version, or if it is queued to what
exact repo or branch? I'm a bit confused. Thanks.

--
Roman

On Wed, Nov 20, 2024 at 3:44 PM Paolo Bonzini <pbonzini@redhat.com> wrote:
>
> 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
> >
> >
>
Paolo Bonzini Dec. 6, 2024, 1:09 a.m. UTC | #3
Il lun 25 nov 2024, 08:46 Roman Penyaev <r.peniaev@gmail.com> ha scritto:

> Hi Paolo,
>
> Do I need to resend the fixed version, or if it is queued to what
> exact repo or branch? I'm a bit confused. Thanks.
>

Hi, sorry for the late reply—I was not sending it out for inclusion because
we're in release freeze, but there was no need to resend.

Paolo

--
> Roman
>
> On Wed, Nov 20, 2024 at 3:44 PM Paolo Bonzini <pbonzini@redhat.com> wrote:
> >
> > 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
> > >
> > >
> >
>
>