diff mbox series

[2/3] xen/x86: Drop useless non-Kconfig CONFIG_* variables

Message ID 20240521171546.3650664-3-andrew.cooper3@citrix.com (mailing list archive)
State New
Headers show
Series xen: Misc MISRA changes | expand

Commit Message

Andrew Cooper May 21, 2024, 5:15 p.m. UTC
These are all either completely unused, or do nothing useful.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
CC: George Dunlap <George.Dunlap@citrix.com>
CC: Jan Beulich <JBeulich@suse.com>
CC: Stefano Stabellini <sstabellini@kernel.org>
CC: Julien Grall <julien@xen.org>
CC: Roberto Bagnara <roberto.bagnara@bugseng.com>
CC: consulting@bugseng.com <consulting@bugseng.com>
CC: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
 xen/arch/x86/include/asm/config.h |  4 ----
 xen/include/xen/acpi.h            |  9 ---------
 xen/include/xen/watchdog.h        | 11 -----------
 3 files changed, 24 deletions(-)

Comments

Stefano Stabellini May 22, 2024, 1:24 a.m. UTC | #1
On Tue, 21 May 2024, Andrew Cooper wrote:
> These are all either completely unused, or do nothing useful.
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>

Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>

> ---
> CC: George Dunlap <George.Dunlap@citrix.com>
> CC: Jan Beulich <JBeulich@suse.com>
> CC: Stefano Stabellini <sstabellini@kernel.org>
> CC: Julien Grall <julien@xen.org>
> CC: Roberto Bagnara <roberto.bagnara@bugseng.com>
> CC: consulting@bugseng.com <consulting@bugseng.com>
> CC: Oleksii Kurochko <oleksii.kurochko@gmail.com>
> ---
>  xen/arch/x86/include/asm/config.h |  4 ----
>  xen/include/xen/acpi.h            |  9 ---------
>  xen/include/xen/watchdog.h        | 11 -----------
>  3 files changed, 24 deletions(-)
> 
> diff --git a/xen/arch/x86/include/asm/config.h b/xen/arch/x86/include/asm/config.h
> index ab7288cb3682..24b005ba1ff7 100644
> --- a/xen/arch/x86/include/asm/config.h
> +++ b/xen/arch/x86/include/asm/config.h
> @@ -20,7 +20,6 @@
>  #define BITS_PER_XEN_ULONG BITS_PER_LONG
>  
>  #define CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS 1
> -#define CONFIG_DISCONTIGMEM 1
>  #define CONFIG_NUMA_EMU 1
>  
>  #define CONFIG_PAGEALLOC_MAX_ORDER (2 * PAGETABLE_ORDER)
> @@ -30,11 +29,8 @@
>  /* Intel P4 currently has largest cache line (L2 line size is 128 bytes). */
>  #define CONFIG_X86_L1_CACHE_SHIFT 7
>  
> -#define CONFIG_ACPI_SRAT 1
>  #define CONFIG_ACPI_CSTATE 1
>  
> -#define CONFIG_WATCHDOG 1
> -
>  #define CONFIG_MULTIBOOT 1
>  
>  #define HZ 100
> diff --git a/xen/include/xen/acpi.h b/xen/include/xen/acpi.h
> index e78e7e785252..bc4818c9430a 100644
> --- a/xen/include/xen/acpi.h
> +++ b/xen/include/xen/acpi.h
> @@ -140,15 +140,6 @@ int get_cpu_id(u32 acpi_id);
>  unsigned int acpi_register_gsi (u32 gsi, int edge_level, int active_high_low);
>  int acpi_gsi_to_irq (u32 gsi, unsigned int *irq);
>  
> -/*
> - * This function undoes the effect of one call to acpi_register_gsi().
> - * If this matches the last registration, any IRQ resources for gsi
> - * are freed.
> - */
> -#ifdef CONFIG_ACPI_DEALLOCATE_IRQ
> -void acpi_unregister_gsi (u32 gsi);
> -#endif
> -
>  #ifdef	CONFIG_ACPI_CSTATE
>  /*
>   * max_cstate sets the highest legal C-state.
> diff --git a/xen/include/xen/watchdog.h b/xen/include/xen/watchdog.h
> index 86fde0884ae7..434fcbdd2b11 100644
> --- a/xen/include/xen/watchdog.h
> +++ b/xen/include/xen/watchdog.h
> @@ -9,8 +9,6 @@
>  
>  #include <xen/types.h>
>  
> -#ifdef CONFIG_WATCHDOG
> -
>  /* Try to set up a watchdog. */
>  int watchdog_setup(void);
>  
> @@ -23,13 +21,4 @@ void watchdog_disable(void);
>  /* Is the watchdog currently enabled. */
>  bool watchdog_enabled(void);
>  
> -#else
> -
> -#define watchdog_setup() ((void)0)
> -#define watchdog_enable() ((void)0)
> -#define watchdog_disable() ((void)0)
> -#define watchdog_enabled() ((void)0)
> -
> -#endif
> -
>  #endif /* __XEN_WATCHDOG_H__ */
> -- 
> 2.30.2
>
Jan Beulich May 22, 2024, 6:03 a.m. UTC | #2
On 21.05.2024 19:15, Andrew Cooper wrote:
> These are all either completely unused, or do nothing useful.
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>

Not an objection, i.e. you're fine to commit as is with Stefano's R-b, yet
still a question:

> @@ -30,11 +29,8 @@
>  /* Intel P4 currently has largest cache line (L2 line size is 128 bytes). */
>  #define CONFIG_X86_L1_CACHE_SHIFT 7
>  
> -#define CONFIG_ACPI_SRAT 1
>  #define CONFIG_ACPI_CSTATE 1
>  
> -#define CONFIG_WATCHDOG 1

