Commit 55ab9b2c authored by Aaron Armstrong Skomra's avatar Aaron Armstrong Skomra Committed by Jiri Kosina

HID: wacom: struct name cleanup

Help differentiate the two remote related "serial" struct variables by
renaming "wacom_remote_data" to "wacom_remote_work_data".
Signed-off-by: default avatarAaron Skomra <skomra@gmail.com>
Signed-off-by: default avatarAaron Armstrong Skomra <aaron.skomra@wacom.com>
Reviewed-by: default avatarJason Gerecke <jason.gerecke@wacom.com>
Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
parent 2834e380
...@@ -1997,7 +1997,7 @@ static int wacom_initialize_remotes(struct wacom *wacom) ...@@ -1997,7 +1997,7 @@ static int wacom_initialize_remotes(struct wacom *wacom)
spin_lock_init(&remote->remote_lock); spin_lock_init(&remote->remote_lock);
error = kfifo_alloc(&remote->remote_fifo, error = kfifo_alloc(&remote->remote_fifo,
5 * sizeof(struct wacom_remote_data), 5 * sizeof(struct wacom_remote_work_data),
GFP_KERNEL); GFP_KERNEL);
if (error) { if (error) {
hid_err(wacom->hdev, "failed allocating remote_fifo\n"); hid_err(wacom->hdev, "failed allocating remote_fifo\n");
...@@ -2660,17 +2660,18 @@ static void wacom_remote_work(struct work_struct *work) ...@@ -2660,17 +2660,18 @@ static void wacom_remote_work(struct work_struct *work)
struct wacom *wacom = container_of(work, struct wacom, remote_work); struct wacom *wacom = container_of(work, struct wacom, remote_work);
struct wacom_remote *remote = wacom->remote; struct wacom_remote *remote = wacom->remote;
ktime_t kt = ktime_get(); ktime_t kt = ktime_get();
struct wacom_remote_data data; struct wacom_remote_work_data remote_work_data;
unsigned long flags; unsigned long flags;
unsigned int count; unsigned int count;
u32 serial; u32 work_serial;
int i; int i;
spin_lock_irqsave(&remote->remote_lock, flags); spin_lock_irqsave(&remote->remote_lock, flags);
count = kfifo_out(&remote->remote_fifo, &data, sizeof(data)); count = kfifo_out(&remote->remote_fifo, &remote_work_data,
sizeof(remote_work_data));
if (count != sizeof(data)) { if (count != sizeof(remote_work_data)) {
hid_err(wacom->hdev, hid_err(wacom->hdev,
"workitem triggered without status available\n"); "workitem triggered without status available\n");
spin_unlock_irqrestore(&remote->remote_lock, flags); spin_unlock_irqrestore(&remote->remote_lock, flags);
...@@ -2683,14 +2684,14 @@ static void wacom_remote_work(struct work_struct *work) ...@@ -2683,14 +2684,14 @@ static void wacom_remote_work(struct work_struct *work)
spin_unlock_irqrestore(&remote->remote_lock, flags); spin_unlock_irqrestore(&remote->remote_lock, flags);
for (i = 0; i < WACOM_MAX_REMOTES; i++) { for (i = 0; i < WACOM_MAX_REMOTES; i++) {
serial = data.remote[i].serial; work_serial = remote_work_data.remote[i].serial;
if (serial) { if (work_serial) {
if (kt - remote->remotes[i].active_time > WACOM_REMOTE_BATTERY_TIMEOUT if (kt - remote->remotes[i].active_time > WACOM_REMOTE_BATTERY_TIMEOUT
&& remote->remotes[i].active_time != 0) && remote->remotes[i].active_time != 0)
wacom_remote_destroy_battery(wacom, i); wacom_remote_destroy_battery(wacom, i);
if (remote->remotes[i].serial == serial) { if (remote->remotes[i].serial == work_serial) {
wacom_remote_attach_battery(wacom, i); wacom_remote_attach_battery(wacom, i);
continue; continue;
} }
...@@ -2698,7 +2699,7 @@ static void wacom_remote_work(struct work_struct *work) ...@@ -2698,7 +2699,7 @@ static void wacom_remote_work(struct work_struct *work)
if (remote->remotes[i].serial) if (remote->remotes[i].serial)
wacom_remote_destroy_one(wacom, i); wacom_remote_destroy_one(wacom, i);
wacom_remote_create_one(wacom, serial, i); wacom_remote_create_one(wacom, work_serial, i);
} else if (remote->remotes[i].serial) { } else if (remote->remotes[i].serial) {
wacom_remote_destroy_one(wacom, i); wacom_remote_destroy_one(wacom, i);
......
...@@ -1197,14 +1197,14 @@ static void wacom_remote_status_irq(struct wacom_wac *wacom_wac, size_t len) ...@@ -1197,14 +1197,14 @@ static void wacom_remote_status_irq(struct wacom_wac *wacom_wac, size_t len)
struct wacom *wacom = container_of(wacom_wac, struct wacom, wacom_wac); struct wacom *wacom = container_of(wacom_wac, struct wacom, wacom_wac);
unsigned char *data = wacom_wac->data; unsigned char *data = wacom_wac->data;
struct wacom_remote *remote = wacom->remote; struct wacom_remote *remote = wacom->remote;
struct wacom_remote_data remote_data; struct wacom_remote_work_data remote_data;
unsigned long flags; unsigned long flags;
int i, ret; int i, ret;
if (data[0] != WACOM_REPORT_DEVICE_LIST) if (data[0] != WACOM_REPORT_DEVICE_LIST)
return; return;
memset(&remote_data, 0, sizeof(struct wacom_remote_data)); memset(&remote_data, 0, sizeof(struct wacom_remote_work_data));
for (i = 0; i < WACOM_MAX_REMOTES; i++) { for (i = 0; i < WACOM_MAX_REMOTES; i++) {
int j = i * 6; int j = i * 6;
......
...@@ -328,7 +328,7 @@ struct hid_data { ...@@ -328,7 +328,7 @@ struct hid_data {
ktime_t time_delayed; ktime_t time_delayed;
}; };
struct wacom_remote_data { struct wacom_remote_work_data {
struct { struct {
u32 serial; u32 serial;
} remote[WACOM_MAX_REMOTES]; } remote[WACOM_MAX_REMOTES];
......
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