From patchwork Fri Apr 20 14:52:47 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 133890 Delivered-To: patches@linaro.org Received: by 10.46.66.142 with SMTP id h14csp374996ljf; Fri, 20 Apr 2018 07:52:59 -0700 (PDT) X-Google-Smtp-Source: AIpwx48asi9hVCnjyFDN6VwEGbhCpaZ1WIdpWQnxyCnAbrVV1uLuyjeTyYZhk6m1o2qsnG28qPaf X-Received: by 10.28.23.148 with SMTP id 142mr486444wmx.0.1524235978990; Fri, 20 Apr 2018 07:52:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524235978; cv=none; d=google.com; s=arc-20160816; b=hBMWryK7ZDL0bSj2LZM30gB77Fwzzkx/UURsRgNDmn8Id8CvFcswE+BsJusziXLJr4 tY6kVeBuQIcp3kXgV3KPQOK/aE7b5N0ddBzN/OgJ6hJNrS+VZMoVTNJaStetJG2rBKfY wh9MgRaqPWX0FWgcpL+kWExLPCzr6F1kmv8Fws6O1WphzpIvEFfQqkhufp/NcbKiWqpP vDcV7HJK3iLbL7/wKIGOOODllrn19HnzNc3gvO+8daca+VXSpOMAQArtocR3y0UOsNCh 6XBfKSRjOp/T/3XX+RGKGFfCJ8e7hRkNRLma96/ujUYaFQJqIfqjM7iLIAhFPoiun6ku MXlQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=Dbv/xJO/ljNzO0FpN65M16Ku/BhmvGLi1QVmuN47ZuI=; b=M2ecpvg7FimJsPtlfMIudJ3dHmVnYOnzKy1mhWK1OvxbQphalxXmUl+AZ+v254HJAy FRzyZlVfdCwSveOo/2WAOLmR6xwwbbjt5wYPgj7Mf/AMmfzdMnAasg9qgCa+4U8n4QmC omz/r5qc9N7b6zFx+a5uZlk4E4WwUVvDl/6Jjipyq35dQkzwJbTwXUWTbrnaUJf2X8iT aXzi5XIAPpouLd3pjOSVarGPFbXrNxi1q0hlBLENEKIeo+78erI5A8WemxFETTsaLa8D M3+kUhO85Iqfz64M/m1BJbiLtXV+njtgsPK+naBeiOQyUpt6uwdS/dNA5KE01lkmAp6K OYYQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of pm215@archaic.org.uk designates 2001:8b0:1d0::2 as permitted sender) smtp.mailfrom=pm215@archaic.org.uk; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by mx.google.com with ESMTPS id 140si1256659wmi.146.2018.04.20.07.52.58 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 20 Apr 2018 07:52:58 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of pm215@archaic.org.uk designates 2001:8b0:1d0::2 as permitted sender) client-ip=2001:8b0:1d0::2; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of pm215@archaic.org.uk designates 2001:8b0:1d0::2 as permitted sender) smtp.mailfrom=pm215@archaic.org.uk; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from pm215 by orth.archaic.org.uk with local (Exim 4.89) (envelope-from ) id 1f9XPG-0006by-HM; Fri, 20 Apr 2018 15:52:58 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Cc: patches@linaro.org, "Michael S . Tsirkin" , Paolo Bonzini , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Subject: [PATCH 11/13] superio: Don't use MAX_SERIAL_PORTS for serial port limit Date: Fri, 20 Apr 2018 15:52:47 +0100 Message-Id: <20180420145249.32435-12-peter.maydell@linaro.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180420145249.32435-1-peter.maydell@linaro.org> References: <20180420145249.32435-1-peter.maydell@linaro.org> 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(-) -- 2.17.0 Reviewed-by: Philippe Mathieu-Daudé Tested-by: Philippe Mathieu-Daudé 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;