LKML Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] HID: logitech: Use HIDPP_RECEIVER_INDEX instead of 0xff
@ 2020-07-05  2:48 Mazin Rezk
  2020-07-06 12:40 ` Filipe Laíns
  2020-07-07 10:37 ` Jiri Kosina
  0 siblings, 2 replies; 3+ messages in thread
From: Mazin Rezk @ 2020-07-05  2:48 UTC (permalink / raw)
  To: linux-input, linux-kernel, jikos, Benjamin Tissoires

Some parts of hid-logitech-dj explicitly referred to 0xff for the
receiver index. This patch changes those references to the
HIDPP_RECEIVER_INDEX definition.

Signed-off-by: Mazin Rezk <mnrzk@protonmail.com>
---
 drivers/hid/hid-logitech-dj.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/hid/hid-logitech-dj.c b/drivers/hid/hid-logitech-dj.c
index 48dff5d6b605..a78c13cc9f47 100644
--- a/drivers/hid/hid-logitech-dj.c
+++ b/drivers/hid/hid-logitech-dj.c
@@ -1153,7 +1153,7 @@ static int logi_dj_recv_query_paired_devices(struct dj_receiver_dev *djrcv_dev)
 	if (!dj_report)
 		return -ENOMEM;
 	dj_report->report_id = REPORT_ID_DJ_SHORT;
-	dj_report->device_index = 0xFF;
+	dj_report->device_index = HIDPP_RECEIVER_INDEX;
 	dj_report->report_type = REPORT_TYPE_CMD_GET_PAIRED_DEVICES;
 	retval = logi_dj_recv_send_report(djrcv_dev, dj_report);
 	kfree(dj_report);
