From patchwork Fri Apr 20 14:52:45 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 133887 Delivered-To: patches@linaro.org Received: by 10.46.66.142 with SMTP id h14csp374977ljf; Fri, 20 Apr 2018 07:52:57 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/zXPPbgP/UC5jqSMDsm3neomrA8OZou9tZQMLn9K/g/i69m5BVPVTNmriO87sqIs8UZP9k X-Received: by 2002:adf:af65:: with SMTP id z92-v6mr8579565wrc.250.1524235977721; Fri, 20 Apr 2018 07:52:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524235977; cv=none; d=google.com; s=arc-20160816; b=oZfoZH68d12R/1eTMzx4ky8A9x2BTq4eW7ZgHcPmrzwwv0s0DdP5pg2uULMOJkMvS3 PEk+WqoNDEasOQ6nNSGECNHFRNni68tDx1a6gNz7lAbeH8fKpSPL4KIRc7uGz3qLukGL h1tuvuPQecjVQYaBDId2nOX0uRA4oR1Or7DTIzzPpUSH9u0rN6Ic/FCvn1zbLKbAIJZH TqxAbN4qfMJkpfE3GYSRcF06UlB1imqJR/5ISHO4XPBCYWT6N/Ji7P0UYMgreQwmtEdq uc+X4nfvxqCdtHKkoJXo56BLK/TMnX2CPWP5CfP2+gKWRhDUb3dZghnk9PYdg8jBcRCx u4Uw== 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=6Ru+VnvMxo5NuiWS0nLkdLdcXqLl8Z1ECiXwKWILwPg=; b=QwAZz52BP/yIdV+oTr4yuZr6KG8BFURHgkA/89esDFgavIOHE8tBkYsdlmfnSquQ/R yQrvg9XdA2cBbSoQRqdxzdgft7afZQrRhXZEY+6dhmpQlM8JvqmUEgM6ytpXm9KzGJ8V 5MxxWhSNuoXGB607Y4V3Zf6qpGm1qYjz7JWjMz+Dih+pqYuDpVW27R7o4Nox37yk3G0r sH0ILqPi1gARrkMuPjZYYcHa+t65ok5GH3JTVwxo1n2enQVG9T8MjjvlzmUqiNITAa/L v9bgkJQT9SRN0njimGMXu67KBUCeWGC2NP9BO0jczsdwjLR8l4827Wfc+lCzp3dpsdvz aTDA== 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 l12-v6si4906255wrc.160.2018.04.20.07.52.57 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 20 Apr 2018 07:52:57 -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 1f9XPF-0006ay-3D; Fri, 20 Apr 2018 15:52:57 +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 09/13] hw/char/exynos4210_uart.c: Remove unneeded handling of NULL chardev Date: Fri, 20 Apr 2018 15:52:45 +0100 Message-Id: <20180420145249.32435-10-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 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 --- hw/char/exynos4210_uart.c | 20 -------------------- 1 file changed, 20 deletions(-) -- 2.17.0 Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Thomas Huth 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); - } - chr = serial_hd(channel); - if (!chr) { - snprintf(label, ARRAY_SIZE(label), "%s%d", chr_name, channel); - chr = qemu_chr_new(label, "null"); - if (!(chr)) { - error_report("Can't assign serial port to UART%d", channel); - exit(1); - } - } - } - qdev_prop_set_chr(dev, "chardev", chr); qdev_prop_set_uint32(dev, "channel", channel); qdev_prop_set_uint32(dev, "rx-size", fifo_size);