From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43386) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f9XPN-0006LF-N9 for qemu-devel@nongnu.org; Fri, 20 Apr 2018 10:53:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f9XPM-0007rE-TL for qemu-devel@nongnu.org; Fri, 20 Apr 2018 10:53:05 -0400 Received: from orth.archaic.org.uk ([2001:8b0:1d0::2]:40996) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1f9XPM-0007mN-Mc for qemu-devel@nongnu.org; Fri, 20 Apr 2018 10:53:04 -0400 From: Peter Maydell Date: Fri, 20 Apr 2018 15:52:47 +0100 Message-Id: <20180420145249.32435-12-peter.maydell@linaro.org> In-Reply-To: <20180420145249.32435-1-peter.maydell@linaro.org> References: <20180420145249.32435-1-peter.maydell@linaro.org> Subject: [Qemu-devel] [PATCH 11/13] superio: Don't use MAX_SERIAL_PORTS for serial port limit List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: patches@linaro.org, "Michael S . Tsirkin" , Paolo Bonzini , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= The superio device has a limit on the number of serial ports it supports which is really only there because it has a fixed-size array serial[]. This limit isn't related particularly to the global MAX_SERIAL_PORTS limit, so use a different #define for it. (In practice the users of superio only ever want 2 serial ports.) Signed-off-by: Peter Maydell --- include/hw/isa/superio.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/hw/isa/superio.h b/include/hw/isa/superio.h index f9ba29aa30..345f006081 100644 --- a/include/hw/isa/superio.h +++ b/include/hw/isa/superio.h @@ -22,13 +22,15 @@ #define ISA_SUPERIO_CLASS(klass) \ OBJECT_CLASS_CHECK(ISASuperIOClass, (klass), TYPE_ISA_SUPERIO) +#define SUPERIO_MAX_SERIAL_PORTS 4 + typedef struct ISASuperIODevice { /*< private >*/ ISADevice parent_obj; /*< public >*/ ISADevice *parallel[MAX_PARALLEL_PORTS]; - ISADevice *serial[MAX_SERIAL_PORTS]; + ISADevice *serial[SUPERIO_MAX_SERIAL_PORTS]; ISADevice *floppy; ISADevice *kbc; ISADevice *ide; -- 2.17.0