treewide: fix redundant expressions
PATCH 1/1 treewide: fix redundant expressions
Also fix a subtle bug.
Found with clang-tidy's misc-redundant-expression
Signed-off-by Rosen Penev <[email protected]>
--- lib/libv4lconvert/tinyjpeg.c | 2 +- utils/v4l2-compliance/v4l2-compliance.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
lib/libv4lconvert/tinyjpeg.c +1 -1
@@ -2048,7 +2048,7 @@ static int parse_JFIF(struct jdec_private *priv, const unsigned char *stream)error ("Sampling other than 1x1 for Cr and Cb is not supported\n" );if ((priv->flags &TINYJPEG_FLAGS_PLANAR_JPEG ) && ((priv->component_infos[cY].Hfactor !=2 ) - || (priv->component_infos[cY].Hfactor !=2 ))) + || (priv->component_infos[cY].Vfactor !=2 )))error ("Sampling other than 2x2 for Y is not supported with planar JPEG\n" );#endif
utils/v4l2-compliance/v4l2-compliance.cpp +1 -1
@@ -1040,7 +1040,7 @@ void testNode(struct node &node, struct node &node_m2m_cap, struct node &expbuf_ else if (media_fd >= 0) ent_id = mi_media_info_for_fd(media_fd, node.g_fd(), &is_invalid); - if (ent_id && ent_id != MEDIA_ENT_F_UNKNOWN) { + if (ent_id != MEDIA_ENT_F_UNKNOWN) { memset(&node.entity, 0, sizeof(node.entity)); node.entity.id = ent_id; if (!ioctl(media_fd, MEDIA_IOC_ENUM_ENTITIES, &node.entity)) {
Signature · 1 line
2.25.2