LKML Archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1 linux-next] Input: cyttsp4 - use swap() in cyttsp4_get_touch()
@ 2015-06-10 16:31 Fabian Frederick
  2015-06-11 20:08 ` Dmitry Torokhov
  0 siblings, 1 reply; 2+ messages in thread
From: Fabian Frederick @ 2015-06-10 16:31 UTC (permalink / raw
  To: linux-kernel
  Cc: Julia Lawall, Fabian Frederick, Ferruh Yigit, Dmitry Torokhov,
	linux-input

Use kernel.h macro definition.

Thanks to Julia Lawall for Coccinelle scripting support.

Signed-off-by: Fabian Frederick <fabf@skynet.be>
---
 drivers/input/touchscreen/cyttsp4_core.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/input/touchscreen/cyttsp4_core.c b/drivers/input/touchscreen/cyttsp4_core.c
index 568a3d3..5ed3105 100644
--- a/drivers/input/touchscreen/cyttsp4_core.c
+++ b/drivers/input/touchscreen/cyttsp4_core.c
@@ -775,7 +775,6 @@ static void cyttsp4_get_touch(struct cyttsp4_mt_data *md,
 	struct device *dev = &md->input->dev;
 	struct cyttsp4_sysinfo *si = md->si;
 	enum cyttsp4_tch_abs abs;
-	int tmp;
 	bool flipped;
 
 	for (abs = CY_TCH_X; abs < CY_TCH_NUM_ABS; abs++) {
@@ -790,9 +789,7 @@ static void cyttsp4_get_touch(struct cyttsp4_mt_data *md,
 	}
 
 	if (md->pdata->flags & CY_FLAG_FLIP) {
-		tmp = touch->abs[CY_TCH_X];
-		touch->abs[CY_TCH_X] = touch->abs[CY_TCH_Y];
-		touch->abs[CY_TCH_Y] = tmp;
+		swap(touch->abs[CY_TCH_X], touch->abs[CY_TCH_Y]);
 		flipped = true;
 	} else
 		flipped = false;
-- 
2.4.2


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

* Re: [PATCH 1/1 linux-next] Input: cyttsp4 - use swap() in cyttsp4_get_touch()
  2015-06-10 16:31 [PATCH 1/1 linux-next] Input: cyttsp4 - use swap() in cyttsp4_get_touch() Fabian Frederick
@ 2015-06-11 20:08 ` Dmitry Torokhov
  0 siblings, 0 replies; 2+ messages in thread
From: Dmitry Torokhov @ 2015-06-11 20:08 UTC (permalink / raw
  To: Fabian Frederick; +Cc: linux-kernel, Julia Lawall, Ferruh Yigit, linux-input

On Wed, Jun 10, 2015 at 06:31:43PM +0200, Fabian Frederick wrote:
> Use kernel.h macro definition.
> 
> Thanks to Julia Lawall for Coccinelle scripting support.
> 
> Signed-off-by: Fabian Frederick <fabf@skynet.be>

Applied, thank you.

> ---
>  drivers/input/touchscreen/cyttsp4_core.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/drivers/input/touchscreen/cyttsp4_core.c b/drivers/input/touchscreen/cyttsp4_core.c
> index 568a3d3..5ed3105 100644
> --- a/drivers/input/touchscreen/cyttsp4_core.c
> +++ b/drivers/input/touchscreen/cyttsp4_core.c
> @@ -775,7 +775,6 @@ static void cyttsp4_get_touch(struct cyttsp4_mt_data *md,
>  	struct device *dev = &md->input->dev;
>  	struct cyttsp4_sysinfo *si = md->si;
>  	enum cyttsp4_tch_abs abs;
> -	int tmp;
>  	bool flipped;
>  
>  	for (abs = CY_TCH_X; abs < CY_TCH_NUM_ABS; abs++) {
> @@ -790,9 +789,7 @@ static void cyttsp4_get_touch(struct cyttsp4_mt_data *md,
>  	}
>  
>  	if (md->pdata->flags & CY_FLAG_FLIP) {
> -		tmp = touch->abs[CY_TCH_X];
> -		touch->abs[CY_TCH_X] = touch->abs[CY_TCH_Y];
> -		touch->abs[CY_TCH_Y] = tmp;
> +		swap(touch->abs[CY_TCH_X], touch->abs[CY_TCH_Y]);
>  		flipped = true;
>  	} else
>  		flipped = false;
> -- 
> 2.4.2
> 

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

end of thread, other threads:[~2015-06-11 20:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-10 16:31 [PATCH 1/1 linux-next] Input: cyttsp4 - use swap() in cyttsp4_get_touch() Fabian Frederick
2015-06-11 20:08 ` Dmitry Torokhov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).