Skip to contentSkip to conversation

HID: intel-ish-hid: deadcoding

PATCH Applied [email protected] 3 participants 6 messages Dec 25, 2024 – Jan 9, 2025

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

cover HID: intel-ish-hid: deadcoding

From: "Dr. David Alan Gilbert" <[email protected]>

Hohoho!

Please find a small series of deadcode cleanups for functions that were added many years ago but haven't been used.

Build tested only.

Dr. David Alan Gilbert (3):
HID: intel-ish-hid: Remove unused ishtp_dev_state_str
HID: intel-ish-hid: Remove unused ishtp_cl_tx_empty
HID: intel-ish-hid: Remove unused ishtp_cl_get_tx_*

 .../hid/intel-ish-hid/ishtp/client-buffers.c  | 21 -------------
 drivers/hid/intel-ish-hid/ishtp/client.c      | 19 ------------
 drivers/hid/intel-ish-hid/ishtp/client.h      |  2 --
 drivers/hid/intel-ish-hid/ishtp/init.c        | 30 -------------------
 drivers/hid/intel-ish-hid/ishtp/ishtp-dev.h   |  1 -
 include/linux/intel-ish-client-if.h           |  1 -
 6 files changed, 74 deletions(-)
Signature · 1 line
2.47.1
#1 lore raw

PATCH 1/3 HID: intel-ish-hid: Remove unused ishtp_dev_state_str

From: "Dr. David Alan Gilbert" <[email protected]>

ishtp_dev_state_str() was added in 2016 by
commit 3703f53b99e4 ("HID: intel_ish-hid: ISH Transport layer") but has never been used.

Remove it.

---
 drivers/hid/intel-ish-hid/ishtp/init.c      | 30 ---------------------
 drivers/hid/intel-ish-hid/ishtp/ishtp-dev.h |  1 -
 2 files changed, 31 deletions(-)
drivers/hid/intel-ish-hid/ishtp/init.c +0 -30
index 07fdd52e4c5e..26bf9045a8de 100644
@@ -14,36 +14,6 @@
 #include "client.h"
 #include "loader.h"
 
