* [PATCH v2] hw/i386/pc: Remove vmport value assertion
@ 2024-08-20 23:11 Kamil Szczęk
2024-08-20 23:18 ` Richard Henderson
2024-09-16 14:16 ` Kamil Szczęk
0 siblings, 2 replies; 4+ messages in thread
From: Kamil Szczęk @ 2024-08-20 23:11 UTC (permalink / raw)
To: qemu-devel@nongnu.org; +Cc: Philippe Mathieu-Daudé, Richard Henderson
There is no need for this assertion here, as we only use vmport value
for equality/inequality checks. This was originally prompted by the
following Coverity report:
>>> CID 1559533: Integer handling issues (CONSTANT_EXPRESSION_RESULT)
>>> "pcms->vmport >= 0" is always true regardless of the values of
>>> its operands. This occurs as the logical first operand of "&&".
Signed-off-by: Kamil Szczęk <kamil@szczek.dev>
Reported-By: Philippe Mathieu-Daudé <philmd@linaro.org>
---
hw/i386/pc.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index 7779c88a91..5302fd96b4 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -1221,7 +1221,6 @@ void pc_basic_device_init(struct PCMachineState *pcms,
isa_realize_and_unref(pcms->pcspk, isa_bus, &error_fatal);
}
- assert(pcms->vmport >= 0 && pcms->vmport < ON_OFF_AUTO__MAX);
if (pcms->vmport == ON_OFF_AUTO_AUTO) {
pcms->vmport = (xen_enabled() || !pcms->i8042_enabled)
? ON_OFF_AUTO_OFF : ON_OFF_AUTO_ON;
--
2.45.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH v2] hw/i386/pc: Remove vmport value assertion
2024-08-20 23:11 [PATCH v2] hw/i386/pc: Remove vmport value assertion Kamil Szczęk
@ 2024-08-20 23:18 ` Richard Henderson
2024-09-16 14:16 ` Kamil Szczęk
1 sibling, 0 replies; 4+ messages in thread
From: Richard Henderson @ 2024-08-20 23:18 UTC (permalink / raw)
To: Kamil Szczęk, qemu-devel@nongnu.org; +Cc: Philippe Mathieu-Daudé
On 8/21/24 09:11, Kamil Szczęk wrote:
> There is no need for this assertion here, as we only use vmport value
> for equality/inequality checks. This was originally prompted by the
> following Coverity report:
> >>> CID 1559533: Integer handling issues (CONSTANT_EXPRESSION_RESULT)
> >>> "pcms->vmport >= 0" is always true regardless of the values of
> >>> its operands. This occurs as the logical first operand of "&&".
>
> Signed-off-by: Kamil Szczęk <kamil@szczek.dev>
> Reported-By: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
> hw/i386/pc.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/hw/i386/pc.c b/hw/i386/pc.c
> index 7779c88a91..5302fd96b4 100644
> --- a/hw/i386/pc.c
> +++ b/hw/i386/pc.c
> @@ -1221,7 +1221,6 @@ void pc_basic_device_init(struct PCMachineState *pcms,
> isa_realize_and_unref(pcms->pcspk, isa_bus, &error_fatal);
> }
>
> - assert(pcms->vmport >= 0 && pcms->vmport < ON_OFF_AUTO__MAX);
> if (pcms->vmport == ON_OFF_AUTO_AUTO) {
> pcms->vmport = (xen_enabled() || !pcms->i8042_enabled)
> ? ON_OFF_AUTO_OFF : ON_OFF_AUTO_ON;
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
r~
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2] hw/i386/pc: Remove vmport value assertion
2024-08-20 23:11 [PATCH v2] hw/i386/pc: Remove vmport value assertion Kamil Szczęk
2024-08-20 23:18 ` Richard Henderson
@ 2024-09-16 14:16 ` Kamil Szczęk
2024-11-19 16:17 ` Peter Maydell
1 sibling, 1 reply; 4+ messages in thread
From: Kamil Szczęk @ 2024-09-16 14:16 UTC (permalink / raw)
To: qemu-devel@nongnu.org; +Cc: Philippe Mathieu-Daudé, Richard Henderson
On Wednesday, August 21st, 2024 at 01:11, Kamil Szczęk <kamil@szczek.dev> wrote:
> There is no need for this assertion here, as we only use vmport value
> for equality/inequality checks. This was originally prompted by the
> following Coverity report:
> >>> CID 1559533: Integer handling issues (CONSTANT_EXPRESSION_RESULT)
> >>> "pcms->vmport >= 0" is always true regardless of the values of
> >>> its operands. This occurs as the logical first operand of "&&".
>
> Signed-off-by: Kamil Szczęk <kamil@szczek.dev>
> Reported-By: Philippe Mathieu-Daudé <philmd@linaro.org>
Hi, just checking in to see if this needs any additional work.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2] hw/i386/pc: Remove vmport value assertion
2024-09-16 14:16 ` Kamil Szczęk
@ 2024-11-19 16:17 ` Peter Maydell
0 siblings, 0 replies; 4+ messages in thread
From: Peter Maydell @ 2024-11-19 16:17 UTC (permalink / raw)
To: Kamil Szczęk
Cc: qemu-devel@nongnu.org, Philippe Mathieu-Daudé,
Richard Henderson
On Mon, 16 Sept 2024 at 15:18, Kamil Szczęk <kamil@szczek.dev> wrote:
>
> On Wednesday, August 21st, 2024 at 01:11, Kamil Szczęk <kamil@szczek.dev> wrote:
> > There is no need for this assertion here, as we only use vmport value
> > for equality/inequality checks. This was originally prompted by the
> > following Coverity report:
> > >>> CID 1559533: Integer handling issues (CONSTANT_EXPRESSION_RESULT)
> > >>> "pcms->vmport >= 0" is always true regardless of the values of
> > >>> its operands. This occurs as the logical first operand of "&&".
> >
> > Signed-off-by: Kamil Szczęk <kamil@szczek.dev>
> > Reported-By: Philippe Mathieu-Daudé <philmd@linaro.org>
>
> Hi, just checking in to see if this needs any additional work.
No, it's fine -- looks like we just failed to pick up the
patch. Sorry about that. We'll get it into 9.2.
thanks
-- PMM
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-11-19 16:18 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-20 23:11 [PATCH v2] hw/i386/pc: Remove vmport value assertion Kamil Szczęk
2024-08-20 23:18 ` Richard Henderson
2024-09-16 14:16 ` Kamil Szczęk
2024-11-19 16:17 ` Peter Maydell
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).