diff mbox series

[21/32] hw/i386/pc: Reduce gsi_handler scope

Message ID 20191015162705.28087-22-philmd@redhat.com (mailing list archive)
State Superseded
Headers show
Series hw/i386/pc: Split PIIX3 southbridge from i440FX northbridge | expand

Commit Message

Philippe Mathieu-Daudé Oct. 15, 2019, 4:26 p.m. UTC
pc_gsi_create() is the single function that uses gsi_handler.
Make it a static variable.

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 hw/i386/pc.c         | 2 +-
 include/hw/i386/pc.h | 2 --
 2 files changed, 1 insertion(+), 3 deletions(-)

Comments

Aleksandar Markovic Oct. 17, 2019, 3:16 p.m. UTC | #1
On Tuesday, October 15, 2019, Philippe Mathieu-Daudé <philmd@redhat.com>
wrote:

> pc_gsi_create() is the single function that uses gsi_handler.
> Make it a static variable.
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> ---
>  hw/i386/pc.c         | 2 +-
>  include/hw/i386/pc.h | 2 --
>  2 files changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/hw/i386/pc.c b/hw/i386/pc.c
> index a7597c6c44..59de0c8a1f 100644
> --- a/hw/i386/pc.c
> +++ b/hw/i386/pc.c
> @@ -346,7 +346,7 @@ GlobalProperty pc_compat_1_4[] = {
>  };
>  const size_t pc_compat_1_4_len = G_N_ELEMENTS(pc_compat_1_4);
>
> -void gsi_handler(void *opaque, int n, int level)
> +static void gsi_handler(void *opaque, int n, int level)
>  {
>      GSIState *s = opaque;
>
> diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h
> index d0c6b9d469..75b44e156c 100644
> --- a/include/hw/i386/pc.h
> +++ b/include/hw/i386/pc.h
> @@ -172,8 +172,6 @@ typedef struct GSIState {
>      qemu_irq ioapic_irq[IOAPIC_NUM_PINS];
>  } GSIState;
>
> -void gsi_handler(void *opaque, int n, int level);
> -
>  GSIState *pc_gsi_create(qemu_irq **irqs, bool pci_enabled);
>
>
Philippe, this 2-line deletion seems not to belong to this patch. If true,
please place it in another or a separate patch.

A.



>  /* vmport.c */
> --
> 2.21.0
>
>
>
Philippe Mathieu-Daudé Oct. 17, 2019, 3:37 p.m. UTC | #2
On 10/17/19 5:16 PM, Aleksandar Markovic wrote:
> On Tuesday, October 15, 2019, Philippe Mathieu-Daudé <philmd@redhat.com 
> <mailto:philmd@redhat.com>> wrote:
> 
>     pc_gsi_create() is the single function that uses gsi_handler.
>     Make it a static variable.
> 
>     Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com
>     <mailto:philmd@redhat.com>>
>     ---
>       hw/i386/pc.c         | 2 +-
>       include/hw/i386/pc.h | 2 --
>       2 files changed, 1 insertion(+), 3 deletions(-)
> 
>     diff --git a/hw/i386/pc.c b/hw/i386/pc.c
>     index a7597c6c44..59de0c8a1f 100644
>     --- a/hw/i386/pc.c
>     +++ b/hw/i386/pc.c
>     @@ -346,7 +346,7 @@ GlobalProperty pc_compat_1_4[] = {
>       };
>       const size_t pc_compat_1_4_len = G_N_ELEMENTS(pc_compat_1_4);
> 
>     -void gsi_handler(void *opaque, int n, int level)
>     +static void gsi_handler(void *opaque, int n, int level)
>       {
>           GSIState *s = opaque;
> 
>     diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h
>     index d0c6b9d469..75b44e156c 100644
>     --- a/include/hw/i386/pc.h
>     +++ b/include/hw/i386/pc.h
>     @@ -172,8 +172,6 @@ typedef struct GSIState {
>           qemu_irq ioapic_irq[IOAPIC_NUM_PINS];
>       } GSIState;
> 
>     -void gsi_handler(void *opaque, int n, int level);
>     -
>       GSIState *pc_gsi_create(qemu_irq **irqs, bool pci_enabled);
> 
> 
> Philippe, this 2-line deletion seems not to belong to this patch. If 
> true, please place it in another or a separate patch.

It does, this is the point of the change, make it static and remove its 
declaration :)
Thomas Huth Oct. 17, 2019, 3:41 p.m. UTC | #3
On 15/10/2019 18.26, Philippe Mathieu-Daudé wrote:
> pc_gsi_create() is the single function that uses gsi_handler.
> Make it a static variable.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> ---
>  hw/i386/pc.c         | 2 +-
>  include/hw/i386/pc.h | 2 --
>  2 files changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/hw/i386/pc.c b/hw/i386/pc.c
> index a7597c6c44..59de0c8a1f 100644
> --- a/hw/i386/pc.c
> +++ b/hw/i386/pc.c
> @@ -346,7 +346,7 @@ GlobalProperty pc_compat_1_4[] = {
>  };
>  const size_t pc_compat_1_4_len = G_N_ELEMENTS(pc_compat_1_4);
>  
> -void gsi_handler(void *opaque, int n, int level)
> +static void gsi_handler(void *opaque, int n, int level)
>  {
>      GSIState *s = opaque;
>  
> diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h
> index d0c6b9d469..75b44e156c 100644
> --- a/include/hw/i386/pc.h
> +++ b/include/hw/i386/pc.h
> @@ -172,8 +172,6 @@ typedef struct GSIState {
>      qemu_irq ioapic_irq[IOAPIC_NUM_PINS];
>  } GSIState;
>  
> -void gsi_handler(void *opaque, int n, int level);
> -
>  GSIState *pc_gsi_create(qemu_irq **irqs, bool pci_enabled);
>  
>  /* vmport.c */
> 

Reviewed-by: Thomas Huth <thuth@redhat.com>
Aleksandar Markovic Oct. 17, 2019, 4:21 p.m. UTC | #4
On Thursday, October 17, 2019, Philippe Mathieu-Daudé <philmd@redhat.com>
wrote:

> On 10/17/19 5:16 PM, Aleksandar Markovic wrote:
>
>> On Tuesday, October 15, 2019, Philippe Mathieu-Daudé <philmd@redhat.com
>> <mailto:philmd@redhat.com>> wrote:
>>
>>     pc_gsi_create() is the single function that uses gsi_handler.
>>     Make it a static variable.
>>
>>     Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com
>>     <mailto:philmd@redhat.com>>
>>     ---
>>       hw/i386/pc.c         | 2 +-
>>       include/hw/i386/pc.h | 2 --
>>       2 files changed, 1 insertion(+), 3 deletions(-)
>>
>>     diff --git a/hw/i386/pc.c b/hw/i386/pc.c
>>     index a7597c6c44..59de0c8a1f 100644
>>     --- a/hw/i386/pc.c
>>     +++ b/hw/i386/pc.c
>>     @@ -346,7 +346,7 @@ GlobalProperty pc_compat_1_4[] = {
>>       };
>>       const size_t pc_compat_1_4_len = G_N_ELEMENTS(pc_compat_1_4);
>>
>>     -void gsi_handler(void *opaque, int n, int level)
>>     +static void gsi_handler(void *opaque, int n, int level)
>>       {
>>           GSIState *s = opaque;
>>
>>     diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h
>>     index d0c6b9d469..75b44e156c 100644
>>     --- a/include/hw/i386/pc.h
>>     +++ b/include/hw/i386/pc.h
>>     @@ -172,8 +172,6 @@ typedef struct GSIState {
>>           qemu_irq ioapic_irq[IOAPIC_NUM_PINS];
>>       } GSIState;
>>
>>     -void gsi_handler(void *opaque, int n, int level);
>>     -
>>       GSIState *pc_gsi_create(qemu_irq **irqs, bool pci_enabled);
>>
>>
>> Philippe, this 2-line deletion seems not to belong to this patch. If
>> true, please place it in another or a separate patch.
>>
>
> It does, this is the point of the change, make it static and remove its
> declaration :)
>


OK, I see.

Reviewed-by: Aleksandar Markovic <amarkovic@wavecomp.com>
diff mbox series

Patch

diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index a7597c6c44..59de0c8a1f 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -346,7 +346,7 @@  GlobalProperty pc_compat_1_4[] = {
 };
 const size_t pc_compat_1_4_len = G_N_ELEMENTS(pc_compat_1_4);
 
-void gsi_handler(void *opaque, int n, int level)
+static void gsi_handler(void *opaque, int n, int level)
 {
     GSIState *s = opaque;
 
diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h
index d0c6b9d469..75b44e156c 100644
--- a/include/hw/i386/pc.h
+++ b/include/hw/i386/pc.h
@@ -172,8 +172,6 @@  typedef struct GSIState {
     qemu_irq ioapic_irq[IOAPIC_NUM_PINS];
 } GSIState;
 
-void gsi_handler(void *opaque, int n, int level);
-
 GSIState *pc_gsi_create(qemu_irq **irqs, bool pci_enabled);
 
 /* vmport.c */