All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <f4bug@amsat.org>
To: Thomas Huth <thuth@redhat.com>,
	Peter Maydell <peter.maydell@linaro.org>,
	qemu-devel@nongnu.org
Cc: "Paolo Bonzini" <pbonzini@redhat.com>,
	"Michael S . Tsirkin" <mst@redhat.com>,
	"Marc-André Lureau" <marcandre.lureau@redhat.com>,
	patches@linaro.org
Subject: Re: [Qemu-devel] [PATCH 09/13] hw/char/exynos4210_uart.c: Remove unneeded handling of NULL chardev
Date: Wed, 25 Apr 2018 12:23:56 -0300	[thread overview]
Message-ID: <4106d86f-82f8-727d-62b4-82374b16bccb@amsat.org> (raw)
In-Reply-To: <2116cce5-6920-a42a-a4c0-880c102b30e6@redhat.com>

Hi Thomas,

On 04/25/2018 12:05 PM, Thomas Huth wrote:
> On 20.04.2018 16:52, 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 <peter.maydell@linaro.org>
>> ---
>>  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);
>> -        }
> 
> If I get the EXYNOS 4210 data sheet right, this chip has only 4 channels
> indeed:
> 
> http://www.samsung.com/global/business/semiconductor/file/product/Exynos_4_Dual_45nm_User_Manaul_Public_REV1.00-0.pdf
> 
> So I think you should at least keep an "assert(channel < 4)" in here?

This file models a single UART, I don't think a such assert belongs here.

Although it is named EXYNOS4210, I'm pretty sure it should works to
model UARTs from other SoCs from the Exynos4xxx series.

There are no restriction on newer SoCs to have > 4 UARTs.

For this particular Exynos4210 SoC, the 4 channels are correctly limited
in exynos4210_init().

Regards,

Phil.

> 
> Apart from that, the patch looks sane to me, so when you add that assert():
> 
> Reviewed-by: Thomas Huth <thuth@redhat.com>

  reply	other threads:[~2018-04-25 15:24 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-20 14:52 [Qemu-devel] [PATCH 00/13] Drop compile time limit on number of serial ports Peter Maydell
2018-04-20 14:52 ` [Qemu-devel] [PATCH 01/13] hw/char/serial: Allow disconnected chardevs Peter Maydell
2018-04-20 16:28   ` Philippe Mathieu-Daudé
2018-04-25 14:37   ` Thomas Huth
2018-04-20 14:52 ` [Qemu-devel] [PATCH 02/13] hw/arm/fsl-imx*: Don't create "null" chardevs for serial devices Peter Maydell
2018-04-20 16:48   ` Philippe Mathieu-Daudé
2018-04-25 14:34   ` Thomas Huth
2018-04-25 14:36   ` Thomas Huth
2018-04-26 12:53     ` Peter Maydell
2018-04-20 14:52 ` [Qemu-devel] [PATCH 03/13] hw/mips/boston.c: " Peter Maydell
2018-04-21  2:50   ` Philippe Mathieu-Daudé
2018-04-25 14:36   ` Thomas Huth
2018-04-20 14:52 ` [Qemu-devel] [PATCH 04/13] hw/mips/mips_malta: " Peter Maydell
2018-04-20 16:30   ` Philippe Mathieu-Daudé
2018-04-25 14:38   ` Thomas Huth
2018-04-20 14:52 ` [Qemu-devel] [PATCH 05/13] hw/xtensa/xtfpga.c: " Peter Maydell
2018-04-21 22:26   ` Philippe Mathieu-Daudé
2018-04-25 14:39   ` Thomas Huth
2018-04-20 14:52 ` [Qemu-devel] [PATCH 06/13] vl.c: Provide accessor function serial_hd() for serial_hds[] array Peter Maydell
2018-04-25 14:39   ` Philippe Mathieu-Daudé
2018-04-25 14:43   ` Thomas Huth
2018-04-20 14:52 ` [Qemu-devel] [PATCH 07/13] Change references to serial_hds[] to serial_hd() Peter Maydell
2018-04-25 14:52   ` Thomas Huth
2018-04-25 14:54   ` Philippe Mathieu-Daudé
2018-04-25 15:44     ` Peter Maydell
2018-04-20 14:52 ` [Qemu-devel] [PATCH 08/13] Remove checks on MAX_SERIAL_PORTS that are just bounds checks Peter Maydell
2018-04-25 14:56   ` Thomas Huth
2018-04-25 14:59   ` Philippe Mathieu-Daudé
2018-04-20 14:52 ` [Qemu-devel] [PATCH 09/13] hw/char/exynos4210_uart.c: Remove unneeded handling of NULL chardev Peter Maydell
2018-04-25 14:59   ` Philippe Mathieu-Daudé
2018-04-25 15:05   ` Thomas Huth
2018-04-25 15:23     ` Philippe Mathieu-Daudé [this message]
2018-04-20 14:52 ` [Qemu-devel] [PATCH 10/13] serial-isa: Use MAX_ISA_SERIAL_PORTS instead of MAX_SERIAL_PORTS Peter Maydell
2018-04-20 16:57   ` Philippe Mathieu-Daudé
2018-04-25 15:09   ` Thomas Huth
2018-04-20 14:52 ` [Qemu-devel] [PATCH 11/13] superio: Don't use MAX_SERIAL_PORTS for serial port limit Peter Maydell
2018-04-20 17:58   ` Philippe Mathieu-Daudé
2018-04-20 14:52 ` [Qemu-devel] [PATCH 12/13] vl.c: Remove compile time limit on number of serial ports Peter Maydell
2018-04-20 16:58   ` Paolo Bonzini
2018-04-20 17:06     ` Peter Maydell
2018-04-20 17:55       ` Paolo Bonzini
2018-04-20 17:01   ` Philippe Mathieu-Daudé
2018-04-25 15:16   ` Thomas Huth
2018-04-20 14:52 ` [Qemu-devel] [PATCH 13/13] vl.c: new function max_serial_hds() Peter Maydell
2018-04-20 17:50   ` Philippe Mathieu-Daudé
2018-04-26 13:00     ` Peter Maydell
2018-04-25 15:19   ` Thomas Huth
2018-04-20 15:10 ` [Qemu-devel] [PATCH 00/13] Drop compile time limit on number of serial ports no-reply
2018-04-20 15:12   ` Peter Maydell
2018-04-26 13:56 ` Peter Maydell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4106d86f-82f8-727d-62b4-82374b16bccb@amsat.org \
    --to=f4bug@amsat.org \
    --cc=marcandre.lureau@redhat.com \
    --cc=mst@redhat.com \
    --cc=patches@linaro.org \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=thuth@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.