git: 8af242195658 - main - lio: Quiet set but unused warnings.

From: John Baldwin <jhb_at_FreeBSD.org>
Date: Wed, 06 Apr 2022 23:46:29 UTC
The branch main has been updated by jhb:

URL: https://cgit.FreeBSD.org/src/commit/?id=8af24219565873d0acb2a862b15527f2366d8dbe

commit 8af24219565873d0acb2a862b15527f2366d8dbe
Author:     John Baldwin <jhb@FreeBSD.org>
AuthorDate: 2022-04-06 23:45:29 +0000
Commit:     John Baldwin <jhb@FreeBSD.org>
CommitDate: 2022-04-06 23:45:29 +0000

    lio: Quiet set but unused warnings.
    
    - Remove unused variables.
    
    - Mark a value only used in debug traces as unused.
    
    - Remove variables only used for device register reads with
      side-effects with void casts on the read.
---
 sys/dev/liquidio/base/lio_console.c         | 5 ++---
 sys/dev/liquidio/base/lio_device.c          | 9 ++++-----
 sys/dev/liquidio/base/lio_request_manager.c | 5 -----
 sys/dev/liquidio/lio_main.c                 | 3 +--
 4 files changed, 7 insertions(+), 15 deletions(-)

diff --git a/sys/dev/liquidio/base/lio_console.c b/sys/dev/liquidio/base/lio_console.c
index c36fb5bf2247..397c2f963800 100644
--- a/sys/dev/liquidio/base/lio_console.c
+++ b/sys/dev/liquidio/base/lio_console.c
@@ -776,7 +776,7 @@ lio_get_uboot_version(struct octeon_device *oct)
 	struct lio_console *console;
 	int32_t		bytes_read, total_read, tries;
 	uint32_t	console_num = 0;
-	int		i, ret = 0;
+	int		i, ret __unused = 0;
 
 	ret = lio_console_send_cmd(oct, "setenv stdout pci", 50);
 
