[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Xen-devel] [PATCH] ns16550: Re-order the serial port address checking
- To: Wei Xu <xuwei5@xxxxxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- From: Julien Grall <julien@xxxxxxx>
- Date: Mon, 24 Feb 2020 22:03:39 +0000
- Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>, "Zengtao \(B\)" <prime.zeng@xxxxxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>, George Dunlap <George.Dunlap@xxxxxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Ian Jackson <ian.jackson@xxxxxxxxxxxxx>, Linuxarm <linuxarm@xxxxxxxxxx>, Shameerali Kolothum Thodi <shameerali.kolothum.thodi@xxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>
- Delivery-date: Mon, 24 Feb 2020 22:04:09 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
Hi Wei,
Thank you for sending a follow-up.
On 24/02/2020 11:30, Wei Xu wrote:
Check the serial port address space before checking the address.
Could you explain in a sentence why you want to re-order?
Cheers,
Signed-off-by: Wei Xu <xuwei5@xxxxxxxxxxxxx>
---
xen/drivers/char/ns16550.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/xen/drivers/char/ns16550.c b/xen/drivers/char/ns16550.c
index dc8ac4c..425e044 100644
--- a/xen/drivers/char/ns16550.c
+++ b/xen/drivers/char/ns16550.c
@@ -1644,6 +1644,12 @@ static int __init ns16550_acpi_uart_init(const void
*data)
spcr = container_of(table, struct acpi_table_spcr, header);
+ if ( unlikely(spcr->serial_port.space_id != ACPI_ADR_SPACE_SYSTEM_MEMORY) )
+ {
+ printk("ns16550: Address space type is not mmio\n");
+ return -EINVAL;
+ }
+
/*
* The serial port address may be 0 for example
* if the console redirection is disabled.
@@ -1654,12 +1660,6 @@ static int __init ns16550_acpi_uart_init(const void
*data)
return -EINVAL;
}
- if ( unlikely(spcr->serial_port.space_id != ACPI_ADR_SPACE_SYSTEM_MEMORY) )
- {
- printk("ns16550: Address space type is not mmio\n");
- return -EINVAL;
- }
-
ns16550_init_common(uart);
/*
--
Julien Grall
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel
|