Bug 1498528 - libvirt-3.8.0/src/storage/storage_util.c:1841]: (style) Suspicious condition
Summary: libvirt-3.8.0/src/storage/storage_util.c:1841]: (style) Suspicious condition
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Virtualization Tools
Classification: Community
Component: libvirt
Version: unspecified
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Libvirt Maintainers
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-10-04 14:19 UTC by David Binderman
Modified: 2017-10-04 16:58 UTC (History)
3 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2017-10-04 16:58:41 UTC
Embargoed:


Attachments (Terms of Use)

Description David Binderman 2017-10-04 14:19:59 UTC
Description of problem:

libvirt-3.8.0/src/storage/storage_util.c:1841]: (style) Suspicious condition (assignment + comparison); Clarify expression with parentheses.

Source code is

    if (vol->target.backingStore &&
        (ret = storageBackendUpdateVolTargetInfo(VIR_STORAGE_VOL_FILE,
                                                 vol->target.backingStore,
                                                 withBlockVolFormat,
                                                 VIR_STORAGE_VOL_OPEN_DEFAULT |
                                                 VIR_STORAGE_VOL_OPEN_NOERROR,
                                                 readflags) < 0))

Maybe better code:

    if (vol->target.backingStore &&
        (ret = storageBackendUpdateVolTargetInfo(VIR_STORAGE_VOL_FILE,
                                                 vol->target.backingStore,
                                                 withBlockVolFormat,
                                                 VIR_STORAGE_VOL_OPEN_DEFAULT |
                                                 VIR_STORAGE_VOL_OPEN_NOERROR,
                                                 readflags)) < 0)


Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 1 Pavel Hrdina 2017-10-04 16:58:41 UTC
Upstream commit:

commit 000e95045595ab5fd974e08dcc71b70a491965ed
Author: Pavel Hrdina <phrdina>
Date:   Wed Oct 4 16:33:06 2017 +0200

    storage: Fix incorrect parenthesis placement


Note You need to log in before you can comment on or make changes to this bug.