drivers/char/applicom.c | 3 --- 1 file changed, 3 deletions(-)
Remove unused variable and redundant readb in ac_register_board
Signed-off-by: Zhu Jun <zhujun2@cmss.chinamobile.com>
---
drivers/char/applicom.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/drivers/char/applicom.c b/drivers/char/applicom.c
index 9fed9706d9cd..ea25caf35346 100644
--- a/drivers/char/applicom.c
+++ b/drivers/char/applicom.c
@@ -127,8 +127,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) ||
@@ -156,7 +154,6 @@ 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);
numboards++;
return boardno + 1;
--
2.17.1
On Tue, Oct 08, 2024 at 12:28:25AM -0700, Zhu Jun wrote:
> Remove unused variable and redundant readb in ac_register_board
>
> Signed-off-by: Zhu Jun <zhujun2@cmss.chinamobile.com>
> ---
> drivers/char/applicom.c | 3 ---
> 1 file changed, 3 deletions(-)
>
> diff --git a/drivers/char/applicom.c b/drivers/char/applicom.c
> index 9fed9706d9cd..ea25caf35346 100644
> --- a/drivers/char/applicom.c
> +++ b/drivers/char/applicom.c
> @@ -127,8 +127,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) ||
> @@ -156,7 +154,6 @@ 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);
As Arnd said, this is doing something, please be more familiar with
hardware types (i.e. reads are required to ensure a write happens),
before removing lines that feel they are not needed, unless you can test
the driver change yourself.
thanks,
greg k-h
On Tue, Oct 8, 2024, at 07:28, Zhu Jun wrote:
> Remove unused variable and redundant readb in ac_register_board
>
> Signed-off-by: Zhu Jun <zhujun2@cmss.chinamobile.com>
This is probably intentional, as the readb() can both have side-effects
on the device and serialize the device against a previous instructions.
It would have been nice to have a comment in there, but since that
is 30 year old code, I doubt we get more information on it now.
Just don't remove those.
Arnd
© 2016 - 2026 Red Hat, Inc.