diff mbox series

treewide: fix redundant expressions

Message ID 20200416040005.387849-1-rosenp@gmail.com (mailing list archive)
State New, archived
Headers show
Series treewide: fix redundant expressions | expand

Commit Message

Rosen Penev April 16, 2020, 4 a.m. UTC
Also fix a subtle bug.

Found with clang-tidy's misc-redundant-expression

Signed-off-by: Rosen Penev <rosenp@gmail.com>
---
 lib/libv4lconvert/tinyjpeg.c              | 2 +-
 utils/v4l2-compliance/v4l2-compliance.cpp | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/lib/libv4lconvert/tinyjpeg.c b/lib/libv4lconvert/tinyjpeg.c
index a0c3b0c8..070c92db 100644
--- a/lib/libv4lconvert/tinyjpeg.c
+++ b/lib/libv4lconvert/tinyjpeg.c
@@ -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
 
diff --git a/utils/v4l2-compliance/v4l2-compliance.cpp b/utils/v4l2-compliance/v4l2-compliance.cpp
index 773c848c..bb32bae6 100644
--- a/utils/v4l2-compliance/v4l2-compliance.cpp
+++ b/utils/v4l2-compliance/v4l2-compliance.cpp
@@ -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)) {