diff mbox series

console: conditionalize console_input_domain()

Message ID 59c59b19-40e0-aa1e-d775-31963e03144a@suse.com (mailing list archive)
State New, archived
Headers show
Series console: conditionalize console_input_domain() | expand

Commit Message

Jan Beulich Oct. 30, 2023, 1:16 p.m. UTC
The function was introduced for just one piece of code to use; it is
dead code in cases where the respective Kconfig option is disabled, thus
violating Misra C:2012 rule 2.1 there.

Signed-off-by: Jan Beulich <jbeulich@suse.com>

Comments

Stefano Stabellini Oct. 30, 2023, 8:28 p.m. UTC | #1
On Mon, 30 Oct 2023, Jan Beulich wrote:
> The function was introduced for just one piece of code to use; it is
> dead code in cases where the respective Kconfig option is disabled, thus
> violating Misra C:2012 rule 2.1 there.
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

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


> --- a/xen/drivers/char/console.c
> +++ b/xen/drivers/char/console.c
> @@ -475,6 +475,7 @@ static unsigned int __read_mostly consol
>  
>  #define max_console_rx (max_init_domid + 1)
>  
> +#ifdef CONFIG_SBSA_VUART_CONSOLE
>  /* Make sure to rcu_unlock_domain after use */
>  struct domain *console_input_domain(void)
>  {
> @@ -482,6 +483,7 @@ struct domain *console_input_domain(void
>              return NULL;
>      return rcu_lock_domain_by_id(console_rx - 1);
>  }
> +#endif
>  
>  static void switch_serial_input(void)
>  {
>
diff mbox series

Patch

--- a/xen/drivers/char/console.c
+++ b/xen/drivers/char/console.c
@@ -475,6 +475,7 @@  static unsigned int __read_mostly consol
 
 #define max_console_rx (max_init_domid + 1)
 
+#ifdef CONFIG_SBSA_VUART_CONSOLE
 /* Make sure to rcu_unlock_domain after use */
 struct domain *console_input_domain(void)
 {
@@ -482,6 +483,7 @@  struct domain *console_input_domain(void
             return NULL;
     return rcu_lock_domain_by_id(console_rx - 1);
 }
+#endif
 
 static void switch_serial_input(void)
 {