Skip to contentSkip to conversation

v4l-helpers: don't mix enum type with int

PATCH New Rosen Penev 1 participant 1 message Sep 10, 2020 Media (V4L/DVB)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 v4l-helpers: don't mix enum type with int

warning: enumeral and non-enumeral type in conditional expression
return hsv_enc < V4L2_HSV_ENC_180 ? V4L2_HSV_ENC_180 : hsv_enc;

---
 utils/common/v4l-helpers.h | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
utils/common/v4l-helpers.h +3 -1
index e093e717..c09cd987 100644
@@ -876,8 +876,10 @@ static inline unsigned
 v4l_format_g_hsv_enc(const struct v4l2_format *fmt)
 {
 	unsigned hsv_enc = v4l_format_g_ycbcr_enc(fmt);
+	if (hsv_enc == V4L2_HSV_ENC_180)
+		return V4L2_HSV_ENC_180;
 
-	return hsv_enc < V4L2_HSV_ENC_180 ? V4L2_HSV_ENC_180 : hsv_enc;
+	return hsv_enc;
 }
 
 static inline void v4l_format_s_quantization(struct v4l2_format *fmt,
Signature · 1 line
2.17.1