[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 09/13] hw/char/exynos4210_uart.c: Remove unneede
From: |
Philippe Mathieu-Daudé |
Subject: |
Re: [Qemu-devel] [PATCH 09/13] hw/char/exynos4210_uart.c: Remove unneeded handling of NULL chardev |
Date: |
Wed, 25 Apr 2018 11:59:13 -0300 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 |
On 04/20/2018 11:52 AM, Peter Maydell wrote:
> The handling of NULL chardevs in exynos4210_uart_create() is now
> all unnecessary: we don't need to create 'null' chardevs, and we
> don't need to enforce a bounds check on serial_hd().
>
> Signed-off-by: Peter Maydell <address@hidden>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
> ---
> hw/char/exynos4210_uart.c | 20 --------------------
> 1 file changed, 20 deletions(-)
>
> diff --git a/hw/char/exynos4210_uart.c b/hw/char/exynos4210_uart.c
> index c2bba03362..a5a285655f 100644
> --- a/hw/char/exynos4210_uart.c
> +++ b/hw/char/exynos4210_uart.c
> @@ -589,28 +589,8 @@ DeviceState *exynos4210_uart_create(hwaddr addr,
> DeviceState *dev;
> SysBusDevice *bus;
>
> - const char chr_name[] = "serial";
> - char label[ARRAY_SIZE(chr_name) + 1];
> -
> dev = qdev_create(NULL, TYPE_EXYNOS4210_UART);
>
> - if (!chr) {
> - if (channel >= MAX_SERIAL_PORTS) {
> - error_report("Only %d serial ports are supported by QEMU",
> - MAX_SERIAL_PORTS);
> - exit(1);
> - }
> - chr = serial_hd(channel);
> - if (!chr) {
> - snprintf(label, ARRAY_SIZE(label), "%s%d", chr_name, channel);
> - chr = qemu_chr_new(label, "null");
> - if (!(chr)) {
> - error_report("Can't assign serial port to UART%d", channel);
> - exit(1);
> - }
> - }
> - }
> -
> qdev_prop_set_chr(dev, "chardev", chr);
> qdev_prop_set_uint32(dev, "channel", channel);
> qdev_prop_set_uint32(dev, "rx-size", fifo_size);
>
- Re: [Qemu-devel] [PATCH 12/13] vl.c: Remove compile time limit on number of serial ports, (continued)
Re: [Qemu-devel] [PATCH 12/13] vl.c: Remove compile time limit on number of serial ports, Philippe Mathieu-Daudé, 2018/04/20
Re: [Qemu-devel] [PATCH 12/13] vl.c: Remove compile time limit on number of serial ports, Thomas Huth, 2018/04/25
[Qemu-devel] [PATCH 11/13] superio: Don't use MAX_SERIAL_PORTS for serial port limit, Peter Maydell, 2018/04/20
[Qemu-devel] [PATCH 13/13] vl.c: new function max_serial_hds(), Peter Maydell, 2018/04/20
[Qemu-devel] [PATCH 09/13] hw/char/exynos4210_uart.c: Remove unneeded handling of NULL chardev, Peter Maydell, 2018/04/20
[Qemu-devel] [PATCH 06/13] vl.c: Provide accessor function serial_hd() for serial_hds[] array, Peter Maydell, 2018/04/20
[Qemu-devel] [PATCH 05/13] hw/xtensa/xtfpga.c: Don't create "null" chardevs for serial devices, Peter Maydell, 2018/04/20
[Qemu-devel] [PATCH 04/13] hw/mips/mips_malta: Don't create "null" chardevs for serial devices, Peter Maydell, 2018/04/20