Commit ce25d7e9 authored by Uwe Kleine-König's avatar Uwe Kleine-König Committed by Dmitry Torokhov

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: default avatarUwe Kleine-König <Uwe.Kleine-Koenig@digi.com>
Signed-off-by: default avatarDmitry Torokhov <dtor@mail.ru>
parent 57ffe9d5
...@@ -37,9 +37,10 @@ struct gpio_keys_drvdata { ...@@ -37,9 +37,10 @@ struct gpio_keys_drvdata {
struct gpio_button_data data[0]; struct gpio_button_data data[0];
}; };
static void gpio_keys_report_event(struct gpio_keys_button *button, static void gpio_keys_report_event(struct gpio_button_data *bdata)
struct input_dev *input)
{ {
struct gpio_keys_button *button = bdata->button;
struct input_dev *input = bdata->input;
unsigned int type = button->type ?: EV_KEY; unsigned int type = button->type ?: EV_KEY;
int state = (gpio_get_value(button->gpio) ? 1 : 0) ^ button->active_low; int state = (gpio_get_value(button->gpio) ? 1 : 0) ^ button->active_low;
...@@ -51,7 +52,7 @@ static void gpio_check_button(unsigned long _data) ...@@ -51,7 +52,7 @@ static void gpio_check_button(unsigned long _data)
{ {
struct gpio_button_data *data = (struct gpio_button_data *)_data; struct gpio_button_data *data = (struct gpio_button_data *)_data;
gpio_keys_report_event(data->button, data->input); gpio_keys_report_event(data);
} }
static irqreturn_t gpio_keys_isr(int irq, void *dev_id) 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,7 +66,7 @@ static irqreturn_t gpio_keys_isr(int irq, void *dev_id)
mod_timer(&bdata->timer, mod_timer(&bdata->timer,
jiffies + msecs_to_jiffies(button->debounce_interval)); jiffies + msecs_to_jiffies(button->debounce_interval));
else else
gpio_keys_report_event(button, bdata->input); gpio_keys_report_event(bdata);
return IRQ_HANDLED; return IRQ_HANDLED;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment