[PATCH] treewide: fix redundant expressions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Also fix a subtle bug.

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

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

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)) {
-- 
2.25.2




[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux