Skip to contentSkip to conversation

HID: wacom: remove unnecessary 'connected' variable from EKR

PATCH In review Aaron Armstrong Skomra 1 participant 1 message Jul 25, 2023

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 2/3 HID: wacom: remove unnecessary 'connected' variable from EKR

From: Aaron Armstrong Skomra <[email protected]>

The 'connected' variable was poorly named, and this has led to some confusion. We can get the same information by checking if a serial number exists in the specified EKR slot.

---
 drivers/hid/wacom_sys.c | 2 +-
 drivers/hid/wacom_wac.c | 2 --
 drivers/hid/wacom_wac.h | 1 -
 3 files changed, 1 insertion(+), 4 deletions(-)
drivers/hid/wacom_sys.c +1 -1
index eb833455abd5..16862f97c46c 100644
@@ -2684,7 +2684,7 @@ static void wacom_remote_work(struct work_struct *work)
 
 	for (i = 0; i < WACOM_MAX_REMOTES; i++) {
 		serial = data.remote[i].serial;
-		if (data.remote[i].connected) {
+		if (serial) {
 
 			if (kt - remote->remotes[i].active_time > WACOM_REMOTE_BATTERY_TIMEOUT
 			    && remote->remotes[i].active_time != 0)
drivers/hid/wacom_wac.c +0 -2
index 6c056f8844e7..c922c1c4c78f 100644
@@ -1209,10 +1209,8 @@ static void wacom_remote_status_irq(struct wacom_wac *wacom_wac, size_t len)
 	for (i = 0; i < WACOM_MAX_REMOTES; i++) {
 		int j = i * 6;
 		int serial = (data[j+6] << 16) + (data[j+5] << 8) + data[j+4];
-		bool connected = data[j+2];
 
 		remote_data.remote[i].serial = serial;
-		remote_data.remote[i].connected = connected;
 	}
 
 	spin_lock_irqsave(&remote->remote_lock, flags);
drivers/hid/wacom_wac.h +0 -1
index 2e7cc5e7a0cb..a10b19669947 100644
@@ -331,7 +331,6 @@ struct hid_data {
 struct wacom_remote_data {
 	struct {
 		u32 serial;
-		bool connected;
 	} remote[WACOM_MAX_REMOTES];
 };
 
Signature · 1 line
2.34.1