Skip to content

Commit

Permalink
HID: wacom: struct name cleanup
Browse files Browse the repository at this point in the history
Help differentiate the two remote related "serial" struct variables by
renaming "wacom_remote_data" to "wacom_remote_work_data".

Signed-off-by: Aaron Skomra <[email protected]>
Signed-off-by: Aaron Armstrong Skomra <[email protected]>
Reviewed-by: Jason Gerecke <[email protected]>
Signed-off-by: Jiri Kosina <[email protected]>
[[email protected]: Imported into input-wacom repository (55ab9b2c42f4)]
Signed-off-by: Joshua Dickens <[email protected]>
  • Loading branch information
skomra authored and Joshua-Dickens committed Aug 29, 2023
1 parent 5870213 commit 2140ab8
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 12 deletions.
19 changes: 10 additions & 9 deletions 4.5/wacom_sys.c
Original file line number Diff line number Diff line change
Expand Up @@ -2059,7 +2059,7 @@ static int wacom_initialize_remotes(struct wacom *wacom)
spin_lock_init(&remote->remote_lock);

error = kfifo_alloc(&remote->remote_fifo,
5 * sizeof(struct wacom_remote_data),
5 * sizeof(struct wacom_remote_work_data),
GFP_KERNEL);
if (error) {
hid_err(wacom->hdev, "failed allocating remote_fifo\n");
Expand Down Expand Up @@ -2722,17 +2722,18 @@ static void wacom_remote_work(struct work_struct *work)
struct wacom *wacom = container_of(work, struct wacom, remote_work);
struct wacom_remote *remote = wacom->remote;
ktime_t kt = ktime_get();
struct wacom_remote_data data;
struct wacom_remote_work_data remote_work_data;
unsigned long flags;
unsigned int count;
u32 serial;
u32 work_serial;
int i;

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,
"workitem triggered without status available\n");
spin_unlock_irqrestore(&remote->remote_lock, flags);
Expand All @@ -2745,22 +2746,22 @@ static void wacom_remote_work(struct work_struct *work)
spin_unlock_irqrestore(&remote->remote_lock, flags);

for (i = 0; i < WACOM_MAX_REMOTES; i++) {
serial = data.remote[i].serial;
if (serial) {
work_serial = remote_work_data.remote[i].serial;
if (work_serial) {

if (kt - remote->remotes[i].active_time > WACOM_REMOTE_BATTERY_TIMEOUT
&& remote->remotes[i].active_time != 0)
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);
continue;
}

if (remote->remotes[i].serial)
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) {
wacom_remote_destroy_one(wacom, i);
Expand Down
4 changes: 2 additions & 2 deletions 4.5/wacom_wac.c
Original file line number Diff line number Diff line change
Expand Up @@ -1207,14 +1207,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);
unsigned char *data = wacom_wac->data;
struct wacom_remote *remote = wacom->remote;
struct wacom_remote_data remote_data;
struct wacom_remote_work_data remote_data;
unsigned long flags;
int i, ret;

if (data[0] != WACOM_REPORT_DEVICE_LIST)
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++) {
int j = i * 6;
Expand Down
2 changes: 1 addition & 1 deletion 4.5/wacom_wac.h
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ struct hid_data {
#endif
};

struct wacom_remote_data {
struct wacom_remote_work_data {
struct {
u32 serial;
} remote[WACOM_MAX_REMOTES];
Expand Down

0 comments on commit 2140ab8

Please sign in to comment.