diff options
| author | Uwe Kleine-König <Uwe.Kleine-Koenig@digi.com> | 2008-08-08 12:14:36 -0400 |
|---|---|---|
| committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2008-08-08 12:20:22 -0400 |
| commit | ce25d7e90c7543f0046c3bdcdcc7594546c57dcc (patch) | |
| tree | 5a3388482eb61698269861d5a50969e59003234d /drivers/input | |
| parent | 57ffe9d539e0eb741bb9ca8f2834d210e70ee2e3 (diff) | |
Input: gpio-keys - simplify argument list for report_event
For now this only saves a few instructions (for gpio_keys_report_event,
gpio_keys_isr and gpio_check_button one instraction each on ARM using
arm-linux-gnu-gcc 4.2.3---I assume this is similar for other arch/compiler
combinations).
Signed-off-by: Uwe Kleine-König <Uwe.Kleine-Koenig@digi.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/input')
| -rw-r--r-- | drivers/input/keyboard/gpio_keys.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/input/keyboard/gpio_keys.c b/drivers/input/keyboard/gpio_keys.c index e2809d29d99d..fe22ca34d576 100644 --- a/drivers/input/keyboard/gpio_keys.c +++ b/drivers/input/keyboard/gpio_keys.c | |||
| @@ -37,9 +37,10 @@ struct gpio_keys_drvdata { | |||
| 37 | struct gpio_button_data data[0]; | 37 | struct gpio_button_data data[0]; |
| 38 | }; | 38 | }; |
| 39 | 39 | ||
| 40 | static void gpio_keys_report_event(struct gpio_keys_button *button, | 40 | static void gpio_keys_report_event(struct gpio_button_data *bdata) |
| 41 | struct input_dev *input) | ||
| 42 | { | 41 | { |
| 42 | struct gpio_keys_button *button = bdata->button; | ||
| 43 | struct input_dev *input = bdata->input; | ||
| 43 | unsigned int type = button->type ?: EV_KEY; | 44 | unsigned int type = button->type ?: EV_KEY; |
| 44 | int state = (gpio_get_value(button->gpio) ? 1 : 0) ^ button->active_low; | 45 | int state = (gpio_get_value(button->gpio) ? 1 : 0) ^ button->active_low; |
| 45 | 46 | ||
| @@ -51,7 +52,7 @@ static void gpio_check_button(unsigned long _data) | |||
| 51 | { | 52 | { |
| 52 | struct gpio_button_data *data = (struct gpio_button_data *)_data; | 53 | struct gpio_button_data *data = (struct gpio_button_data *)_data; |
| 53 | 54 | ||
| 54 | gpio_keys_report_event(data->button, data->input); | 55 | gpio_keys_report_event(data); |
| 55 | } | 56 | } |
| 56 | 57 | ||
| 57 | static irqreturn_t gpio_keys_isr(int irq, void *dev_id) | 58 | static irqreturn_t gpio_keys_isr(int irq, void *dev_id) |
| @@ -65,7 +66,7 @@ static irqreturn_t gpio_keys_isr(int irq, void *dev_id) | |||
| 65 | mod_timer(&bdata->timer, | 66 | mod_timer(&bdata->timer, |
| 66 | jiffies + msecs_to_jiffies(button->debounce_interval)); | 67 | jiffies + msecs_to_jiffies(button->debounce_interval)); |
| 67 | else | 68 | else |
| 68 | gpio_keys_report_event(button, bdata->input); | 69 | gpio_keys_report_event(bdata); |
| 69 | 70 | ||
| 70 | return IRQ_HANDLED; | 71 | return IRQ_HANDLED; |
| 71 | } | 72 | } |
