4 * redundant conditions
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
QEMU |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
1.
[qemu/hw/
if (!sqid || (sqid && !nvme_check_sqid(n, sqid))) {
2.
[qemu/hw/
if (!cqid || (cqid && !nvme_check_cqid(n, cqid))) {
3.
[qemu/hw/
if (!tpm_pt-
4.
[qemu/target-
if (size > 3
|| (size < 3 && is_q)
|| (size == 3 && !is_q)) {
On 12 June 2015 at 11:38, dcb <email address hidden> wrote: block/nvme. c:355]: (style) Redundant condition: sqid. 'A && (!A block/nvme. c:429]: (style) Redundant condition: cqid. 'A && (!A tpm/tpm_ passthrough. c:157]: (style) Redundant condition: tpm_op_ canceled. 'A && (!A || B)' is equivalent to 'A || B' >tpm_op_ canceled || >tpm_op_ canceled && errno != ECANCELED)) {
> Public bug reported:
>
>
> 1.
>
> [qemu/hw/
> || B)' is equivalent to 'A || B'
>
> if (!sqid || (sqid && !nvme_check_sqid(n, sqid))) {
>
> 2.
>
> [qemu/hw/
> || B)' is equivalent to 'A || B'
>
> if (!cqid || (cqid && !nvme_check_cqid(n, cqid))) {
>
> 3.
>
> [qemu/hw/
> tpm_pt.
>
> if (!tpm_pt-
> (tpm_pt-
These three are all straightforward and would look simpler
in their simplified versions...
> 4. arm/translate- a64.c:5729] : (style) Redundant condition:
>
> [qemu/target-
> 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