lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <443a7a529f6987eb53b8b399c0cf9375e05e993c.camel@perches.com>
Date: Thu, 25 Jan 2024 13:54:04 -0800
From: Joe Perches <joe@...ches.com>
To: Sandeep C S <sandeep.cs@...sung.com>, Jiri Kosina <jikos@...nel.org>, 
	Benjamin Tissoires <benjamin.tissoires@...hat.com>
Cc: gaudium.lee@...sung.com, ih0923.kim@...sung.com,
 suhyun_.kim@...sung.com,  jitender.s21@...sung.com, junwan.cho@...sung.com,
 linux-input@...r.kernel.org,  linux-kernel@...r.kernel.org
Subject: Re: [HID Patchsets for Samsung driver v4 2/6] HID: Samsung : Fix
 the checkpatch complain. Rewritten code using memcmp where applicable.

On Thu, 2024-01-25 at 10:06 +0530, Sandeep C S wrote:
> Resolved warnings found by checkpatch.pl script.
[]
> diff --git a/drivers/hid/hid-samsung.c b/drivers/hid/hid-samsung.c
> @@ -107,17 +99,39 @@ static int samsung_kbd_mouse_input_mapping(struct hid_device *hdev,
>  
>  	switch (usage->hid & HID_USAGE) {
>  	/* report 2 */
> -	case 0x183: samsung_kbd_mouse_map_key_clear(KEY_MEDIA); break;
> -	case 0x195: samsung_kbd_mouse_map_key_clear(KEY_EMAIL);	break;
> -	case 0x196: samsung_kbd_mouse_map_key_clear(KEY_CALC); break;
> -	case 0x197: samsung_kbd_mouse_map_key_clear(KEY_COMPUTER); break;
> -	case 0x22b: samsung_kbd_mouse_map_key_clear(KEY_SEARCH); break;
> -	case 0x22c: samsung_kbd_mouse_map_key_clear(KEY_WWW); break;
> -	case 0x22d: samsung_kbd_mouse_map_key_clear(KEY_BACK); break;
> -	case 0x22e: samsung_kbd_mouse_map_key_clear(KEY_FORWARD); break;
> -	case 0x22f: samsung_kbd_mouse_map_key_clear(KEY_FAVORITES); break;
> -	case 0x230: samsung_kbd_mouse_map_key_clear(KEY_REFRESH); break;
> -	case 0x231: samsung_kbd_mouse_map_key_clear(KEY_STOP); break;


It's rather smaller code to remove the call duplication and use
a static const struct and for loop as suggested here:

https://lore.kernel.org/lkml/10aeef4ddd523b85ab34327bf384119d0d4b6567.camel@perches.com/


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