Skip to contentSkip to conversation

HID: logitech-dj: add debug msg when exporting a HID++ report descriptors

PATCH Applied Filipe Laíns 3 participants 4 messages Jan 13, 2020 – Feb 12, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 HID: logitech-dj: add debug msg when exporting a HID++ report descriptors

When exporting all other types of report descriptors we print a debug message. Not doing so for HID++ descriptors makes unaware users think that no HID++ descriptor was exported.

---
 drivers/hid/hid-logitech-dj.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/hid/hid-logitech-dj.c +2 -0
index cc7fc71d8b05..8f17a29b5a94 100644
@@ -1368,6 +1368,8 @@ static int logi_dj_ll_parse(struct hid_device *hid)
 	}
 
 	if (djdev->reports_supported & HIDPP) {
+		dbg_hid("%s: sending a HID++ descriptor, reports_supported: %llx\n",
+			__func__, djdev->reports_supported);
 		rdcat(rdesc, &rsize, hidpp_descriptor,
 		      sizeof(hidpp_descriptor));
 	}
Signature · 1 line
2.24.1
#1 lore raw

Hi Filipe,

Quoted 4 lines · Filipe Laíns

When exporting all other types of report descriptors we print a debug message. Not doing so for HID++ descriptors makes unaware users think that no HID++ descriptor was exported.

Unless I am mistaken, those dbg_hid() calls are not displayed by default on any distribution. So I am not sure what is the benefit to add this one here when we are already not showing the rest to the users by default. There is a tiny improvement to have some code symmetry, but here, honestly, it doesn't feel that required.

Cheers,
Benjamin

Quoted 22 lines
---
 drivers/hid/hid-logitech-dj.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/hid/hid-logitech-dj.c +2 -1
index cc7fc71d8b05..8f17a29b5a94 100644
@@ -1368,6 +1368,8 @@ static int logi_dj_ll_parse(struct hid_device *hid)
        }
 
        if (djdev->reports_supported & HIDPP) {
+               dbg_hid("%s: sending a HID++ descriptor, reports_supported: %llx\n",
+                       __func__, djdev->reports_supported);
                rdcat(rdesc, &rsize, hidpp_descriptor,
                      sizeof(hidpp_descriptor));
        }
--

2.24.1

#2 lore raw
Quoted 7 lines · Benjamin Tissoires

Hi Filipe,

Quoted 3 lines · Filipe Laíns

When exporting all other types of report descriptors we print a debug message. Not doing so for HID++ descriptors makes unaware users think that no HID++ descriptor was exported.

Quoted 8 lines

Unless I am mistaken, those dbg_hid() calls are not displayed by default on any distribution. So I am not sure what is the benefit to add this one here when we are already not showing the rest to the users by default. There is a tiny improvement to have some code symmetry, but here, honestly, it doesn't feel that required.

Cheers,
Benjamin

Hi Benjamin,

As far as I know, they aren't. This was just a nitpick. As I already had the code locally I decided to just go ahead and submit the patch. But noted, I won't submit any more of this nitpick patches.

Quoted 12 lines
Quoted 12 lines
---
 drivers/hid/hid-logitech-dj.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/hid/hid-logitech-dj.c +0 -0
index cc7fc71d8b05..8f17a29b5a94 100644
@@ -1368,6 +1368,8 @@ static int logi_dj_ll_parse(struct hid_device *hid)
        }
 
Quoted 9 lines
Quoted 9 lines
drivers/hid/hid-logitech-dj.c +2 -1
        if (djdev->reports_supported & HIDPP) {
+               dbg_hid("%s: sending a HID++ descriptor, reports_supported: %llx\n",
+                       __func__, djdev->reports_supported);
                rdcat(rdesc, &rsize, hidpp_descriptor,
                      sizeof(hidpp_descriptor));
        }
--

2.24.1

Thank you,
Filipe Laíns

maintainer Applied
#3 lore raw
In reply to Filipe Laíns
Quoted 14 lines · Filipe Laíns

When exporting all other types of report descriptors we print a debug message. Not doing so for HID++ descriptors makes unaware users think that no HID++ descriptor was exported.

---
 drivers/hid/hid-logitech-dj.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/hid/hid-logitech-dj.c +0 -0
index cc7fc71d8b05..8f17a29b5a94 100644

drivers/hid/hid-logitech-dj.c static int logi_dj_ll_parse(struct hid_device *hid) · line 1374

Quoted 7 lines
drivers/hid/hid-logitech-dj.c +2 -0
@@ -1368,6 +1368,8 @@ static int logi_dj_ll_parse(struct hid_device *hid)
 	}
 
 	if (djdev->reports_supported & HIDPP) {
+		dbg_hid("%s: sending a HID++ descriptor, reports_supported: %llx\n",
+			__func__, djdev->reports_supported);
 		rdcat(rdesc, &rsize, hidpp_descriptor,
 		      sizeof(hidpp_descriptor));

Applied, thanks.

Signature · 2 lines
Jiri Kosina
SUSE Labs