Skip to contentSkip to conversation

HID: core: lower log level for unknown main item tags to warnings

PATCH Applied Hans de Goede 3 participants 3 messages Dec 6, 2017 – Dec 7, 2017 HID

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 HID: core: lower log level for unknown main item tags to warnings

Given all the effort distros have done with splash-screens to give users a nice clean boot experience, we really want dmesg --level=err to not print anything unless there is a real problem with either the hardware or the kernel. Buggy HID descriptors unfortunately happen all too often, so lower the log level to warning keep the console clear of error messages such as:

[  441.079664] apple 0005:05AC:0239.0003: unknown main item tag 0x0
---
 drivers/hid/hid-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hid/hid-core.c +1 -1
index 7297b1d1300c..c2560aae5542 100644
@@ -551,7 +551,7 @@ static int hid_parser_main(struct hid_parser *parser, struct hid_item *item)
 		ret = hid_add_field(parser, HID_FEATURE_REPORT, data);
 		break;
 	default:
-		hid_err(parser->device, "unknown main item tag 0x%x\n", item->tag);
+		hid_warn(parser->device, "unknown main item tag 0x%x\n", item->tag);
 		ret = 0;
 	}
 
Signature · 1 line
2.14.3
Acked-by on v1 1/1
#1 lore raw
Quoted 11 lines · Hans de Goede

Given all the effort distros have done with splash-screens to give users a nice clean boot experience, we really want dmesg --level=err to not print anything unless there is a real problem with either the hardware or the kernel. Buggy HID descriptors unfortunately happen all too often, so lower the log level to warning keep the console clear of error messages such as:

[  441.079664] apple 0005:05AC:0239.0003: unknown main item tag 0x0

---

Quoted 19 lines
 drivers/hid/hid-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hid/hid-core.c +1 -2
index 7297b1d1300c..c2560aae5542 100644
@@ -551,7 +551,7 @@ static int hid_parser_main(struct hid_parser *parser, struct hid_item *item)
                ret = hid_add_field(parser, HID_FEATURE_REPORT, data);
                break;
        default:
-               hid_err(parser->device, "unknown main item tag 0x%x\n", item->tag);
+               hid_warn(parser->device, "unknown main item tag 0x%x\n", item->tag);
                ret = 0;
        }
 
--

2.14.3

maintainer Applied
#2 lore raw
In reply to Hans de Goede
Quoted 19 lines · Hans de Goede

Given all the effort distros have done with splash-screens to give users a nice clean boot experience, we really want dmesg --level=err to not print anything unless there is a real problem with either the hardware or the kernel. Buggy HID descriptors unfortunately happen all too often, so lower the log level to warning keep the console clear of error messages such as:

[  441.079664] apple 0005:05AC:0239.0003: unknown main item tag 0x0
---
 drivers/hid/hid-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hid/hid-core.c +0 -0
index 7297b1d1300c..c2560aae5542 100644

drivers/hid/hid-core.c static int hid_parser_main(struct hid_parser *parser, struct hid_item *item) · line 555

Quoted 6 lines
drivers/hid/hid-core.c +1 -1
@@ -551,7 +551,7 @@ static int hid_parser_main(struct hid_parser *parser, struct hid_item *item)
 		ret = hid_add_field(parser, HID_FEATURE_REPORT, data);
 		break;
 	default:
-		hid_err(parser->device, "unknown main item tag 0x%x\n", item->tag);
+		hid_warn(parser->device, "unknown main item tag 0x%x\n", item->tag);
 		ret = 0;

Applied to for-4.15/upstream-fixes. Thanks,

Signature · 2 lines
Jiri Kosina
SUSE Labs