From: Simao Gomes Viana <devel@superboring.dev>
To: Jiri Kosina <jikos@kernel.org>
Cc: Simao Gomes Viana <devel@superboring.dev>, linux-input@vger.kernel.org
Subject: [PATCH 2/4] drivers: hid: code style fixes
Date: Tue, 16 Jun 2020 21:00:42 +0200 [thread overview]
Message-ID: <20200616190044.126928-2-devel@superboring.dev> (raw)
In-Reply-To: <20200616190044.126928-1-devel@superboring.dev>
Signed-off-by: Simao Gomes Viana <devel@superboring.dev>
---
drivers/hid/hid-input.c | 99 ++++++++++++++++++++++++++++-------------
1 file changed, 67 insertions(+), 32 deletions(-)
diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c
index 5a7282a0abbb..e70066e4c545 100644
--- a/drivers/hid/hid-input.c
+++ b/drivers/hid/hid-input.c
@@ -751,17 +751,17 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel
case HID_UP_LED:
switch (usage->hid & 0xffff) { /* HID-Value: */
- case 0x01: map_led (LED_NUML); break; /* "Num Lock" */
- case 0x02: map_led (LED_CAPSL); break; /* "Caps Lock" */
- case 0x03: map_led (LED_SCROLLL); break; /* "Scroll Lock" */
- case 0x04: map_led (LED_COMPOSE); break; /* "Compose" */
- case 0x05: map_led (LED_KANA); break; /* "Kana" */
- case 0x27: map_led (LED_SLEEP); break; /* "Stand-By" */
- case 0x4c: map_led (LED_SUSPEND); break; /* "System Suspend" */
- case 0x09: map_led (LED_MUTE); break; /* "Mute" */
- case 0x4b: map_led (LED_MISC); break; /* "Generic Indicator" */
- case 0x19: map_led (LED_MAIL); break; /* "Message Waiting" */
- case 0x4d: map_led (LED_CHARGING); break; /* "External Power Connected" */
+ case 0x01: map_led(LED_NUML); break; /* "Num Lock" */
+ case 0x02: map_led(LED_CAPSL); break; /* "Caps Lock" */
+ case 0x03: map_led(LED_SCROLLL); break; /* "Scroll Lock" */
+ case 0x04: map_led(LED_COMPOSE); break; /* "Compose" */
+ case 0x05: map_led(LED_KANA); break; /* "Kana" */
+ case 0x27: map_led(LED_SLEEP); break; /* "Stand-By" */
+ case 0x4c: map_led(LED_SUSPEND); break; /* "System Suspend" */
+ case 0x09: map_led(LED_MUTE); break; /* "Mute" */
+ case 0x4b: map_led(LED_MISC); break; /* "Generic Indicator" */
+ case 0x19: map_led(LED_MAIL); break; /* "Message Waiting" */
+ case 0x4d: map_led(LED_CHARGING); break; /* "External Power Connected" */
default: goto ignore;
}
@@ -1066,29 +1066,61 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel
case HID_UP_HPVENDOR: /* Reported on a Dutch layout HP5308 */
set_bit(EV_REP, input->evbit);
switch (usage->hid & HID_USAGE) {
- case 0x021: map_key_clear(KEY_PRINT); break;
- case 0x070: map_key_clear(KEY_HP); break;
- case 0x071: map_key_clear(KEY_CAMERA); break;
- case 0x072: map_key_clear(KEY_SOUND); break;
- case 0x073: map_key_clear(KEY_QUESTION); break;
- case 0x080: map_key_clear(KEY_EMAIL); break;
- case 0x081: map_key_clear(KEY_CHAT); break;
- case 0x082: map_key_clear(KEY_SEARCH); break;
- case 0x083: map_key_clear(KEY_CONNECT); break;
- case 0x084: map_key_clear(KEY_FINANCE); break;
- case 0x085: map_key_clear(KEY_SPORT); break;
- case 0x086: map_key_clear(KEY_SHOP); break;
- default: goto ignore;
+ case 0x021:
+ map_key_clear(KEY_PRINT);
+ break;
+ case 0x070:
+ map_key_clear(KEY_HP);
+ break;
+ case 0x071:
+ map_key_clear(KEY_CAMERA);
+ break;
+ case 0x072:
+ map_key_clear(KEY_SOUND);
+ break;
+ case 0x073:
+ map_key_clear(KEY_QUESTION);
+ break;
+ case 0x080:
+ map_key_clear(KEY_EMAIL);
+ break;
+ case 0x081:
+ map_key_clear(KEY_CHAT);
+ break;
+ case 0x082:
+ map_key_clear(KEY_SEARCH);
+ break;
+ case 0x083:
+ map_key_clear(KEY_CONNECT);
+ break;
+ case 0x084:
+ map_key_clear(KEY_FINANCE);
+ break;
+ case 0x085:
+ map_key_clear(KEY_SPORT);
+ break;
+ case 0x086:
+ map_key_clear(KEY_SHOP);
+ break;
+ default:
+ goto ignore;
}
break;
case HID_UP_HPVENDOR2:
set_bit(EV_REP, input->evbit);
switch (usage->hid & HID_USAGE) {
- case 0x001: map_key_clear(KEY_MICMUTE); break;
- case 0x003: map_key_clear(KEY_BRIGHTNESSDOWN); break;
- case 0x004: map_key_clear(KEY_BRIGHTNESSUP); break;
- default: goto ignore;
+ case 0x001:
+ map_key_clear(KEY_MICMUTE);
+ break;
+ case 0x003:
+ map_key_clear(KEY_BRIGHTNESSDOWN);
+ break;
+ case 0x004:
+ map_key_clear(KEY_BRIGHTNESSUP);
+ break;
+ default:
+ goto ignore;
}
break;
@@ -1108,13 +1140,16 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel
case HID_UP_PID:
switch (usage->hid & HID_USAGE) {
- case 0xa4: map_key_clear(BTN_DEAD); break;
- default: goto ignore;
+ case 0xa4:
+ map_key_clear(BTN_DEAD);
+ break;
+ default:
+ goto ignore;
}
break;
default:
- unknown:
+unknown:
if (field->report_size == 1) {
if (field->report->type == HID_OUTPUT_REPORT) {
map_led(LED_MISC);
@@ -1383,7 +1418,7 @@ void hidinput_hid_event(struct hid_device *hid, struct hid_field *field, struct
* skip the keycode translation and only forward real events.
*/
if (!(field->flags & (HID_MAIN_ITEM_RELATIVE |
- HID_MAIN_ITEM_BUFFERED_BYTE)) &&
+ HID_MAIN_ITEM_BUFFERED_BYTE)) &&
(field->flags & HID_MAIN_ITEM_VARIABLE) &&
usage->usage_index < field->maxusage &&
value == field->value[usage->usage_index])
--
2.27.0
next prev parent reply other threads:[~2020-06-16 19:06 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-16 19:00 [PATCH 1/4] drivers: hid: lightly fix code style Simao Gomes Viana
2020-06-16 19:00 ` Simao Gomes Viana [this message]
2020-06-16 19:00 ` [PATCH 3/4] drivers: hid: change unsigned to unsigned int Simao Gomes Viana
2020-06-16 19:00 ` [PATCH 4/4] drivers: hid: move trailing block comment close to new line Simao Gomes Viana
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200616190044.126928-2-devel@superboring.dev \
--to=devel@superboring.dev \
--cc=jikos@kernel.org \
--cc=linux-input@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).