From 42dd37ade1869064b3404ec8e62ca52c8e323985 Mon Sep 17 00:00:00 2001 From: knolax <1339802534.kk@gmail.com> Date: Fri, 29 Dec 2017 15:48:05 -0500 Subject: fixed c90 mixed declaration warnings. --- skey.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/skey.c b/skey.c index 55c86b4..bc94680 100644 --- a/skey.c +++ b/skey.c @@ -138,6 +138,8 @@ void clearkeystate(void) { * not going to happen. */ int processkey(int row, int column, int state) { + //the bitmask to use for the current keymap mode + int keystate_bitmask; //sanity checks if ((column < 10) && (column >= 0) && (row < 3) && (row >= 0)) { } else { @@ -147,8 +149,7 @@ int processkey(int row, int column, int state) { printk(KERN_ALERT "skey: keypress data sent to processkey() was invalid\n"); return -EINVAL; } - //finds the KEYSTATE_* bitmask to use with the current keymapping - int keystate_bitmask; + //finds the KEYSTATE_* bitmask to use with the current keymapping switch (current_keymap) { case 0: keystate_bitmask = KEYSTATE_ALPHA; @@ -282,10 +283,10 @@ int processkey(int row, int column, int state) { *This function is called every timer-period to actually read the keyboard */ int skey_update_thread (void *data) { - printk(KERN_INFO "skey: starting update thread\n"); //thread stuff //thread priority const struct sched_param PARAM = { .sched_priority = 45}; + printk(KERN_INFO "skey: starting update thread\n"); //sets the thread to be kinda realtime sched_setscheduler(current, SCHED_FIFO, &PARAM); printk(KERN_INFO "skey: started update thread\n"); @@ -336,7 +337,9 @@ int skey_update_thread (void *data) { static int __init skey_init (void) { printk(KERN_INFO "skey: module initiating...\n"); if (USE_GPIO) { + //indexes for row and column pin init loops int i = 0; + int j = 0; //claims the column pins while (i < 10) { //checks to see if the gpios are valid @@ -354,8 +357,7 @@ static int __init skey_init (void) { } i++; } - //ditto for row pins - int j = 0; + //ditto for row pins while (j < 3) { //checks to see if the gpios are valid if (!gpio_is_valid(row_pins[j])) { @@ -424,11 +426,11 @@ static void __exit skey_exit (void) { if (USE_GPIO) { //frees column and row pins int i = 0; + int j = 0; while (i < 10) { gpio_free(column_pins[i]); i++; } - int j = 0; while (j < 3) { gpio_free(row_pins[j]); j++; -- cgit v1.1