diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/char/keyboard.c | 8 | ||||
-rw-r--r-- | drivers/input/joystick/iforce/iforce-ff.c | 8 | ||||
-rw-r--r-- | drivers/usb/input/fixp-arith.h | 15 |
3 files changed, 14 insertions, 17 deletions
diff --git a/drivers/char/keyboard.c b/drivers/char/keyboard.c index edd996f6fb87..1b63acfc6c78 100644 --- a/drivers/char/keyboard.c +++ b/drivers/char/keyboard.c | |||
@@ -673,7 +673,7 @@ static void k_dead2(struct vc_data *vc, unsigned char value, char up_flag, struc | |||
673 | */ | 673 | */ |
674 | static void k_dead(struct vc_data *vc, unsigned char value, char up_flag, struct pt_regs *regs) | 674 | static void k_dead(struct vc_data *vc, unsigned char value, char up_flag, struct pt_regs *regs) |
675 | { | 675 | { |
676 | static unsigned char ret_diacr[NR_DEAD] = {'`', '\'', '^', '~', '"', ',' }; | 676 | static const unsigned char ret_diacr[NR_DEAD] = {'`', '\'', '^', '~', '"', ',' }; |
677 | value = ret_diacr[value]; | 677 | value = ret_diacr[value]; |
678 | k_deadunicode(vc, value, up_flag, regs); | 678 | k_deadunicode(vc, value, up_flag, regs); |
679 | } | 679 | } |
@@ -710,8 +710,8 @@ static void k_cur(struct vc_data *vc, unsigned char value, char up_flag, struct | |||
710 | 710 | ||
711 | static void k_pad(struct vc_data *vc, unsigned char value, char up_flag, struct pt_regs *regs) | 711 | static void k_pad(struct vc_data *vc, unsigned char value, char up_flag, struct pt_regs *regs) |
712 | { | 712 | { |
713 | static const char *pad_chars = "0123456789+-*/\015,.?()#"; | 713 | static const char pad_chars[] = "0123456789+-*/\015,.?()#"; |
714 | static const char *app_map = "pqrstuvwxylSRQMnnmPQS"; | 714 | static const char app_map[] = "pqrstuvwxylSRQMnnmPQS"; |
715 | 715 | ||
716 | if (up_flag) | 716 | if (up_flag) |
717 | return; /* no action, if this is a key release */ | 717 | return; /* no action, if this is a key release */ |
@@ -1036,7 +1036,7 @@ static void kbd_refresh_leds(struct input_handle *handle) | |||
1036 | #define HW_RAW(dev) (test_bit(EV_MSC, dev->evbit) && test_bit(MSC_RAW, dev->mscbit) &&\ | 1036 | #define HW_RAW(dev) (test_bit(EV_MSC, dev->evbit) && test_bit(MSC_RAW, dev->mscbit) &&\ |
1037 | ((dev)->id.bustype == BUS_I8042) && ((dev)->id.vendor == 0x0001) && ((dev)->id.product == 0x0001)) | 1037 | ((dev)->id.bustype == BUS_I8042) && ((dev)->id.vendor == 0x0001) && ((dev)->id.product == 0x0001)) |
1038 | 1038 | ||
1039 | static unsigned short x86_keycodes[256] = | 1039 | static const unsigned short x86_keycodes[256] = |
1040 | { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, | 1040 | { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, |
1041 | 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, | 1041 | 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, |
1042 | 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, | 1042 | 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, |
diff --git a/drivers/input/joystick/iforce/iforce-ff.c b/drivers/input/joystick/iforce/iforce-ff.c index 2b8e8456c9fa..50c90765aee1 100644 --- a/drivers/input/joystick/iforce/iforce-ff.c +++ b/drivers/input/joystick/iforce/iforce-ff.c | |||
@@ -47,7 +47,7 @@ static int make_magnitude_modifier(struct iforce* iforce, | |||
47 | iforce->device_memory.start, iforce->device_memory.end, 2L, | 47 | iforce->device_memory.start, iforce->device_memory.end, 2L, |
48 | NULL, NULL)) { | 48 | NULL, NULL)) { |
49 | mutex_unlock(&iforce->mem_mutex); | 49 | mutex_unlock(&iforce->mem_mutex); |
50 | return -ENOMEM; | 50 | return -ENOSPC; |
51 | } | 51 | } |
52 | mutex_unlock(&iforce->mem_mutex); | 52 | mutex_unlock(&iforce->mem_mutex); |
53 | } | 53 | } |
@@ -80,7 +80,7 @@ static int make_period_modifier(struct iforce* iforce, | |||
80 | iforce->device_memory.start, iforce->device_memory.end, 2L, | 80 | iforce->device_memory.start, iforce->device_memory.end, 2L, |
81 | NULL, NULL)) { | 81 | NULL, NULL)) { |
82 | mutex_unlock(&iforce->mem_mutex); | 82 | mutex_unlock(&iforce->mem_mutex); |
83 | return -ENOMEM; | 83 | return -ENOSPC; |
84 | } | 84 | } |
85 | mutex_unlock(&iforce->mem_mutex); | 85 | mutex_unlock(&iforce->mem_mutex); |
86 | } | 86 | } |
@@ -120,7 +120,7 @@ static int make_envelope_modifier(struct iforce* iforce, | |||
120 | iforce->device_memory.start, iforce->device_memory.end, 2L, | 120 | iforce->device_memory.start, iforce->device_memory.end, 2L, |
121 | NULL, NULL)) { | 121 | NULL, NULL)) { |
122 | mutex_unlock(&iforce->mem_mutex); | 122 | mutex_unlock(&iforce->mem_mutex); |
123 | return -ENOMEM; | 123 | return -ENOSPC; |
124 | } | 124 | } |
125 | mutex_unlock(&iforce->mem_mutex); | 125 | mutex_unlock(&iforce->mem_mutex); |
126 | } | 126 | } |
@@ -157,7 +157,7 @@ static int make_condition_modifier(struct iforce* iforce, | |||
157 | iforce->device_memory.start, iforce->device_memory.end, 2L, | 157 | iforce->device_memory.start, iforce->device_memory.end, 2L, |
158 | NULL, NULL)) { | 158 | NULL, NULL)) { |
159 | mutex_unlock(&iforce->mem_mutex); | 159 | mutex_unlock(&iforce->mem_mutex); |
160 | return -ENOMEM; | 160 | return -ENOSPC; |
161 | } | 161 | } |
162 | mutex_unlock(&iforce->mem_mutex); | 162 | mutex_unlock(&iforce->mem_mutex); |
163 | } | 163 | } |
diff --git a/drivers/usb/input/fixp-arith.h b/drivers/usb/input/fixp-arith.h index b44d398de071..ed3d2da0c485 100644 --- a/drivers/usb/input/fixp-arith.h +++ b/drivers/usb/input/fixp-arith.h | |||
@@ -2,8 +2,6 @@ | |||
2 | #define _FIXP_ARITH_H | 2 | #define _FIXP_ARITH_H |
3 | 3 | ||
4 | /* | 4 | /* |
5 | * $$ | ||
6 | * | ||
7 | * Simplistic fixed-point arithmetics. | 5 | * Simplistic fixed-point arithmetics. |
8 | * Hmm, I'm probably duplicating some code :( | 6 | * Hmm, I'm probably duplicating some code :( |
9 | * | 7 | * |
@@ -31,20 +29,20 @@ | |||
31 | 29 | ||
32 | #include <linux/types.h> | 30 | #include <linux/types.h> |
33 | 31 | ||
34 | // The type representing fixed-point values | 32 | /* The type representing fixed-point values */ |
35 | typedef s16 fixp_t; | 33 | typedef s16 fixp_t; |
36 | 34 | ||
37 | #define FRAC_N 8 | 35 | #define FRAC_N 8 |
38 | #define FRAC_MASK ((1<<FRAC_N)-1) | 36 | #define FRAC_MASK ((1<<FRAC_N)-1) |
39 | 37 | ||
40 | // Not to be used directly. Use fixp_{cos,sin} | 38 | /* Not to be used directly. Use fixp_{cos,sin} */ |
41 | static const fixp_t cos_table[45] = { | 39 | static const fixp_t cos_table[46] = { |
42 | 0x0100, 0x00FF, 0x00FF, 0x00FE, 0x00FD, 0x00FC, 0x00FA, 0x00F8, | 40 | 0x0100, 0x00FF, 0x00FF, 0x00FE, 0x00FD, 0x00FC, 0x00FA, 0x00F8, |
43 | 0x00F6, 0x00F3, 0x00F0, 0x00ED, 0x00E9, 0x00E6, 0x00E2, 0x00DD, | 41 | 0x00F6, 0x00F3, 0x00F0, 0x00ED, 0x00E9, 0x00E6, 0x00E2, 0x00DD, |
44 | 0x00D9, 0x00D4, 0x00CF, 0x00C9, 0x00C4, 0x00BE, 0x00B8, 0x00B1, | 42 | 0x00D9, 0x00D4, 0x00CF, 0x00C9, 0x00C4, 0x00BE, 0x00B8, 0x00B1, |
45 | 0x00AB, 0x00A4, 0x009D, 0x0096, 0x008F, 0x0087, 0x0080, 0x0078, | 43 | 0x00AB, 0x00A4, 0x009D, 0x0096, 0x008F, 0x0087, 0x0080, 0x0078, |
46 | 0x0070, 0x0068, 0x005F, 0x0057, 0x004F, 0x0046, 0x003D, 0x0035, | 44 | 0x0070, 0x0068, 0x005F, 0x0057, 0x004F, 0x0046, 0x003D, 0x0035, |
47 | 0x002C, 0x0023, 0x001A, 0x0011, 0x0008 | 45 | 0x002C, 0x0023, 0x001A, 0x0011, 0x0008, 0x0000 |
48 | }; | 46 | }; |
49 | 47 | ||
50 | 48 | ||
@@ -68,9 +66,8 @@ static inline fixp_t fixp_cos(unsigned int degrees) | |||
68 | int quadrant = (degrees / 90) & 3; | 66 | int quadrant = (degrees / 90) & 3; |
69 | unsigned int i = degrees % 90; | 67 | unsigned int i = degrees % 90; |
70 | 68 | ||
71 | if (quadrant == 1 || quadrant == 3) { | 69 | if (quadrant == 1 || quadrant == 3) |
72 | i = 89 - i; | 70 | i = 90 - i; |
73 | } | ||
74 | 71 | ||
75 | i >>= 1; | 72 | i >>= 1; |
76 | 73 | ||