All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Maydell <peter.maydell@linaro.org>
To: "Philippe Mathieu-Daudé" <f4bug@amsat.org>
Cc: "QEMU Developers" <qemu-devel@nongnu.org>,
	"patches@linaro.org" <patches@linaro.org>,
	"Michael S . Tsirkin" <mst@redhat.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Marc-André Lureau" <marcandre.lureau@redhat.com>
Subject: Re: [Qemu-devel] [PATCH 13/13] vl.c: new function max_serial_hds()
Date: Thu, 26 Apr 2018 14:00:22 +0100	[thread overview]
Message-ID: <CAFEAcA8TT6hTZgfJYE_ccdz8Q0SVDQF30PeTph8Fd=u95tWycQ@mail.gmail.com> (raw)
In-Reply-To: <d28ba1e3-7fb5-04e7-7743-b7cd980f4d6f@amsat.org>

On 20 April 2018 at 18:50, Philippe Mathieu-Daudé <f4bug@amsat.org> wrote:
> On 04/20/2018 11:52 AM, Peter Maydell wrote:
>> Create a new function max_serial_hds() which returns the number of
>> serial ports defined by the user. This is needed only by spapr.
>> This allows us to remove the MAX_SERIAL_PORTS define.
>>
>> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
>> ---
>>  include/sysemu/sysemu.h | 6 ++++--
>>  hw/ppc/spapr.c          | 2 +-
>>  vl.c                    | 5 +++++
>>  3 files changed, 10 insertions(+), 3 deletions(-)
>>
>> diff --git a/include/sysemu/sysemu.h b/include/sysemu/sysemu.h
>> index 989cbc2b7b..612659a718 100644
>> --- a/include/sysemu/sysemu.h
>> +++ b/include/sysemu/sysemu.h
>> @@ -159,10 +159,12 @@ void hmp_pcie_aer_inject_error(Monitor *mon, const QDict *qdict);
>>
>>  /* serial ports */
>>
>> -#define MAX_SERIAL_PORTS 4
>> -
>>  /* Return the Chardev for serial port i, or NULL if none */
>>  Chardev *serial_hd(int i);
>> +/* return the number of serial ports defined by the user. serial_hd(i)
>> + * will always return NULL for any i which is greater than or equal to this.
>> + */
>> +int max_serial_hds(void);
>
> What about naming it serial_hds_count() to keep this under the serial_
> namespace?

OK, makes sense.

> And about using a size_t for num_serial_hds?

This doesn't seem worthwhile though.

Since the rename of max_serial_hds is the only change here, I
propose to apply this to master (fixing up the function name in
this patch in the process), to reduce the number of conflicts
with other changes currently in-flight.

thanks
-- PMM

  reply	other threads:[~2018-04-26 13:00 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é
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 [this message]
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='CAFEAcA8TT6hTZgfJYE_ccdz8Q0SVDQF30PeTph8Fd=u95tWycQ@mail.gmail.com' \
    --to=peter.maydell@linaro.org \
    --cc=f4bug@amsat.org \
    --cc=marcandre.lureau@redhat.com \
    --cc=mst@redhat.com \
    --cc=patches@linaro.org \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /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.