[PATCH] hw/char: Remove unused serial_set_frequency

dave@treblig.org posted 1 patch 2 months ago
hw/char/serial.c         | 7 -------
include/hw/char/serial.h | 2 --
2 files changed, 9 deletions(-)
[PATCH] hw/char: Remove unused serial_set_frequency
Posted by dave@treblig.org 2 months ago
From: "Dr. David Alan Gilbert" <dave@treblig.org>

serial_set_frequnecy has been unused since it was added in 2009:
  038eaf82c8 ("serial: Add interface to set reference oscillator frequency")

It looks like the 'baudbase' is now a property anyway so the wrapper
isn't needed.

Remove it.

Signed-off-by: Dr. David Alan Gilbert <dave@treblig.org>
---
 hw/char/serial.c         | 7 -------
 include/hw/char/serial.h | 2 --
 2 files changed, 9 deletions(-)

diff --git a/hw/char/serial.c b/hw/char/serial.c
index d8b2db5082..6c5c4a23c7 100644
--- a/hw/char/serial.c
+++ b/hw/char/serial.c
@@ -951,13 +951,6 @@ static void serial_unrealize(DeviceState *dev)
     qemu_unregister_reset(serial_reset, s);
 }
 
-/* Change the main reference oscillator frequency. */
-void serial_set_frequency(SerialState *s, uint32_t frequency)
-{
-    s->baudbase = frequency;
-    serial_update_parameters(s);
-}
-
 const MemoryRegionOps serial_io_ops = {
     .read = serial_ioport_read,
     .write = serial_ioport_write,
diff --git a/include/hw/char/serial.h b/include/hw/char/serial.h
index 6e14099ee7..40aad21df3 100644
--- a/include/hw/char/serial.h
+++ b/include/hw/char/serial.h
@@ -93,8 +93,6 @@ struct SerialMM {
 extern const VMStateDescription vmstate_serial;
 extern const MemoryRegionOps serial_io_ops;
 
-void serial_set_frequency(SerialState *s, uint32_t frequency);
-
 #define TYPE_SERIAL "serial"
 OBJECT_DECLARE_SIMPLE_TYPE(SerialState, SERIAL)
 
-- 
2.46.0
Re: [PATCH] hw/char: Remove unused serial_set_frequency
Posted by Philippe Mathieu-Daudé 1 month, 3 weeks ago
On 18/9/24 16:41, dave@treblig.org wrote:
> From: "Dr. David Alan Gilbert" <dave@treblig.org>
> 
> serial_set_frequnecy has been unused since it was added in 2009:
>    038eaf82c8 ("serial: Add interface to set reference oscillator frequency")
> 
> It looks like the 'baudbase' is now a property anyway so the wrapper
> isn't needed.
> 
> Remove it.

See previous patch from Bernhard:
https://lore.kernel.org/qemu-devel/d8ffe38c-756d-4187-875e-e6697631b7fa@linaro.org/
Anyhow no objection at this point.

> 
> Signed-off-by: Dr. David Alan Gilbert <dave@treblig.org>
> ---
>   hw/char/serial.c         | 7 -------
>   include/hw/char/serial.h | 2 --
>   2 files changed, 9 deletions(-)
> 
> diff --git a/hw/char/serial.c b/hw/char/serial.c
> index d8b2db5082..6c5c4a23c7 100644
> --- a/hw/char/serial.c
> +++ b/hw/char/serial.c
> @@ -951,13 +951,6 @@ static void serial_unrealize(DeviceState *dev)
>       qemu_unregister_reset(serial_reset, s);
>   }
>   
> -/* Change the main reference oscillator frequency. */
> -void serial_set_frequency(SerialState *s, uint32_t frequency)
> -{
> -    s->baudbase = frequency;
> -    serial_update_parameters(s);
> -}
> -
>   const MemoryRegionOps serial_io_ops = {
>       .read = serial_ioport_read,
>       .write = serial_ioport_write,
> diff --git a/include/hw/char/serial.h b/include/hw/char/serial.h
> index 6e14099ee7..40aad21df3 100644
> --- a/include/hw/char/serial.h
> +++ b/include/hw/char/serial.h
> @@ -93,8 +93,6 @@ struct SerialMM {
>   extern const VMStateDescription vmstate_serial;
>   extern const MemoryRegionOps serial_io_ops;
>   
> -void serial_set_frequency(SerialState *s, uint32_t frequency);
> -
>   #define TYPE_SERIAL "serial"
>   OBJECT_DECLARE_SIMPLE_TYPE(SerialState, SERIAL)
>
Re: [PATCH] hw/char: Remove unused serial_set_frequency
Posted by Thomas Huth 1 month, 3 weeks ago
On 18/09/2024 16.41, dave@treblig.org wrote:
> From: "Dr. David Alan Gilbert" <dave@treblig.org>
> 
> serial_set_frequnecy has been unused since it was added in 2009:
>    038eaf82c8 ("serial: Add interface to set reference oscillator frequency")
> 
> It looks like the 'baudbase' is now a property anyway so the wrapper
> isn't needed.
> 
> Remove it.
> 
> Signed-off-by: Dr. David Alan Gilbert <dave@treblig.org>
> ---
>   hw/char/serial.c         | 7 -------
>   include/hw/char/serial.h | 2 --
>   2 files changed, 9 deletions(-)
> 
> diff --git a/hw/char/serial.c b/hw/char/serial.c
> index d8b2db5082..6c5c4a23c7 100644
> --- a/hw/char/serial.c
> +++ b/hw/char/serial.c
> @@ -951,13 +951,6 @@ static void serial_unrealize(DeviceState *dev)
>       qemu_unregister_reset(serial_reset, s);
>   }
>   
> -/* Change the main reference oscillator frequency. */
> -void serial_set_frequency(SerialState *s, uint32_t frequency)
> -{
> -    s->baudbase = frequency;
> -    serial_update_parameters(s);
> -}
> -
>   const MemoryRegionOps serial_io_ops = {
>       .read = serial_ioport_read,
>       .write = serial_ioport_write,
> diff --git a/include/hw/char/serial.h b/include/hw/char/serial.h
> index 6e14099ee7..40aad21df3 100644
> --- a/include/hw/char/serial.h
> +++ b/include/hw/char/serial.h
> @@ -93,8 +93,6 @@ struct SerialMM {
>   extern const VMStateDescription vmstate_serial;
>   extern const MemoryRegionOps serial_io_ops;
>   
> -void serial_set_frequency(SerialState *s, uint32_t frequency);
> -
>   #define TYPE_SERIAL "serial"
>   OBJECT_DECLARE_SIMPLE_TYPE(SerialState, SERIAL)
>   

Reviewed-by: Thomas Huth <thuth@redhat.com>