]> xenbits.xensource.com Git - people/royger/xen.git/commitdiff
console: conditionalize console_input_domain()
authorJan Beulich <jbeulich@suse.com>
Fri, 3 Nov 2023 10:23:18 +0000 (11:23 +0100)
committerJan Beulich <jbeulich@suse.com>
Fri, 3 Nov 2023 10:23:18 +0000 (11:23 +0100)
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>
xen/drivers/char/console.c

index 6b679c5eac09fb253d4d02b59505424d4ffdb99d..4824d4a91d45e89f7f149d4d70f2880b7b675ddc 100644 (file)
@@ -475,6 +475,7 @@ static unsigned int __read_mostly console_rx = 0;
 
 #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)
 {