tests/libqos/ahci.c:745: redundant condition ?

Bug #1497711 reported by dcb
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
QEMU
Fix Released
Undecided
Unassigned

Bug Description

[qemu/tests/libqos/ahci.c:745]: (style) Redundant condition: props.ncq. '!props.ncq || (props.ncq && props.lba48)' is equivalent to '!props.ncq || props.lba48'

    g_assert(!props->ncq || (props->ncq && props->lba48));

Revision history for this message
Stefan Hajnoczi (stefanha) wrote : Re: [Qemu-devel] [Bug 1497711] [NEW] tests/libqos/ahci.c:745: redundant condition ?

On Sun, Sep 20, 2015 at 10:08:49AM -0000, dcb wrote:
> Public bug reported:
>
> [qemu/tests/libqos/ahci.c:745]: (style) Redundant condition: props.ncq.
> '!props.ncq || (props.ncq && props.lba48)' is equivalent to '!props.ncq
> || props.lba48'
>
> g_assert(!props->ncq || (props->ncq && props->lba48));

CCing John Snow, AHCI maintainer

Revision history for this message
Stefan Hajnoczi (stefanha) wrote :

Fixed in:

commit 3d937150dce20cb95cbaae99b6fd48dca4261f32
Author: John Snow <email address hidden>
Date: Mon Oct 5 12:00:55 2015 -0400

    qtest/ahci: fix redundant assertion

    Fixes https://bugs.launchpad.net/qemu/+bug/1497711

    (!ncq || (ncq && lba48)) is the same as
    (!ncq || lba48).

    The intention is simply: "If a command is NCQ,
    it must also be LBA48."

    Signed-off-by: John Snow <email address hidden>
    Message-id: <email address hidden>

Changed in qemu:
status: New → Fix Committed
Thomas Huth (th-huth)
Changed in qemu:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.