All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] staging: media: sunxi: Add bool cast to value
@ 2019-07-22  6:06 ` Nishka Dasgupta
  0 siblings, 0 replies; 27+ messages in thread
From: Nishka Dasgupta @ 2019-07-22  6:06 UTC (permalink / raw)
  To: maxime.ripard, paul.kocialkowski, mchehab, gregkh, wens,
	linux-media, devel, linux-arm-kernel
  Cc: Nishka Dasgupta

Typecast as bool the return value of cedrus_find_format in
cedrus_check_format as the return value of cedrus_check_format is always
treated like a boolean value.

Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com>
---
Changes in v2:
- Add !! to the returned pointer to ensure that the return value is
  always either true or false, and never a non-zero value other than
  true.

 drivers/staging/media/sunxi/cedrus/cedrus_video.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/media/sunxi/cedrus/cedrus_video.c b/drivers/staging/media/sunxi/cedrus/cedrus_video.c
index e2b530b1a956..b731745f21f8 100644
--- a/drivers/staging/media/sunxi/cedrus/cedrus_video.c
+++ b/drivers/staging/media/sunxi/cedrus/cedrus_video.c
@@ -86,7 +86,7 @@ static struct cedrus_format *cedrus_find_format(u32 pixelformat, u32 directions,
 static bool cedrus_check_format(u32 pixelformat, u32 directions,
 				unsigned int capabilities)
 {
-	return cedrus_find_format(pixelformat, directions, capabilities);
+	return !!(bool)cedrus_find_format(pixelformat, directions, capabilities);
 }
 
 static void cedrus_prepare_format(struct v4l2_pix_format *pix_fmt)
-- 
2.19.1


^ permalink raw reply related	[flat|nested] 27+ messages in thread

end of thread, other threads:[~2019-07-25 11:24 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-22  6:06 [PATCH v2] staging: media: sunxi: Add bool cast to value Nishka Dasgupta
2019-07-22  6:06 ` Nishka Dasgupta
2019-07-22  6:06 ` Nishka Dasgupta
2019-07-22 11:12 ` Jeremy Sowden
2019-07-22 11:12   ` Jeremy Sowden
2019-07-22 11:12   ` Jeremy Sowden
2019-07-22 11:12   ` Jeremy Sowden
2019-07-22 12:24   ` Paul Kocialkowski
2019-07-22 12:24     ` Paul Kocialkowski
2019-07-22 12:24     ` Paul Kocialkowski
2019-07-22 13:19     ` Jeremy Sowden
2019-07-22 13:19       ` Jeremy Sowden
2019-07-22 13:19       ` Jeremy Sowden
2019-07-22 13:44     ` Nishka Dasgupta
2019-07-22 13:44       ` Nishka Dasgupta
2019-07-22 13:44       ` Nishka Dasgupta
2019-07-22 15:05       ` Paul Kocialkowski
2019-07-22 15:05         ` Paul Kocialkowski
2019-07-22 15:05         ` Paul Kocialkowski
2019-07-22 15:58       ` Sakari Ailus
2019-07-22 15:58         ` Sakari Ailus
2019-07-22 15:58         ` Sakari Ailus
2019-07-23  7:16         ` Paul Kocialkowski
2019-07-23  7:16           ` Paul Kocialkowski
2019-07-23  7:16           ` Paul Kocialkowski
2019-07-25 11:24 ` Hans Verkuil
2019-07-25 11:24   ` Hans Verkuil

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.