qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [Bug 1464611] [NEW] 4 * redundant conditions


From: Peter Maydell
Subject: Re: [Qemu-devel] [Bug 1464611] [NEW] 4 * redundant conditions
Date: Fri, 12 Jun 2015 12:01:17 +0100

On 12 June 2015 at 11:38, dcb <address@hidden> wrote:
> Public bug reported:
>
>
> 1.
>
> [qemu/hw/block/nvme.c:355]: (style) Redundant condition: sqid. 'A && (!A
> || B)' is equivalent to 'A || B'
>
>   if (!sqid || (sqid && !nvme_check_sqid(n, sqid))) {
>
> 2.
>
> [qemu/hw/block/nvme.c:429]: (style) Redundant condition: cqid. 'A && (!A
> || B)' is equivalent to 'A || B'
>
>   if (!cqid || (cqid && !nvme_check_cqid(n, cqid))) {
>
> 3.
>
> [qemu/hw/tpm/tpm_passthrough.c:157]: (style) Redundant condition:
> tpm_pt.tpm_op_canceled. 'A && (!A || B)' is equivalent to 'A || B'
>
>      if (!tpm_pt->tpm_op_canceled ||
>             (tpm_pt->tpm_op_canceled && errno != ECANCELED)) {

These three are all straightforward and would look simpler
in their simplified versions...

> 4.
>
> [qemu/target-arm/translate-a64.c:5729]: (style) Redundant condition:
> size<3. 'A && (!A || B)' is equivalent to 'A || B'
>
>       if (size > 3
>             || (size < 3 && is_q)
>             || (size == 3 && !is_q)) {

...but I'm less sure about this one. I'm not even sure
what it's trying to suggest this should simplify to:
just dropping "size < 3" is obviously wrong, and the
condition format isn't "A && (!A || B)" either.

thanks
-- PMM



reply via email to

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