-/**
- * ishtp_dev_state_str() -Convert to string format
- * @state: state to convert
- *
- * Convert state to string for prints
- *
- * Return: character pointer to converted string
- */
-const char *ishtp_dev_state_str(int state)
-{
-	switch (state) {
-	case ISHTP_DEV_INITIALIZING:
-		return	"INITIALIZING";
-	case ISHTP_DEV_INIT_CLIENTS:
-		return	"INIT_CLIENTS";
-	case ISHTP_DEV_ENABLED:
-		return	"ENABLED";
-	case ISHTP_DEV_RESETTING:
-		return	"RESETTING";
-	case ISHTP_DEV_DISABLED:
-		return	"DISABLED";
-	case ISHTP_DEV_POWER_DOWN:
-		return	"POWER_DOWN";
-	case ISHTP_DEV_POWER_UP:
-		return	"POWER_UP";
-	default:
-		return "unknown";
-	}
-}
-
 /**
  * ishtp_device_init() - ishtp device init
  * @dev: ISHTP device instance
drivers/hid/intel-ish-hid/ishtp/ishtp-dev.h +0 -1
index effbb442c727..44eddc411e97 100644
@@ -57,7 +57,6 @@ enum ishtp_dev_state {
 	ISHTP_DEV_POWER_DOWN,
 	ISHTP_DEV_POWER_UP
 };
-const char *ishtp_dev_state_str(int state);
 
 struct ishtp_cl;
 
Signature · 1 line
2.47.1
#2 lore raw

PATCH 2/3 HID: intel-ish-hid: Remove unused ishtp_cl_tx_empty

In reply to [email protected]

From: "Dr. David Alan Gilbert" <[email protected]>

ishtp_cl_tx_empty() was added in 2018 by
commit a1c40ce62fd2 ("HID: intel-ish-hid: ishtp: add helper functions for client buffer operation") but has remained unused.

Remove it.

---
 .../hid/intel-ish-hid/ishtp/client-buffers.c  | 21 -------------------
 include/linux/intel-ish-client-if.h           |  1 -
 2 files changed, 22 deletions(-)
drivers/hid/intel-ish-hid/ishtp/client-buffers.c +0 -21
index 513d7a4a1b8a..97f4026b1627 100644
@@ -251,27 +251,6 @@ int ishtp_cl_io_rb_recycle(struct ishtp_cl_rb *rb)
 }
 EXPORT_SYMBOL(ishtp_cl_io_rb_recycle);
 
-/**
- * ishtp_cl_tx_empty() -test whether client device tx buffer is empty
- * @cl: Pointer to client device instance
- *
- * Look client device tx buffer list, and check whether this list is empty
- *
- * Return: true if client tx buffer list is empty else false
- */
-bool ishtp_cl_tx_empty(struct ishtp_cl *cl)
-{
-	int tx_list_empty;
-	unsigned long tx_flags;
-
-	spin_lock_irqsave(&cl->tx_list_spinlock, tx_flags);
-	tx_list_empty = list_empty(&cl->tx_list.list);
-	spin_unlock_irqrestore(&cl->tx_list_spinlock, tx_flags);
-
-	return !!tx_list_empty;
-}
-EXPORT_SYMBOL(ishtp_cl_tx_empty);
-
 /**
  * ishtp_cl_rx_get_rb() -Get a rb from client device rx buffer list
  * @cl: Pointer to client device instance
include/linux/intel-ish-client-if.h +0 -1
index 771622650247..dfbf7d9d7bb5 100644
@@ -100,7 +100,6 @@ void ishtp_cl_destroy_connection(struct ishtp_cl *cl, bool reset);
 int ishtp_cl_send(struct ishtp_cl *cl, uint8_t *buf, size_t length);
 int ishtp_cl_flush_queues(struct ishtp_cl *cl);
 int ishtp_cl_io_rb_recycle(struct ishtp_cl_rb *rb);
-bool ishtp_cl_tx_empty(struct ishtp_cl *cl);
 struct ishtp_cl_rb *ishtp_cl_rx_get_rb(struct ishtp_cl *cl);
 void *ishtp_get_client_data(struct ishtp_cl *cl);
 void ishtp_set_client_data(struct ishtp_cl *cl, void *data);
Signature · 1 line
2.47.1
#3 lore raw

PATCH 3/3 HID: intel-ish-hid: Remove unused ishtp_cl_get_tx_*

In reply to [email protected]

From: "Dr. David Alan Gilbert" <[email protected]>

ishtp_cl_get_tx_free_buffer_size() and ishtp_cl_get_tx_free_rings() were added in 2018 by
commit 18c0b5467498 ("HID: intel_ish-hid: Enhance API to get ring buffer sizes")
but have remained unused.

Remove them.

---
 drivers/hid/intel-ish-hid/ishtp/client.c | 19 -------------------
 drivers/hid/intel-ish-hid/ishtp/client.h |  2 --
 2 files changed, 21 deletions(-)
drivers/hid/intel-ish-hid/ishtp/client.c +0 -19
index e61b01e9902e..21a2c0773cc2 100644
@@ -14,25 +14,6 @@
 #include "hbm.h"
 #include "client.h"
 
-int ishtp_cl_get_tx_free_buffer_size(struct ishtp_cl *cl)
-{
-	unsigned long tx_free_flags;
-	int size;
-
-	spin_lock_irqsave(&cl->tx_free_list_spinlock, tx_free_flags);
-	size = cl->tx_ring_free_size * cl->device->fw_client->props.max_msg_length;
-	spin_unlock_irqrestore(&cl->tx_free_list_spinlock, tx_free_flags);
-
-	return size;
-}
-EXPORT_SYMBOL(ishtp_cl_get_tx_free_buffer_size);
-
-int ishtp_cl_get_tx_free_rings(struct ishtp_cl *cl)
-{
-	return cl->tx_ring_free_size;
-}
-EXPORT_SYMBOL(ishtp_cl_get_tx_free_rings);
-
 /**
  * ishtp_read_list_flush() - Flush read queue
  * @cl: ishtp client instance
drivers/hid/intel-ish-hid/ishtp/client.h +0 -2
index d9d398fadcf7..0efd49dd2530 100644
@@ -120,8 +120,6 @@ int ishtp_cl_alloc_rx_ring(struct ishtp_cl *cl);
 int ishtp_cl_alloc_tx_ring(struct ishtp_cl *cl);
 void ishtp_cl_free_rx_ring(struct ishtp_cl *cl);
 void ishtp_cl_free_tx_ring(struct ishtp_cl *cl);
-int ishtp_cl_get_tx_free_buffer_size(struct ishtp_cl *cl);
-int ishtp_cl_get_tx_free_rings(struct ishtp_cl *cl);
 
 /* DMA I/F functions */
 void recv_ishtp_cl_msg_dma(struct ishtp_device *dev, void *msg,
Signature · 1 line
2.47.1
maintainer Acked-by on the v1 series
#4 lore raw
In reply to [email protected]
Quoted 10 lines · On Wed, 2024-12-25 at 01:55 +0000, [email protected] wrote:

From: "Dr. David Alan Gilbert" <[email protected]>

Hohoho!

Please find a small series of deadcode cleanups for functions that were added many years ago but haven't been used.

Build tested only.

Quoted 16 lines

Dr. David Alan Gilbert (3):
  HID: intel-ish-hid: Remove unused ishtp_dev_state_str
  HID: intel-ish-hid: Remove unused ishtp_cl_tx_empty
  HID: intel-ish-hid: Remove unused ishtp_cl_get_tx_*

 .../hid/intel-ish-hid/ishtp/client-buffers.c  | 21 ------------- drivers/hid/intel-ish-hid/ishtp/client.c      | 19 ------------ drivers/hid/intel-ish-hid/ishtp/client.h      |  2 -- drivers/hid/intel-ish-hid/ishtp/init.c        | 30 ----------------- --
 drivers/hid/intel-ish-hid/ishtp/ishtp-dev.h   |  1 - include/linux/intel-ish-client-if.h           |  1 -

 6 files changed, 74 deletions(-)
maintainer Applied
#5 lore raw
In reply to [email protected]
Quoted 9 lines · On Wed, 25 Dec 2024, [email protected] wrote:

From: "Dr. David Alan Gilbert" <[email protected]>

Hohoho!

Please find a small series of deadcode cleanups for functions that were added many years ago but haven't been used.

Build tested only.

Quoted 7 lines

Dr. David Alan Gilbert (3):
HID: intel-ish-hid: Remove unused ishtp_dev_state_str
HID: intel-ish-hid: Remove unused ishtp_cl_tx_empty
HID: intel-ish-hid: Remove unused ishtp_cl_get_tx_*

Applied, thanks.

Signature · 2 lines
Jiri Kosina
SUSE Labs