I wonder if this wouldn't make sense to become a proper Kconfig setting,
thus ...

> --- a/xen/include/xen/watchdog.h
> +++ b/xen/include/xen/watchdog.h
> @@ -9,8 +9,6 @@
>  
>  #include <xen/types.h>
>  
> -#ifdef CONFIG_WATCHDOG
> -
>  /* Try to set up a watchdog. */
>  int watchdog_setup(void);
>  
> @@ -23,13 +21,4 @@ void watchdog_disable(void);
>  /* Is the watchdog currently enabled. */
>  bool watchdog_enabled(void);
>  
> -#else
> -
> -#define watchdog_setup() ((void)0)
> -#define watchdog_enable() ((void)0)
> -#define watchdog_disable() ((void)0)
> -#define watchdog_enabled() ((void)0)
> -
> -#endif

... assigning purpose to these stubs.

Jan
Andrew Cooper May 28, 2024, 4:22 p.m. UTC | #3
On 22/05/2024 7:03 am, Jan Beulich wrote:
> On 21.05.2024 19:15, Andrew Cooper wrote:
>> These are all either completely unused, or do nothing useful.
>>
>> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
> Not an objection, i.e. you're fine to commit as is with Stefano's R-b, yet
> still a question:
>
>> @@ -30,11 +29,8 @@
>>  /* Intel P4 currently has largest cache line (L2 line size is 128 bytes). */
>>  #define CONFIG_X86_L1_CACHE_SHIFT 7
>>  
>> -#define CONFIG_ACPI_SRAT 1
>>  #define CONFIG_ACPI_CSTATE 1
>>  
>> -#define CONFIG_WATCHDOG 1
> I wonder if this wouldn't make sense to become a proper Kconfig setting,
> thus ...
>
>> --- a/xen/include/xen/watchdog.h
>> +++ b/xen/include/xen/watchdog.h
>> @@ -9,8 +9,6 @@
>>  
>>  #include <xen/types.h>
>>  
>> -#ifdef CONFIG_WATCHDOG
>> -
>>  /* Try to set up a watchdog. */
>>  int watchdog_setup(void);
>>  
>> @@ -23,13 +21,4 @@ void watchdog_disable(void);
>>  /* Is the watchdog currently enabled. */
>>  bool watchdog_enabled(void);
>>  
>> -#else
>> -
>> -#define watchdog_setup() ((void)0)
>> -#define watchdog_enable() ((void)0)
>> -#define watchdog_disable() ((void)0)
>> -#define watchdog_enabled() ((void)0)
>> -
>> -#endif
> ... assigning purpose to these stubs.

Actually I need to keep CONFIG_WATCHDOG to not break the build on other
architectures.

watchdog_{en,dis}able() are called from common/{debugtrace,keyhandler}.c.

I'll leave it in place for now, and we can Kconfig it up later.

~Andrew
diff mbox series

Patch

diff --git a/xen/arch/x86/include/asm/config.h b/xen/arch/x86/include/asm/config.h
index ab7288cb3682..24b005ba1ff7 100644
--- a/xen/arch/x86/include/asm/config.h
+++ b/xen/arch/x86/include/asm/config.h
@@ -20,7 +20,6 @@ 
 #define BITS_PER_XEN_ULONG BITS_PER_LONG
 
 #define CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS 1
-#define CONFIG_DISCONTIGMEM 1
 #define CONFIG_NUMA_EMU 1
 
 #define CONFIG_PAGEALLOC_MAX_ORDER (2 * PAGETABLE_ORDER)
@@ -30,11 +29,8 @@ 
 /* Intel P4 currently has largest cache line (L2 line size is 128 bytes). */
 #define CONFIG_X86_L1_CACHE_SHIFT 7
 
-#define CONFIG_ACPI_SRAT 1
 #define CONFIG_ACPI_CSTATE 1
 
-#define CONFIG_WATCHDOG 1
-
 #define CONFIG_MULTIBOOT 1
 
 #define HZ 100
diff --git a/xen/include/xen/acpi.h b/xen/include/xen/acpi.h
index e78e7e785252..bc4818c9430a 100644
--- a/xen/include/xen/acpi.h
+++ b/xen/include/xen/acpi.h
@@ -140,15 +140,6 @@  int get_cpu_id(u32 acpi_id);
 unsigned int acpi_register_gsi (u32 gsi, int edge_level, int active_high_low);
 int acpi_gsi_to_irq (u32 gsi, unsigned int *irq);
 
-/*
- * This function undoes the effect of one call to acpi_register_gsi().
- * If this matches the last registration, any IRQ resources for gsi
- * are freed.
- */
-#ifdef CONFIG_ACPI_DEALLOCATE_IRQ
-void acpi_unregister_gsi (u32 gsi);
-#endif
-
 #ifdef	CONFIG_ACPI_CSTATE
 /*
  * max_cstate sets the highest legal C-state.
diff --git a/xen/include/xen/watchdog.h b/xen/include/xen/watchdog.h
index 86fde0884ae7..434fcbdd2b11 100644
--- a/xen/include/xen/watchdog.h
+++ b/xen/include/xen/watchdog.h
@@ -9,8 +9,6 @@ 
 
 #include <xen/types.h>
 
-#ifdef CONFIG_WATCHDOG
-
 /* Try to set up a watchdog. */
 int watchdog_setup(void);
 
@@ -23,13 +21,4 @@  void watchdog_disable(void);
 /* Is the watchdog currently enabled. */
 bool watchdog_enabled(void);
 
-#else
-
-#define watchdog_setup() ((void)0)
-#define watchdog_enable() ((void)0)
-#define watchdog_disable() ((void)0)
-#define watchdog_enabled() ((void)0)
-
-#endif
-
 #endif /* __XEN_WATCHDOG_H__ */