diff mbox

Input: synaptics-rmi4 - using logical instead of bitwise AND

Message ID 20160315071140.GF13560@mwanda (mailing list archive)
State Accepted
Headers show

Commit Message

Dan Carpenter March 15, 2016, 7:11 a.m. UTC
There is a typo so we have && instead of &.

Fixes: ff8f83708b3e ('Input: synaptics-rmi4 - add support for 2D sensors and F11')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Joe Perches March 15, 2016, 8:33 a.m. UTC | #1
On Tue, 2016-03-15 at 10:11 +0300, Dan Carpenter wrote:
> There is a typo so we have && instead of &.
> 
> Fixes: ff8f83708b3e ('Input: synaptics-rmi4 - add support for 2D sensors and F11')
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> 
> diff --git a/drivers/input/rmi4/rmi_f11.c b/drivers/input/rmi4/rmi_f11.c
[]
> @@ -775,7 +775,7 @@ static int rmi_f11_get_query_parameters(struct rmi_device *rmi_dev,
>  	sensor_query->has_abs = !!(query_buf[0] & RMI_F11_HAS_ABS);
>  	sensor_query->has_gestures = !!(query_buf[0] & RMI_F11_HAS_GESTURES);
>  	sensor_query->has_sensitivity_adjust =
> -		!!(query_buf[0] && RMI_F11_HAS_SENSITIVITY_ADJ);
> +		!!(query_buf[0] & RMI_F11_HAS_SENSITIVITY_ADJ);
>  	sensor_query->configurable = !!(query_buf[0] & RMI_F11_CONFIGURABLE);
>  
>  	sensor_query->nr_x_electrodes =
> @@ -803,7 +803,7 @@ static int rmi_f11_get_query_parameters(struct rmi_device *rmi_dev,
>  		sensor_query->has_bending_correction =
>  			!!(query_buf[0] & RMI_F11_HAS_BENDING_CORRECTION);
>  		sensor_query->has_large_object_suppression =
> -		!!(query_buf[0] && RMI_F11_HAS_LARGE_OBJECT_SUPPRESSION);
> +			!!(query_buf[0] & RMI_F11_HAS_LARGE_OBJECT_SUPPRESSION);
>  		sensor_query->has_jitter_filter =
>  			!!(query_buf[0] & RMI_F11_HAS_JITTER_FILTER);
>  		query_size++;

Right and as well these are bool so the !! isn't necessary.
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Dan Carpenter March 15, 2016, 8:37 a.m. UTC | #2
On Tue, Mar 15, 2016 at 01:33:29AM -0700, Joe Perches wrote:
> Right and as well these are bool so the !! isn't necessary.

Not necessary but nice for reading...

regards,
dan carpenter

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Joe Perches March 15, 2016, 8:54 a.m. UTC | #3
On Tue, 2016-03-15 at 11:37 +0300, Dan Carpenter wrote:
> On Tue, Mar 15, 2016 at 01:33:29AM -0700, Joe Perches wrote:
> > 
> > Right and as well these are bool so the !! isn't necessary.
> Not necessary but nice for reading...

<shrug> opinions vary.

cheers, Joe

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Andrew Duggan March 15, 2016, 9:20 p.m. UTC | #4
On 03/15/2016 12:11 AM, Dan Carpenter wrote:
> There is a typo so we have && instead of &.
>
> Fixes: ff8f83708b3e ('Input: synaptics-rmi4 - add support for 2D sensors and F11')
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Acked-by: Andrew Duggan <aduggan@synaptics.com>

> diff --git a/drivers/input/rmi4/rmi_f11.c b/drivers/input/rmi4/rmi_f11.c
> index 77a5eb8..ec8a10d 100644
> --- a/drivers/input/rmi4/rmi_f11.c
> +++ b/drivers/input/rmi4/rmi_f11.c
> @@ -775,7 +775,7 @@ static int rmi_f11_get_query_parameters(struct rmi_device *rmi_dev,
>   	sensor_query->has_abs = !!(query_buf[0] & RMI_F11_HAS_ABS);
>   	sensor_query->has_gestures = !!(query_buf[0] & RMI_F11_HAS_GESTURES);
>   	sensor_query->has_sensitivity_adjust =
> -		!!(query_buf[0] && RMI_F11_HAS_SENSITIVITY_ADJ);
> +		!!(query_buf[0] & RMI_F11_HAS_SENSITIVITY_ADJ);
>   	sensor_query->configurable = !!(query_buf[0] & RMI_F11_CONFIGURABLE);
>   
>   	sensor_query->nr_x_electrodes =
> @@ -803,7 +803,7 @@ static int rmi_f11_get_query_parameters(struct rmi_device *rmi_dev,
>   		sensor_query->has_bending_correction =
>   			!!(query_buf[0] & RMI_F11_HAS_BENDING_CORRECTION);
>   		sensor_query->has_large_object_suppression =
> -		!!(query_buf[0] && RMI_F11_HAS_LARGE_OBJECT_SUPPRESSION);
> +			!!(query_buf[0] & RMI_F11_HAS_LARGE_OBJECT_SUPPRESSION);
>   		sensor_query->has_jitter_filter =
>   			!!(query_buf[0] & RMI_F11_HAS_JITTER_FILTER);
>   		query_size++;

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Dmitry Torokhov March 15, 2016, 11:45 p.m. UTC | #5
On Tue, Mar 15, 2016 at 02:20:02PM -0700, Andrew Duggan wrote:
> On 03/15/2016 12:11 AM, Dan Carpenter wrote:
> >There is a typo so we have && instead of &.
> >
> >Fixes: ff8f83708b3e ('Input: synaptics-rmi4 - add support for 2D sensors and F11')
> >Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> 
> Acked-by: Andrew Duggan <aduggan@synaptics.com>

Applied, thank you.

> 
> >diff --git a/drivers/input/rmi4/rmi_f11.c b/drivers/input/rmi4/rmi_f11.c
> >index 77a5eb8..ec8a10d 100644
> >--- a/drivers/input/rmi4/rmi_f11.c
> >+++ b/drivers/input/rmi4/rmi_f11.c
> >@@ -775,7 +775,7 @@ static int rmi_f11_get_query_parameters(struct rmi_device *rmi_dev,
> >  	sensor_query->has_abs = !!(query_buf[0] & RMI_F11_HAS_ABS);
> >  	sensor_query->has_gestures = !!(query_buf[0] & RMI_F11_HAS_GESTURES);
> >  	sensor_query->has_sensitivity_adjust =
> >-		!!(query_buf[0] && RMI_F11_HAS_SENSITIVITY_ADJ);
> >+		!!(query_buf[0] & RMI_F11_HAS_SENSITIVITY_ADJ);
> >  	sensor_query->configurable = !!(query_buf[0] & RMI_F11_CONFIGURABLE);
> >  	sensor_query->nr_x_electrodes =
> >@@ -803,7 +803,7 @@ static int rmi_f11_get_query_parameters(struct rmi_device *rmi_dev,
> >  		sensor_query->has_bending_correction =
> >  			!!(query_buf[0] & RMI_F11_HAS_BENDING_CORRECTION);
> >  		sensor_query->has_large_object_suppression =
> >-		!!(query_buf[0] && RMI_F11_HAS_LARGE_OBJECT_SUPPRESSION);
> >+			!!(query_buf[0] & RMI_F11_HAS_LARGE_OBJECT_SUPPRESSION);
> >  		sensor_query->has_jitter_filter =
> >  			!!(query_buf[0] & RMI_F11_HAS_JITTER_FILTER);
> >  		query_size++;
>
diff mbox

Patch

diff --git a/drivers/input/rmi4/rmi_f11.c b/drivers/input/rmi4/rmi_f11.c
index 77a5eb8..ec8a10d 100644
--- a/drivers/input/rmi4/rmi_f11.c
+++ b/drivers/input/rmi4/rmi_f11.c
@@ -775,7 +775,7 @@  static int rmi_f11_get_query_parameters(struct rmi_device *rmi_dev,
 	sensor_query->has_abs = !!(query_buf[0] & RMI_F11_HAS_ABS);
 	sensor_query->has_gestures = !!(query_buf[0] & RMI_F11_HAS_GESTURES);
 	sensor_query->has_sensitivity_adjust =
-		!!(query_buf[0] && RMI_F11_HAS_SENSITIVITY_ADJ);
+		!!(query_buf[0] & RMI_F11_HAS_SENSITIVITY_ADJ);
 	sensor_query->configurable = !!(query_buf[0] & RMI_F11_CONFIGURABLE);
 
 	sensor_query->nr_x_electrodes =
@@ -803,7 +803,7 @@  static int rmi_f11_get_query_parameters(struct rmi_device *rmi_dev,
 		sensor_query->has_bending_correction =
 			!!(query_buf[0] & RMI_F11_HAS_BENDING_CORRECTION);
 		sensor_query->has_large_object_suppression =
-		!!(query_buf[0] && RMI_F11_HAS_LARGE_OBJECT_SUPPRESSION);
+			!!(query_buf[0] & RMI_F11_HAS_LARGE_OBJECT_SUPPRESSION);
 		sensor_query->has_jitter_filter =
 			!!(query_buf[0] & RMI_F11_HAS_JITTER_FILTER);
 		query_size++;