linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] Fix incorrectly applied patch for MAP_PROFILE_BUTTON
@ 2023-03-18 14:41 Matthias Benkmann
  2023-03-18 15:21 ` [PATCH v3] " Matthias Benkmann
  0 siblings, 1 reply; 4+ messages in thread
From: Matthias Benkmann @ 2023-03-18 14:41 UTC (permalink / raw)
  To: linux-input
  Cc: dmitry.torokhov, Nate Yocom, hadess, benjamin.tissoires,
	linux-kernel, Pavel Rojtberg

When the linked patch was applied,
one hunk ended up in the wrong function. This patch moves it to where
it probably belongs.

Link: https://lore.kernel.org/all/20220908173930.28940-6-nate@yocom.org/
Fixes: fff1011a26d6 (Input: xpad - add X-Box Adaptive Profile button)
Signed-off-by: Matthias Benkmann <matthias.benkmann@gmail.com>

---
 drivers/input/joystick/xpad.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/input/joystick/xpad.c b/drivers/input/joystick/xpad.c
index f642ec8e92dd..29131f1a2f06 100644
--- a/drivers/input/joystick/xpad.c
+++ b/drivers/input/joystick/xpad.c
@@ -781,9 +781,6 @@ static void xpad_process_packet(struct usb_xpad
*xpad, u16 cmd, unsigned char *d
        input_report_key(dev, BTN_C, data[8]);
        input_report_key(dev, BTN_Z, data[9]);

-       /* Profile button has a value of 0-3, so it is reported as an axis */
-       if (xpad->mapping & MAP_PROFILE_BUTTON)
-               input_report_abs(dev, ABS_PROFILE, data[34]);

        input_sync(dev);
 }
@@ -1061,6 +1058,10 @@ static void xpadone_process_packet(struct
usb_xpad *xpad, u16 cmd, unsigned char
                                        (__u16) le16_to_cpup((__le16
*)(data + 8)));
                }

+               /* Profile button has a value of 0-3, so it is
reported as an axis */
+               if (xpad->mapping & MAP_PROFILE_BUTTON)
+                       input_report_abs(dev, ABS_PROFILE, data[34]);
+
                /* paddle handling */
                /* based on SDL's SDL_hidapi_xboxone.c */
                if (xpad->mapping & MAP_PADDLES) {
-- 
2.25.1

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

* [PATCH v3] Fix incorrectly applied patch for MAP_PROFILE_BUTTON
  2023-03-18 14:41 [PATCH v2] Fix incorrectly applied patch for MAP_PROFILE_BUTTON Matthias Benkmann
@ 2023-03-18 15:21 ` Matthias Benkmann
  2023-03-18 18:00   ` Andi Shyti
  0 siblings, 1 reply; 4+ messages in thread
From: Matthias Benkmann @ 2023-03-18 15:21 UTC (permalink / raw)
  To: linux-input
  Cc: dmitry.torokhov, Nate Yocom, hadess, benjamin.tissoires,
	linux-kernel, Pavel Rojtberg

When the linked patch was applied,
one hunk ended up in the wrong function. This patch moves it to where
it probably belongs.

Link: https://lore.kernel.org/all/20220908173930.28940-6-nate@yocom.org/
Fixes: fff1011a26d6 (Input: xpad - add X-Box Adaptive Profile button)
Signed-off-by: Matthias Benkmann <matthias.benkmann@gmail.com>

---
 drivers/input/joystick/xpad.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/input/joystick/xpad.c b/drivers/input/joystick/xpad.c
index f642ec8e92dd..29131f1a2f06 100644
--- a/drivers/input/joystick/xpad.c
+++ b/drivers/input/joystick/xpad.c
@@ -781,9 +781,6 @@ static void xpad_process_packet(struct usb_xpad *xpad, u16 cmd, unsigned char *d
 	input_report_key(dev, BTN_C, data[8]);
 	input_report_key(dev, BTN_Z, data[9]);
 
-	/* Profile button has a value of 0-3, so it is reported as an axis */
-	if (xpad->mapping & MAP_PROFILE_BUTTON)
-		input_report_abs(dev, ABS_PROFILE, data[34]);
 
 	input_sync(dev);
 }
@@ -1061,6 +1058,10 @@ static void xpadone_process_packet(struct usb_xpad *xpad, u16 cmd, unsigned char
 					(__u16) le16_to_cpup((__le16 *)(data + 8)));
 		}
 
+		/* Profile button has a value of 0-3, so it is reported as an axis */
+		if (xpad->mapping & MAP_PROFILE_BUTTON)
+			input_report_abs(dev, ABS_PROFILE, data[34]);
+
 		/* paddle handling */
 		/* based on SDL's SDL_hidapi_xboxone.c */
 		if (xpad->mapping & MAP_PADDLES) {
-- 
2.25.1


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

* Re: [PATCH v3] Fix incorrectly applied patch for MAP_PROFILE_BUTTON
  2023-03-18 15:21 ` [PATCH v3] " Matthias Benkmann
