qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] smc37c669: remove useless is_enabled functions
@ 2024-01-29 13:34 Paolo Bonzini
  2024-01-30  0:36 ` Bernhard Beschow
  0 siblings, 1 reply; 2+ messages in thread
From: Paolo Bonzini @ 2024-01-29 13:34 UTC (permalink / raw)
  To: qemu-devel

Calls to is_enabled are bounded to indices that actually exist in
the SuperIO device.  Therefore, the is_enabled functions in
smc37c669 are not doing anything and they can be removed.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 hw/isa/smc37c669-superio.c | 18 ------------------
 1 file changed, 18 deletions(-)

diff --git a/hw/isa/smc37c669-superio.c b/hw/isa/smc37c669-superio.c
index 18287741cb4..388e2ed9371 100644
--- a/hw/isa/smc37c669-superio.c
+++ b/hw/isa/smc37c669-superio.c
@@ -14,11 +14,6 @@
 
 /* UARTs (compatible with NS16450 or PC16550) */
 
-static bool is_serial_enabled(ISASuperIODevice *sio, uint8_t index)
-{
-    return index < 2;
-}
-
 static uint16_t get_serial_iobase(ISASuperIODevice *sio, uint8_t index)
 {
     return index ? 0x2f8 : 0x3f8;
@@ -31,11 +26,6 @@ static unsigned int get_serial_irq(ISASuperIODevice *sio, uint8_t index)
 
 /* Parallel port */
 
-static bool is_parallel_enabled(ISASuperIODevice *sio, uint8_t index)
-{
-    return index < 1;
-}
-
 static uint16_t get_parallel_iobase(ISASuperIODevice *sio, uint8_t index)
 {
     return 0x378;
@@ -53,11 +43,6 @@ static unsigned int get_parallel_dma(ISASuperIODevice *sio, uint8_t index)
 
 /* Diskette controller (Software compatible with the Intel PC8477) */
 
-static bool is_fdc_enabled(ISASuperIODevice *sio, uint8_t index)
-{
-    return index < 1;
-}
-
 static uint16_t get_fdc_iobase(ISASuperIODevice *sio, uint8_t index)
 {
     return 0x3f0;
@@ -79,20 +64,17 @@ static void smc37c669_class_init(ObjectClass *klass, void *data)
 
     sc->parallel = (ISASuperIOFuncs){
         .count = 1,
-        .is_enabled = is_parallel_enabled,
         .get_iobase = get_parallel_iobase,
         .get_irq    = get_parallel_irq,
         .get_dma    = get_parallel_dma,
     };
     sc->serial = (ISASuperIOFuncs){
         .count = 2,
-        .is_enabled = is_serial_enabled,
         .get_iobase = get_serial_iobase,
         .get_irq    = get_serial_irq,
     };
     sc->floppy = (ISASuperIOFuncs){
         .count = 1,
-        .is_enabled = is_fdc_enabled,
         .get_iobase = get_fdc_iobase,
         .get_irq    = get_fdc_irq,
         .get_dma    = get_fdc_dma,
-- 
2.43.0



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] smc37c669: remove useless is_enabled functions
  2024-01-29 13:34 [PATCH] smc37c669: remove useless is_enabled functions Paolo Bonzini
@ 2024-01-30  0:36 ` Bernhard Beschow
  0 siblings, 0 replies; 2+ messages in thread
From: Bernhard Beschow @ 2024-01-30  0:36 UTC (permalink / raw)
  To: qemu-devel, Paolo Bonzini



Am 29. Januar 2024 13:34:20 UTC schrieb Paolo Bonzini <pbonzini@redhat.com>:
>Calls to is_enabled are bounded to indices that actually exist in
>the SuperIO device.  Therefore, the is_enabled functions in
>smc37c669 are not doing anything and they can be removed.

Indeed isa_superio_realize() only considers .count instances respectively and `qemu-system-alpha -M clipper` prints something on the screen. So:

Reviewed-by: Bernhard Beschow <shentey@gmail.com>

>
>Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
>---
> hw/isa/smc37c669-superio.c | 18 ------------------
> 1 file changed, 18 deletions(-)
>
>diff --git a/hw/isa/smc37c669-superio.c b/hw/isa/smc37c669-superio.c
>index 18287741cb4..388e2ed9371 100644
>--- a/hw/isa/smc37c669-superio.c
>+++ b/hw/isa/smc37c669-superio.c
>@@ -14,11 +14,6 @@
> 
> /* UARTs (compatible with NS16450 or PC16550) */
> 
>-static bool is_serial_enabled(ISASuperIODevice *sio, uint8_t index)
>-{
>-    return index < 2;
>-}
>-
> static uint16_t get_serial_iobase(ISASuperIODevice *sio, uint8_t index)
> {
>     return index ? 0x2f8 : 0x3f8;
>@@ -31,11 +26,6 @@ static unsigned int get_serial_irq(ISASuperIODevice *sio, uint8_t index)
> 
> /* Parallel port */
> 
>-static bool is_parallel_enabled(ISASuperIODevice *sio, uint8_t index)
>-{
>-    return index < 1;
>-}
>-
> static uint16_t get_parallel_iobase(ISASuperIODevice *sio, uint8_t index)
> {
>     return 0x378;
>@@ -53,11 +43,6 @@ static unsigned int get_parallel_dma(ISASuperIODevice *sio, uint8_t index)
> 
> /* Diskette controller (Software compatible with the Intel PC8477) */
> 
>-static bool is_fdc_enabled(ISASuperIODevice *sio, uint8_t index)
>-{
>-    return index < 1;
>-}
>-
> static uint16_t get_fdc_iobase(ISASuperIODevice *sio, uint8_t index)
> {
>     return 0x3f0;
>@@ -79,20 +64,17 @@ static void smc37c669_class_init(ObjectClass *klass, void *data)
> 
>     sc->parallel = (ISASuperIOFuncs){
>         .count = 1,
>-        .is_enabled = is_parallel_enabled,
>         .get_iobase = get_parallel_iobase,
>         .get_irq    = get_parallel_irq,
>         .get_dma    = get_parallel_dma,
>     };
>     sc->serial = (ISASuperIOFuncs){
>         .count = 2,
>-        .is_enabled = is_serial_enabled,
>         .get_iobase = get_serial_iobase,
>         .get_irq    = get_serial_irq,
>     };
>     sc->floppy = (ISASuperIOFuncs){
>         .count = 1,
>-        .is_enabled = is_fdc_enabled,
>         .get_iobase = get_fdc_iobase,
>         .get_irq    = get_fdc_irq,
>         .get_dma    = get_fdc_dma,


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-01-30  0:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-29 13:34 [PATCH] smc37c669: remove useless is_enabled functions Paolo Bonzini
2024-01-30  0:36 ` Bernhard Beschow

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).