[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 1/7] serial: add serial_chr_nonnull() to use the
From: |
Thomas Huth |
Subject: |
Re: [Qemu-devel] [PATCH 1/7] serial: add serial_chr_nonnull() to use the null backend when none provided |
Date: |
Thu, 31 Aug 2017 17:23:55 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 |
On 31.08.2017 17:20, Philippe Mathieu-Daudé wrote:
> On 08/31/2017 02:19 AM, Thomas Huth wrote:
>> On 31.08.2017 05:53, Philippe Mathieu-Daudé wrote:
> [...]>> +Chardev *serial_chr_nonnull(Chardev *chr)
>>> +{
>>> + static int serial_id;
>>> + char *label;
>>> +
>>> + label = g_strdup_printf("discarding-serial%d", serial_id++);
>>> + chr = qemu_chr_new(label, "null");
>>
>> That looks wrong - you're ignoring the input parameter and always open
>> the "null" device? Shouldn't there be a "if (chr) return chr;" in front
>> of this?
>
> You right. I had this correct in my first patch when this code was
> embedded, I then failed at extracting as another function :/
>
>>
>>> + assert(chr);
>>> + g_free(label);
>>> +
>>> + return chr;
>>> +}
>>
>> Thomas
>>
>> PS: I think you should also merge the two patches together, they are
>> small enough.
>
> Ok.
Well, I wrote that comment about merging the two patches together when I
was thinking that your series consists of only two patches (since I've
only been CC:-ed on the first two patches). So please simply ignore that
suggestion :-)
Thomas
Re: [Qemu-devel] [PATCH 1/7] serial: add serial_chr_nonnull() to use the null backend when none provided, Peter Maydell, 2017/08/31
[Qemu-devel] [PATCH 2/7] serial: use serial_chr_nonnull() in serial_mm_init(), Philippe Mathieu-Daudé, 2017/08/30
[Qemu-devel] [PATCH 3/7] hw/arm/fsl_imx*: use serial_chr_nonnull(), Philippe Mathieu-Daudé, 2017/08/30
[Qemu-devel] [PATCH 4/7] hw/mips/malta: use serial_chr_nonnull(), Philippe Mathieu-Daudé, 2017/08/30
[Qemu-devel] [PATCH 6/7] hw/char/omap_uart: serial_mm_init() already check for null chr, Philippe Mathieu-Daudé, 2017/08/30
[Qemu-devel] [PATCH 5/7] hw/char/exynos4210_uart: use serial_chr_nonnull(), Philippe Mathieu-Daudé, 2017/08/30
[Qemu-devel] [PATCH 7/7] hw/xtensa: serial_mm_init() already check for null chr, Philippe Mathieu-Daudé, 2017/08/30