diff mbox series

[2/3] hw/audio/ac97: Remove unimplemented reset functions

Message ID 2969a92711ead9d5f64a68d2e10e9780a9472fc9.1650633281.git.balaton@eik.bme.hu
State New
Headers show
Series Misc AC97 clean ups | expand

Commit Message

BALATON Zoltan April 22, 2022, 1:14 p.m. UTC
The warm_reset() and cold_reset() functions are not implemented and do
nothing so no point in calling them or keep around as dead code.
Therefore remove them for now.

Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
---
 hw/audio/ac97.c | 16 ----------------
 1 file changed, 16 deletions(-)

Comments

Peter Maydell April 22, 2022, 1:58 p.m. UTC | #1
On Fri, 22 Apr 2022 at 14:40, BALATON Zoltan <balaton@eik.bme.hu> wrote:
>
> The warm_reset() and cold_reset() functions are not implemented and do
> nothing so no point in calling them or keep around as dead code.
> Therefore remove them for now.
>
> Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
> ---
>  hw/audio/ac97.c | 16 ----------------
>  1 file changed, 16 deletions(-)
>
> diff --git a/hw/audio/ac97.c b/hw/audio/ac97.c
> index 0b1d8ce9c6..2799d64acd 100644
> --- a/hw/audio/ac97.c
> +++ b/hw/audio/ac97.c
> @@ -222,16 +222,6 @@ static void po_callback(void *opaque, int free);
>  static void pi_callback(void *opaque, int avail);
>  static void mc_callback(void *opaque, int avail);
>
> -static void warm_reset(AC97LinkState *s)
> -{
> -    (void)s;
> -}
> -
> -static void cold_reset(AC97LinkState *s)
> -{
> -    (void)s;
> -}
> -
>  static void fetch_bd(AC97LinkState *s, AC97BusMasterRegs *r)
>  {
>      uint8_t b[8];
> @@ -921,12 +911,6 @@ static void nabm_writel(void *opaque, uint32_t addr, uint32_t val)
>          dolog("BDBAR[%d] <- 0x%x (bdbar 0x%x)\n", GET_BM(index), val, r->bdbar);
>          break;
>      case GLOB_CNT:
> -        if (val & GC_WR) {
> -            warm_reset(s);
> -        }
> -        if (val & GC_CR) {
> -            cold_reset(s);
> -        }

Removing the dead code is OK, but I think we should then add a comment here:
 /* TODO: Handle WR or CR being set (warm/cold reset requests) */
so it remains clear that there's missing functionality here.

>          if (!(val & (GC_WR | GC_CR))) {
>              s->glob_cnt = val & GC_VALID_MASK;
>          }
> --
> 2.30.2

thanks
-- PMM
diff mbox series

Patch

diff --git a/hw/audio/ac97.c b/hw/audio/ac97.c
index 0b1d8ce9c6..2799d64acd 100644
--- a/hw/audio/ac97.c
+++ b/hw/audio/ac97.c
@@ -222,16 +222,6 @@  static void po_callback(void *opaque, int free);
 static void pi_callback(void *opaque, int avail);
 static void mc_callback(void *opaque, int avail);
 
-static void warm_reset(AC97LinkState *s)
-{
-    (void)s;
-}
-
-static void cold_reset(AC97LinkState *s)
-{
-    (void)s;
-}
-
 static void fetch_bd(AC97LinkState *s, AC97BusMasterRegs *r)
 {
     uint8_t b[8];
@@ -921,12 +911,6 @@  static void nabm_writel(void *opaque, uint32_t addr, uint32_t val)
         dolog("BDBAR[%d] <- 0x%x (bdbar 0x%x)\n", GET_BM(index), val, r->bdbar);
         break;
     case GLOB_CNT:
-        if (val & GC_WR) {
-            warm_reset(s);
-        }
-        if (val & GC_CR) {
-            cold_reset(s);
-        }
         if (!(val & (GC_WR | GC_CR))) {
             s->glob_cnt = val & GC_VALID_MASK;
         }