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.
This commit is contained in:
John Baldwin 2022-04-06 16:45:29 -07:00
parent 6454d0c8cb
commit 8af2421956
4 changed files with 7 additions and 15 deletions

View File

@ -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);
}

View File

@ -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);

View File

@ -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;

View File

@ -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) {