@@ -860,7 +860,6 @@ lio_download_firmware(struct octeon_device *oct, const uint8_t * data,
 	struct lio_firmware_file_header *h;
 	uint64_t	load_addr;
 	uint32_t	crc32_result, i, image_len, rem;
-	int		ret = 0;
 
 	if (size < sizeof(struct lio_firmware_file_header)) {
 		lio_dev_err(oct, "Firmware file too small (%d < %d).\n",
@@ -936,6 +935,6 @@ lio_download_firmware(struct octeon_device *oct, const uint8_t * data,
 	lio_dev_info(oct, "Writing boot command: %s\n", h->bootcmd);
 
 	/* Invoke the bootcmd */
-	ret = lio_console_send_cmd(oct, h->bootcmd, 50);
+	lio_console_send_cmd(oct, h->bootcmd, 50);
 	return (0);
 }
diff --git a/sys/dev/liquidio/base/lio_device.c b/sys/dev/liquidio/base/lio_device.c
index 8bcf4f329848..a673a9bf414a 100644
--- a/sys/dev/liquidio/base/lio_device.c
+++ b/sys/dev/liquidio/base/lio_device.c
@@ -905,7 +905,7 @@ uint64_t
 lio_pci_readq(struct octeon_device *oct, uint64_t addr)
 {
 	uint64_t		val64;
-	volatile uint32_t	val32, addrhi;
+	volatile uint32_t	addrhi;
 
 	mtx_lock(&oct->pci_win_lock);
 
@@ -919,11 +919,11 @@ lio_pci_readq(struct octeon_device *oct, uint64_t addr)
 	lio_write_csr32(oct, oct->reg_list.pci_win_rd_addr_hi, addrhi);
 
 	/* Read back to preserve ordering of writes */
-	val32 = lio_read_csr32(oct, oct->reg_list.pci_win_rd_addr_hi);
+	(void)lio_read_csr32(oct, oct->reg_list.pci_win_rd_addr_hi);
 
 	lio_write_csr32(oct, oct->reg_list.pci_win_rd_addr_lo,
 			addr & 0xffffffff);
-	val32 = lio_read_csr32(oct, oct->reg_list.pci_win_rd_addr_lo);
+	(void)lio_read_csr32(oct, oct->reg_list.pci_win_rd_addr_lo);
 
 	val64 = lio_read_csr64(oct, oct->reg_list.pci_win_rd_data);
 
@@ -935,7 +935,6 @@ lio_pci_readq(struct octeon_device *oct, uint64_t addr)
 void
 lio_pci_writeq(struct octeon_device *oct, uint64_t val, uint64_t addr)
 {
-	volatile uint32_t	val32;
 
 	mtx_lock(&oct->pci_win_lock);
 
@@ -944,7 +943,7 @@ lio_pci_writeq(struct octeon_device *oct, uint64_t val, uint64_t addr)
 	/* The write happens when the LSB is written. So write MSB first. */
 	lio_write_csr32(oct, oct->reg_list.pci_win_wr_data_hi, val >> 32);
 	/* Read the MSB to ensure ordering of writes. */
-	val32 = lio_read_csr32(oct, oct->reg_list.pci_win_wr_data_hi);
+	(void)lio_read_csr32(oct, oct->reg_list.pci_win_wr_data_hi);
 
 	lio_write_csr32(oct, oct->reg_list.pci_win_wr_data_lo,
 			val & 0xffffffff);
diff --git a/sys/dev/liquidio/base/lio_request_manager.c b/sys/dev/liquidio/base/lio_request_manager.c
index db7548e7ddff..e07d65a6c33b 100644
--- a/sys/dev/liquidio/base/lio_request_manager.c
+++ b/sys/dev/liquidio/base/lio_request_manager.c
@@ -406,7 +406,6 @@ lio_process_iq_request_list(struct octeon_device *oct,
 {
 	struct lio_soft_command		*sc;
 	struct octeon_instr_irh		*irh = NULL;
-	struct lio_mbuf_free_info	*finfo;
 	void				*buf;
 	uint32_t			inst_count = 0;
 	uint32_t			old = iq->flush_index;
@@ -415,7 +414,6 @@ lio_process_iq_request_list(struct octeon_device *oct,
 	while (old != iq->octeon_read_index) {
 		reqtype = iq->request_list[old].reqtype;
 		buf = iq->request_list[old].buf;
-		finfo = buf;
 
 		if (reqtype == LIO_REQTYPE_NONE)
 			goto skip_this;
@@ -632,7 +630,6 @@ lio_prepare_soft_command(struct octeon_device *oct, struct lio_soft_command *sc,
 			 uint8_t opcode, uint8_t subcode, uint32_t irh_ossp,
 			 uint64_t ossp0, uint64_t ossp1)
 {
-	struct lio_config		*lio_cfg;
 	struct octeon_instr_ih3		*ih3;
 	struct octeon_instr_pki_ih3	*pki_ih3;
 	struct octeon_instr_irh		*irh;
@@ -641,8 +638,6 @@ lio_prepare_soft_command(struct octeon_device *oct, struct lio_soft_command *sc,
 	KASSERT(opcode <= 15, ("%s, %d, opcode > 15", __func__, __LINE__));
 	KASSERT(subcode <= 127, ("%s, %d, opcode > 127", __func__, __LINE__));
 
-	lio_cfg = lio_get_conf(oct);
-
 	if (LIO_CN23XX_PF(oct)) {
 		ih3 = (struct octeon_instr_ih3 *)&sc->cmd.cmd3.ih3;
 
diff --git a/sys/dev/liquidio/lio_main.c b/sys/dev/liquidio/lio_main.c
index a7c1308c10d9..79cf7105bed3 100644
--- a/sys/dev/liquidio/lio_main.c
+++ b/sys/dev/liquidio/lio_main.c
@@ -795,11 +795,10 @@ static int
 lio_chip_specific_setup(struct octeon_device *oct)
 {
 	char		*s;
-	uint32_t	dev_id, rev_id;
+	uint32_t	dev_id;
 	int		ret = 1;
 
 	dev_id = lio_read_pci_cfg(oct, 0);
-	rev_id = pci_get_revid(oct->device);
 	oct->subdevice_id = pci_get_subdevice(oct->device);
 
 	switch (dev_id) {