aboutsummaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/char/keyboard.c8
-rw-r--r--drivers/input/joystick/iforce/iforce-ff.c8
-rw-r--r--drivers/usb/input/fixp-arith.h15
3 files changed, 14 insertions, 17 deletions
diff --git a/drivers/char/keyboard.c b/drivers/char/keyboard.c
index edd996f6fb8..1b63acfc6c7 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
*/
static void k_dead(struct vc_data *vc, unsigned char value, char up_flag, struct pt_regs *regs)
{
- static unsigned char ret_diacr[NR_DEAD] = {'`', '\'', '^', '~', '"', ',' };
+ static const unsigned char ret_diacr[NR_DEAD] = {'`', '\'', '^', '~', '"', ',' };
value = ret_diacr[value];
k_deadunicode(vc, value, up_flag, regs);
}
@@ -710,8 +710,8 @@ static void k_cur(struct vc_data *vc, unsigned char value, char up_flag, struct
static void k_pad(struct vc_data *vc, unsigned char value, char up_flag, struct pt_regs *regs)
{
- static const char *pad_chars = "0123456789+-*/\015,.?()#";
- static const char *app_map = "pqrstuvwxylSRQMnnmPQS";
+ static const char pad_chars[] = "0123456789+-*/\015,.?()#";
+ static const char app_map[] = "pqrstuvwxylSRQMnnmPQS";
if (up_flag)
return; /* no action, if this is a key release */
@@ -1036,7 +1036,7 @@ static void kbd_refresh_leds(struct input_handle *handle)
#define HW_RAW(dev) (test_bit(EV_MSC, dev->evbit) && test_bit(MSC_RAW, dev->mscbit) &&\
((dev)->id.bustype == BUS_I8042) && ((dev)->id.vendor == 0x0001) && ((dev)->id.product == 0x0001))
-static unsigned short x86_keycodes[256] =
+static const unsigned short x86_keycodes[256] =
{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
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 2b8e8456c9f..50c90765aee 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,
iforce->device_memory.start, iforce->device_memory.end, 2L,
NULL, NULL)) {
mutex_unlock(&iforce->mem_mutex);
- return -ENOMEM;
+ return -ENOSPC;
}
mutex_unlock(&iforce->mem_mutex);
}
@@ -80,7 +80,7 @@ static int make_period_modifier(struct iforce* iforce,
iforce->device_memory.start, iforce->device_memory.end, 2L,
NULL, NULL)) {
mutex_unlock(&iforce->mem_mutex);
- return -ENOMEM;
+ return -ENOSPC;
}
mutex_unlock(&iforce->mem_mutex);
}
@@ -120,7 +120,7 @@ static int make_envelope_modifier(struct iforce* iforce,
iforce->device_memory.start, iforce->device_memory.end, 2L,
NULL, NULL)) {
mutex_unlock(&iforce->mem_mutex);
- return -ENOMEM;
+ return -ENOSPC;
}
mutex_unlock(&iforce->mem_mutex);
}
@@ -157,7 +157,7 @@ static int make_condition_modifier(struct iforce* iforce,
iforce->device_memory.start, iforce->device_memory.end, 2L,
NULL, NULL)) {
mutex_unlock(&iforce->mem_mutex);
- return -ENOMEM;
+ return -ENOSPC;
}
mutex_unlock(&iforce->mem_mutex);
}
diff --git a/drivers/usb/input/fixp-arith.h b/drivers/usb/input/fixp-arith.h
index b44d398de07..ed3d2da0c48 100644
--- a/drivers/usb/input/fixp-arith.h
+++ b/drivers/usb/input/fixp-arith.h
@@ -2,8 +2,6 @@
#define _FIXP_ARITH_H
/*
- * $$
- *
* Simplistic fixed-point arithmetics.
* Hmm, I'm probably duplicating some code :(
*
@@ -31,20 +29,20 @@
#include <linux/types.h>
-// The type representing fixed-point values
+/* The type representing fixed-point values */
typedef s16 fixp_t;
#define FRAC_N 8
#define FRAC_MASK ((1<<FRAC_N)-1)
-// Not to be used directly. Use fixp_{cos,sin}
-static const fixp_t cos_table[45] = {
+/* Not to be used directly. Use fixp_{cos,sin} */
+static const fixp_t cos_table[46] = {
0x0100, 0x00FF, 0x00FF, 0x00FE, 0x00FD, 0x00FC, 0x00FA, 0x00F8,
0x00F6, 0x00F3, 0x00F0, 0x00ED, 0x00E9, 0x00E6, 0x00E2, 0x00DD,
0x00D9, 0x00D4, 0x00CF, 0x00C9, 0x00C4, 0x00BE, 0x00B8, 0x00B1,
0x00AB, 0x00A4, 0x009D, 0x0096, 0x008F, 0x0087, 0x0080, 0x0078,
0x0070, 0x0068, 0x005F, 0x0057, 0x004F, 0x0046, 0x003D, 0x0035,
- 0x002C, 0x0023, 0x001A, 0x0011, 0x0008
+ 0x002C, 0x0023, 0x001A, 0x0011, 0x0008, 0x0000
};
@@ -68,9 +66,8 @@ static inline fixp_t fixp_cos(unsigned int degrees)
int quadrant = (degrees / 90) & 3;
unsigned int i = degrees % 90;
- if (quadrant == 1 || quadrant == 3) {
- i = 89 - i;
- }
+ if (quadrant == 1 || quadrant == 3)
+ i = 90 - i;
i >>= 1;