@@ -113,9 +113,7 @@ static bool pa_are_adjacent(__u16 pa1, __u16 pa2)
return false;
if ((pa1 & trail_mask) || (pa2 & trail_mask))
return false;
- if (!((pa1 & ~mask) && (pa2 & ~mask)))
- return true;
- return false;
+ return !((pa1 & ~mask) && (pa2 & ~mask));
}
static bool pa_is_upstream_from(__u16 pa1, __u16 pa2)
@@ -124,9 +122,7 @@ static bool pa_is_upstream_from(__u16 pa1, __u16 pa2)
if (pa1 == CEC_PHYS_ADDR_INVALID || pa2 == CEC_PHYS_ADDR_INVALID)
return false;
- if (!(pa1 & ~mask) && (pa2 & ~mask))
- return true;
- return false;
+ return !(pa1 & ~mask) && (pa2 & ~mask);
}
static int arc_initiate_tx(struct node *node, unsigned me, unsigned la, bool interactive)
@@ -214,9 +214,7 @@ static bool pa_are_adjacent(__u16 pa1, __u16 pa2)
return false;
if ((pa1 & trail_mask) || (pa2 & trail_mask))
return false;
- if (!((pa1 & ~mask) && (pa2 & ~mask)))
- return true;
- return false;
+ return !((pa1 & ~mask) && (pa2 & ~mask));
}
static bool pa_is_upstream_from(__u16 pa1, __u16 pa2)
@@ -225,9 +223,7 @@ static bool pa_is_upstream_from(__u16 pa1, __u16 pa2)
if (pa1 == CEC_PHYS_ADDR_INVALID || pa2 == CEC_PHYS_ADDR_INVALID)
return false;
- if (!(pa1 & ~mask) && (pa2 & ~mask))
- return true;
- return false;
+ return !(pa1 & ~mask) && (pa2 & ~mask);
}
static __u8 current_power_state(struct node *node)
Found with readability-simplify-boolean-expr Signed-off-by: Rosen Penev <rosenp@gmail.com> --- utils/cec-compliance/cec-test-audio.cpp | 8 ++------ utils/cec-follower/cec-processing.cpp | 8 ++------ 2 files changed, 4 insertions(+), 12 deletions(-)