@@ -1175,7 +1175,7 @@ static int logi_dj_recv_switch_to_dj_mode(struct dj_receiver_dev *djrcv_dev,

 	if (djrcv_dev->type == recvr_type_dj) {
 		dj_report->report_id = REPORT_ID_DJ_SHORT;
-		dj_report->device_index = 0xFF;
+		dj_report->device_index = HIDPP_RECEIVER_INDEX;
 		dj_report->report_type = REPORT_TYPE_CMD_SWITCH;
 		dj_report->report_params[CMD_SWITCH_PARAM_DEVBITFIELD] = 0x3F;
 		dj_report->report_params[CMD_SWITCH_PARAM_TIMEOUT_SECONDS] =
@@ -1204,7 +1204,7 @@ static int logi_dj_recv_switch_to_dj_mode(struct dj_receiver_dev *djrcv_dev,
 	memset(buf, 0, HIDPP_REPORT_SHORT_LENGTH);

 	buf[0] = REPORT_ID_HIDPP_SHORT;
-	buf[1] = 0xFF;
+	buf[1] = HIDPP_RECEIVER_INDEX;
 	buf[2] = 0x80;
 	buf[3] = 0x00;
 	buf[4] = 0x00;
--
2.27.0

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

* Re: [PATCH] HID: logitech: Use HIDPP_RECEIVER_INDEX instead of 0xff
  2020-07-05  2:48 [PATCH] HID: logitech: Use HIDPP_RECEIVER_INDEX instead of 0xff Mazin Rezk
@ 2020-07-06 12:40 ` Filipe Laíns
  2020-07-07 10:37 ` Jiri Kosina
  1 sibling, 0 replies; 3+ messages in thread
From: Filipe Laíns @ 2020-07-06 12:40 UTC (permalink / raw)
  To: Mazin Rezk, linux-input, linux-kernel, jikos, Benjamin Tissoires


[-- Attachment #1: Type: text/plain, Size: 1947 bytes --]

On Sun, 2020-07-05 at 02:48 +0000, Mazin Rezk wrote:
> Some parts of hid-logitech-dj explicitly referred to 0xff for the
> receiver index. This patch changes those references to the
> HIDPP_RECEIVER_INDEX definition.
> 
> Signed-off-by: Mazin Rezk <mnrzk@protonmail.com>
> ---
>  drivers/hid/hid-logitech-dj.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/hid/hid-logitech-dj.c b/drivers/hid/hid-
> logitech-dj.c
> index 48dff5d6b605..a78c13cc9f47 100644
> --- a/drivers/hid/hid-logitech-dj.c
> +++ b/drivers/hid/hid-logitech-dj.c
> @@ -1153,7 +1153,7 @@ static int
> logi_dj_recv_query_paired_devices(struct dj_receiver_dev *djrcv_dev)
>  	if (!dj_report)
>  		return -ENOMEM;
>  	dj_report->report_id = REPORT_ID_DJ_SHORT;
> -	dj_report->device_index = 0xFF;
> +	dj_report->device_index = HIDPP_RECEIVER_INDEX;
>  	dj_report->report_type = REPORT_TYPE_CMD_GET_PAIRED_DEVICES;
>  	retval = logi_dj_recv_send_report(djrcv_dev, dj_report);
>  	kfree(dj_report);
> @@ -1175,7 +1175,7 @@ static int
> logi_dj_recv_switch_to_dj_mode(struct dj_receiver_dev *djrcv_dev,
> 
>  	if (djrcv_dev->type == recvr_type_dj) {
>  		dj_report->report_id = REPORT_ID_DJ_SHORT;
> -		dj_report->device_index = 0xFF;
> +		dj_report->device_index = HIDPP_RECEIVER_INDEX;
>  		dj_report->report_type = REPORT_TYPE_CMD_SWITCH;
>  		dj_report->report_params[CMD_SWITCH_PARAM_DEVBITFIELD]
> = 0x3F;
>  		dj_report-
> >report_params[CMD_SWITCH_PARAM_TIMEOUT_SECONDS] =
> @@ -1204,7 +1204,7 @@ static int
> logi_dj_recv_switch_to_dj_mode(struct dj_receiver_dev *djrcv_dev,
>  	memset(buf, 0, HIDPP_REPORT_SHORT_LENGTH);
> 
>  	buf[0] = REPORT_ID_HIDPP_SHORT;
> -	buf[1] = 0xFF;
> +	buf[1] = HIDPP_RECEIVER_INDEX;
>  	buf[2] = 0x80;
>  	buf[3] = 0x00;
>  	buf[4] = 0x00;
> --
> 2.27.0

This is correct :)

Reviewed-by: Filipe Laíns <lains@archlinux.org>

Cheers,
Filipe Laíns

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: [PATCH] HID: logitech: Use HIDPP_RECEIVER_INDEX instead of 0xff
  2020-07-05  2:48 [PATCH] HID: logitech: Use HIDPP_RECEIVER_INDEX instead of 0xff Mazin Rezk
  2020-07-06 12:40 ` Filipe Laíns
@ 2020-07-07 10:37 ` Jiri Kosina
  1 sibling, 0 replies; 3+ messages in thread
From: Jiri Kosina @ 2020-07-07 10:37 UTC (permalink / raw)
  To: Mazin Rezk; +Cc: linux-input, linux-kernel, Benjamin Tissoires

On Sun, 5 Jul 2020, Mazin Rezk wrote:

> Some parts of hid-logitech-dj explicitly referred to 0xff for the
> receiver index. This patch changes those references to the
> HIDPP_RECEIVER_INDEX definition.

Applied, thanks.

-- 
Jiri Kosina
SUSE Labs


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

end of thread, back to index

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-05  2:48 [PATCH] HID: logitech: Use HIDPP_RECEIVER_INDEX instead of 0xff Mazin Rezk
2020-07-06 12:40 ` Filipe Laíns
2020-07-07 10:37 ` Jiri Kosina

LKML Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/lkml/0 lkml/git/0.git
	git clone --mirror https://lore.kernel.org/lkml/1 lkml/git/1.git
	git clone --mirror https://lore.kernel.org/lkml/2 lkml/git/2.git
	git clone --mirror https://lore.kernel.org/lkml/3 lkml/git/3.git
	git clone --mirror https://lore.kernel.org/lkml/4 lkml/git/4.git
	git clone --mirror https://lore.kernel.org/lkml/5 lkml/git/5.git
	git clone --mirror https://lore.kernel.org/lkml/6 lkml/git/6.git
	git clone --mirror https://lore.kernel.org/lkml/7 lkml/git/7.git
	git clone --mirror https://lore.kernel.org/lkml/8 lkml/git/8.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 lkml lkml/ https://lore.kernel.org/lkml \
		linux-kernel@vger.kernel.org
	public-inbox-index lkml

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-kernel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git