[PATCH 06/16] char: applicom: Remove 3 unused variables 'ret' and 2 instances of 'byte_reset_it'

From: Lee Jones
Date: Thu May 20 2021 - 08:50:48 EST


Fixes the following W=1 kernel build warning(s):

drivers/char/applicom.c: In function ‘ac_register_board’:
drivers/char/applicom.c:131:25: warning: variable ‘byte_reset_it’ set but not used [-Wunused-but-set-variable]
drivers/char/applicom.c: In function ‘ac_read’:
drivers/char/applicom.c:540:6: warning: variable ‘ret’ set but not used [-Wunused-but-set-variable]
drivers/char/applicom.c: In function ‘ac_ioctl’:
drivers/char/applicom.c:703:25: warning: variable ‘byte_reset_it’ set but not used [-Wunused-but-set-variable]

Cc: Arnd Bergmann <arnd@xxxxxxxx>
Cc: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
Cc: dwmw2@xxxxxxxxxxxxx
Signed-off-by: Lee Jones <lee.jones@xxxxxxxxxx>
---
drivers/char/applicom.c | 10 +++-------
1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/drivers/char/applicom.c b/drivers/char/applicom.c
index deb85a334c937..2d4ab42a986cb 100644
--- a/drivers/char/applicom.c
+++ b/drivers/char/applicom.c
@@ -128,8 +128,6 @@ static int dummy; /* dev_id for request_irq() */
static int ac_register_board(unsigned long physloc, void __iomem *loc,
unsigned char boardno)
{
- volatile unsigned char byte_reset_it;
-
if((readb(loc + CONF_END_TEST) != 0x00) ||
(readb(loc + CONF_END_TEST + 1) != 0x55) ||
(readb(loc + CONF_END_TEST + 2) != 0xAA) ||
@@ -157,7 +155,7 @@ static int ac_register_board(unsigned long physloc, void __iomem *loc,
apbs[boardno].RamIO = loc;
init_waitqueue_head(&apbs[boardno].FlagSleepSend);
spin_lock_init(&apbs[boardno].mutex);
- byte_reset_it = readb(loc + RAM_IT_TO_PC);
+ readb(loc + RAM_IT_TO_PC);

numboards++;
return boardno + 1;
@@ -537,7 +535,6 @@ static ssize_t ac_read (struct file *filp, char __user *buf, size_t count, loff_
unsigned long flags;
unsigned int i;
unsigned char tmp;
- int ret = 0;
DECLARE_WAITQUEUE(wait, current);
#ifdef DEBUG
int loopcount=0;
@@ -568,7 +565,7 @@ static ssize_t ac_read (struct file *filp, char __user *buf, size_t count, loff_

/* Got a packet for us */
memset(&st_loc, 0, sizeof(st_loc));
- ret = do_ac_read(i, buf, &st_loc, &mailbox);
+ do_ac_read(i, buf, &st_loc, &mailbox);
spin_unlock_irqrestore(&apbs[i].mutex, flags);
set_current_state(TASK_RUNNING);
remove_wait_queue(&FlagSleepRec, &wait);
@@ -700,7 +697,6 @@ static long ac_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
void __iomem *pmem;
int ret = 0;
static int warncount = 10;
- volatile unsigned char byte_reset_it;
struct st_ram_io *adgl;
void __user *argp = (void __user *)arg;

@@ -762,7 +758,7 @@ static long ac_ioctl(struct file *file, unsigned int cmd, unsigned long arg)

for (i = 0; i < MAX_BOARD; i++) {
if (apbs[i].RamIO) {
- byte_reset_it = readb(apbs[i].RamIO + RAM_IT_TO_PC);
+ readb(apbs[i].RamIO + RAM_IT_TO_PC);
}
}
break;
--
2.31.1