Re: [PATCH] hid/apple: add module parameter to swap the Command andOption keys

From: Jiri Slaby
Date: Fri Mar 06 2009 - 17:13:25 EST


On 6.3.2009 06:33, Paul Collins wrote:
--- a/drivers/hid/hid-apple.c
+++ b/drivers/hid/hid-apple.c
@@ -40,6 +40,11 @@ module_param(fnmode, uint, 0644);
MODULE_PARM_DESC(fnmode, "Mode of fn key on Apple keyboards (0 = disabled, "
"[1] = fkeyslast, 2 = fkeysfirst)");

+static unsigned int swapmodifiers = 0;

Nowadays compilers optimize this away already, but no need to initialize .bss stuff to zero anyway.

+module_param(swapmodifiers, uint, 0644);
+MODULE_PARM_DESC(fnmode, "Modifiers match labels or positions "

Weird first parameter => swapmodifiers.

Maybe this should rather be a bool instead of uint.

+ "([0] = labels, 1 = positions)");
+
struct apple_sc {
unsigned long quirks;
unsigned int fn_on;
@@ -123,6 +128,14 @@ static struct apple_key_translation apple_iso_keyboard[] = {
{ }
};

+static struct apple_key_translation apple_swap_modifiers[] = {

This might go into .rodata, right? => const

Anyway this is not feasible to do in this patch. Would you like to post a followup patch which will also modify the functions which use the translation tables?
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/