[libcamera-devel,2/8] libcamera: event_dispatcher_poll: Fix bitwise test

Message ID 20190426150155.18652-3-laurent.pinchart@ideasonboard.com
State Accepted
Commit 2eeb826f3fa294f4f980e3a62da4e96095355997
Headers show
Series
  • Fix clang compilation warnings and errors
Related show

Commit Message

Laurent Pinchart April 26, 2019, 3:01 p.m. UTC
Add missing parentheses to fix a bitwise test.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 src/libcamera/event_dispatcher_poll.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Kieran Bingham April 26, 2019, 4:02 p.m. UTC | #1
On 26/04/2019 17:01, Laurent Pinchart wrote:
> Add missing parentheses to fix a bitwise test.
> 
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>

> ---
>  src/libcamera/event_dispatcher_poll.cpp | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/libcamera/event_dispatcher_poll.cpp b/src/libcamera/event_dispatcher_poll.cpp
> index 130b5e20ea09..1f0f352a8e0a 100644
> --- a/src/libcamera/event_dispatcher_poll.cpp
> +++ b/src/libcamera/event_dispatcher_poll.cpp
> @@ -210,7 +210,7 @@ int EventDispatcherPoll::poll(std::vector<struct pollfd> *pollfds)
>  
>  void EventDispatcherPoll::processInterrupt(const struct pollfd &pfd)
>  {
> -	if (!pfd.revents & POLLIN)
> +	if (!(pfd.revents & POLLIN))
>  		return;
>  
>  	uint64_t value;
>

Patch

diff --git a/src/libcamera/event_dispatcher_poll.cpp b/src/libcamera/event_dispatcher_poll.cpp
index 130b5e20ea09..1f0f352a8e0a 100644
--- a/src/libcamera/event_dispatcher_poll.cpp
+++ b/src/libcamera/event_dispatcher_poll.cpp
@@ -210,7 +210,7 @@  int EventDispatcherPoll::poll(std::vector<struct pollfd> *pollfds)
 
 void EventDispatcherPoll::processInterrupt(const struct pollfd &pfd)
 {
-	if (!pfd.revents & POLLIN)
+	if (!(pfd.revents & POLLIN))
 		return;
 
 	uint64_t value;