@ 2023-03-18 18:00   ` Andi Shyti
  2023-03-20  4:33     ` Dmitry Torokhov
  0 siblings, 1 reply; 4+ messages in thread
From: Andi Shyti @ 2023-03-18 18:00 UTC (permalink / raw)
  To: Matthias Benkmann
  Cc: linux-input, dmitry.torokhov, Nate Yocom, hadess,
	benjamin.tissoires, linux-kernel, Pavel Rojtberg

On Sat, Mar 18, 2023 at 04:21:06PM +0100, Matthias Benkmann wrote:
> When the linked patch was applied,

Please refer to the patch as "commit fff1011a26d6 ("Input: xpad -
add X-Box Adaptive Profile button")" and not as "linked patch".

> one hunk ended up in the wrong function. This patch moves it to where
> it probably belongs.

probably? We need to be sure here :)

Besides, please, use the imperative form, not "this patch moves"
but "move what where", please be more specific.

Andi

> Link: https://lore.kernel.org/all/20220908173930.28940-6-nate@yocom.org/
> Fixes: fff1011a26d6 (Input: xpad - add X-Box Adaptive Profile button)
> Signed-off-by: Matthias Benkmann <matthias.benkmann@gmail.com>
> 
> ---
>  drivers/input/joystick/xpad.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/input/joystick/xpad.c b/drivers/input/joystick/xpad.c
> index f642ec8e92dd..29131f1a2f06 100644
> --- a/drivers/input/joystick/xpad.c
> +++ b/drivers/input/joystick/xpad.c
> @@ -781,9 +781,6 @@ static void xpad_process_packet(struct usb_xpad *xpad, u16 cmd, unsigned char *d
>  	input_report_key(dev, BTN_C, data[8]);
>  	input_report_key(dev, BTN_Z, data[9]);
>  
> -	/* Profile button has a value of 0-3, so it is reported as an axis */
> -	if (xpad->mapping & MAP_PROFILE_BUTTON)
> -		input_report_abs(dev, ABS_PROFILE, data[34]);
>  
>  	input_sync(dev);
>  }
> @@ -1061,6 +1058,10 @@ static void xpadone_process_packet(struct usb_xpad *xpad, u16 cmd, unsigned char
>  					(__u16) le16_to_cpup((__le16 *)(data + 8)));
>  		}
>  
> +		/* Profile button has a value of 0-3, so it is reported as an axis */
> +		if (xpad->mapping & MAP_PROFILE_BUTTON)
> +			input_report_abs(dev, ABS_PROFILE, data[34]);
> +
>  		/* paddle handling */
>  		/* based on SDL's SDL_hidapi_xboxone.c */
>  		if (xpad->mapping & MAP_PADDLES) {
> -- 
> 2.25.1
> 

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

* Re: [PATCH v3] Fix incorrectly applied patch for MAP_PROFILE_BUTTON
  2023-03-18 18:00   ` Andi Shyti
@ 2023-03-20  4:33     ` Dmitry Torokhov
  0 siblings, 0 replies; 4+ messages in thread
From: Dmitry Torokhov @ 2023-03-20  4:33 UTC (permalink / raw)
  To: Andi Shyti
  Cc: Matthias Benkmann, linux-input, Nate Yocom, hadess,
	benjamin.tissoires, linux-kernel, Pavel Rojtberg

On Sat, Mar 18, 2023 at 07:00:47PM +0100, Andi Shyti wrote:
> On Sat, Mar 18, 2023 at 04:21:06PM +0100, Matthias Benkmann wrote:
> > When the linked patch was applied,
> 
> Please refer to the patch as "commit fff1011a26d6 ("Input: xpad -
> add X-Box Adaptive Profile button")" and not as "linked patch".
> 
> > one hunk ended up in the wrong function. This patch moves it to where
> > it probably belongs.
> 
> probably? We need to be sure here :)
> 
> Besides, please, use the imperative form, not "this patch moves"
> but "move what where", please be more specific.

Reworded and applied, thank you.

-- 
Dmitry

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

end of thread, other threads:[~2023-03-20  4:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-18 14:41 [PATCH v2] Fix incorrectly applied patch for MAP_PROFILE_BUTTON Matthias Benkmann
2023-03-18 15:21 ` [PATCH v3] " Matthias Benkmann
2023-03-18 18:00   ` Andi Shyti
2023-03-20  4:33     ` 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 NNTP newsgroup(s).