[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[xen master] ns16550: Guard accesses to `vuart` field by CONFIG_ARM



commit f974004ccb69d2d987815b431a5f58672e6e4686
Author:     Shawn Anastasio <sanastasio@xxxxxxxxxxxxxxxxxxxxx>
AuthorDate: Wed Aug 9 09:04:24 2023 +0200
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Wed Aug 9 09:04:24 2023 +0200

    ns16550: Guard accesses to `vuart` field by CONFIG_ARM
    
    When CONFIG_ARM is defined, a `vuart` field is added to struct ns16550,
    but accesses to this field in ns16550_uart_dt_init weren't correctly
    guarded. Fix build on !ARM platforms that define CONFIG_HAS_DEVICE_TREE
    by correctly guarding access to the vuart field in this function.
    
    Signed-off-by: Shawn Anastasio <sanastasio@xxxxxxxxxxxxxxxxxxxxx>
    Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>
---
 xen/drivers/char/ns16550.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/xen/drivers/char/ns16550.c b/xen/drivers/char/ns16550.c
index b75e7f8fa0..28ddedd50d 100644
--- a/xen/drivers/char/ns16550.c
+++ b/xen/drivers/char/ns16550.c
@@ -1797,11 +1797,13 @@ static int __init ns16550_uart_dt_init(struct 
dt_device_node *dev,
 
     uart->dw_usr_bsy = dt_device_is_compatible(dev, "snps,dw-apb-uart");
 
+#ifdef CONFIG_ARM
     uart->vuart.base_addr = uart->io_base;
     uart->vuart.size = uart->io_size;
     uart->vuart.data_off = UART_THR <<uart->reg_shift;
     uart->vuart.status_off = UART_LSR<<uart->reg_shift;
     uart->vuart.status = UART_LSR_THRE|UART_LSR_TEMT;
+#endif
 
     /* Register with generic serial driver. */
     serial_register_uart(uart - ns16550_com, &ns16550_driver, uart);
--
generated by git-patchbot for /home/xen/git/xen.git#master



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.