From nobody Fri Oct 24 21:57:03 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=gmail.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1520171283733994.7754563922242; Sun, 4 Mar 2018 05:48:03 -0800 (PST) Received: from localhost ([::1]:44892 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1esTzX-0005Hv-Hm for importer@patchew.org; Sun, 04 Mar 2018 08:47:55 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56369) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1esTyK-0004oj-UW for qemu-devel@nongnu.org; Sun, 04 Mar 2018 08:46:42 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1esTyH-0006VG-Sv for qemu-devel@nongnu.org; Sun, 04 Mar 2018 08:46:41 -0500 Received: from mail-pf0-x243.google.com ([2607:f8b0:400e:c00::243]:45730) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1esTyH-0006Uo-Lv; Sun, 04 Mar 2018 08:46:37 -0500 Received: by mail-pf0-x243.google.com with SMTP id h19so5201084pfd.12; Sun, 04 Mar 2018 05:46:37 -0800 (PST) Received: from localhost.localdomain ([185.216.48.174]) by smtp.gmail.com with ESMTPSA id o2sm16907782pgq.54.2018.03.04.05.46.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 04 Mar 2018 05:46:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=/ny+GabdBdlItDEdwX8NPRw1fONegrjd0RYRPAe0hgA=; b=VQM5RbODTtojb9ViHHgLITvE/jMaD46UUSa+99aeJ0YXFrSdGNL2CzIBHZ/8UgJ1Gl 9OoHBArHU+xrLjLqo2Ek8gh+wBFJzuil7SzEgfsSntJzSExUc7/vpCJwLWEYExQmc14O hNdrc7ePEsJLT8XaN65f05s8c+EE7t6u9/icqF/BClT3DswlLi8ag+t5QulOKmEBJ8rj SvH4iJMwCb6nn6EnmesCba/zot75CjF10ub6gISEz8fj04FieMkjMhYxmyXImIpefD7p nZnMpNCLdQiP+oipFo+g4feu6tXqc7RpO1YgZb+8aj21t718bBBZdFLtjjBw7zfwggd9 D4rw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=/ny+GabdBdlItDEdwX8NPRw1fONegrjd0RYRPAe0hgA=; b=UEyT/3thn6ZOMH9i8QhKe4qXAp5xKu5vZpg+ntcKylwA85csXgdHpHLv9AMRXR/MLp APUcqx3J/3RWIuRv7X8F29z+i/8qKgC/hYnrf7DrX4suRiQ0S+vtqezLQlsGiIrFf10y 7GzENAB127P0cuosuViN0tyV5+61cgA40mhtRMwXtBK8tQeplGf7f1GKDhQID0HNYLry Q8if6j/YFDKKa2J56HkVkqHuxWDP76wBTc98vkp3suCN9ZT7WOIqkPhaOIJ3pdvp3ocE fq1M43LxNi7azdCFdQ8fSpsRRn4Vj0wohfWqNn7aB3k9t4jtsOAwalGvvdGBGKKRules wimw== X-Gm-Message-State: APf1xPAkzgRfVXkruZ0efgR3MoIhkebjMBxRSU35JIMO3QfgLgDl76A2 YEoYC8RUoTtjU0g4F0QABgVxFLG8 X-Google-Smtp-Source: AG47ELveDzOJRrxpQmLbyDP3cGiruIaLJ62uhHG890crlb/2q33sZ8CbND+lyHN5UBN+R41fHkx28w== X-Received: by 10.98.180.13 with SMTP id h13mr12049052pfn.139.1520171195695; Sun, 04 Mar 2018 05:46:35 -0800 (PST) From: Nia Alarie To: qemu-devel@nongnu.org Date: Sun, 4 Mar 2018 13:45:48 +0000 Message-Id: <20180304134548.19498-1-nia.alarie@gmail.com> X-Mailer: git-send-email 2.16.2 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c00::243 Subject: [Qemu-devel] [PATCH] s390x/sclpconsole: Remove dead code - make _error functions void X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: jim@groklearning.com, stefanha@gmail.com, cohuck@redhat.com, borntraeger@de.ibm.com, qemu-s390x@nongnu.org, joel@jms.id.au, Nia Alarie , rth@twiddle.net Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" These functions always return 0. By changing their return type to void, some dead code can be removed. Signed-off-by: Nia Alarie --- hw/char/sclpconsole-lm.c | 3 +-- hw/char/sclpconsole.c | 3 +-- hw/s390x/event-facility.c | 6 +----- hw/s390x/virtio-ccw.c | 6 +++--- hw/s390x/virtio-ccw.h | 2 +- include/hw/s390x/event-facility.h | 2 +- 6 files changed, 8 insertions(+), 14 deletions(-) diff --git a/hw/char/sclpconsole-lm.c b/hw/char/sclpconsole-lm.c index c500bdaf29..7a02db54b8 100644 --- a/hw/char/sclpconsole-lm.c +++ b/hw/char/sclpconsole-lm.c @@ -318,9 +318,8 @@ static int console_init(SCLPEvent *event) return 0; } =20 -static int console_exit(SCLPEvent *event) +static void console_exit(SCLPEvent *event) { - return 0; } =20 static void console_reset(DeviceState *dev) diff --git a/hw/char/sclpconsole.c b/hw/char/sclpconsole.c index d0265dfa7a..e2a80dd2dd 100644 --- a/hw/char/sclpconsole.c +++ b/hw/char/sclpconsole.c @@ -246,9 +246,8 @@ static void console_reset(DeviceState *dev) scon->notify =3D false; } =20 -static int console_exit(SCLPEvent *event) +static void console_exit(SCLPEvent *event) { - return 0; } =20 static Property console_properties[] =3D { diff --git a/hw/s390x/event-facility.c b/hw/s390x/event-facility.c index 155a69467b..4263d28012 100644 --- a/hw/s390x/event-facility.c +++ b/hw/s390x/event-facility.c @@ -436,11 +436,7 @@ static void event_unrealize(DeviceState *qdev, Error *= *errp) SCLPEvent *event =3D SCLP_EVENT(qdev); SCLPEventClass *child =3D SCLP_EVENT_GET_CLASS(event); if (child->exit) { - int rc =3D child->exit(event); - if (rc < 0) { - error_setg(errp, "SCLP event exit failed."); - return; - } + child->exit(event); } } =20 diff --git a/hw/s390x/virtio-ccw.c b/hw/s390x/virtio-ccw.c index 8f7fbc2ab7..0773818a82 100644 --- a/hw/s390x/virtio-ccw.c +++ b/hw/s390x/virtio-ccw.c @@ -752,7 +752,7 @@ out_err: g_free(sch); } =20 -static int virtio_ccw_exit(VirtioCcwDevice *dev) +static void virtio_ccw_exit(VirtioCcwDevice *dev) { CcwDevice *ccw_dev =3D CCW_DEVICE(dev); SubchDev *sch =3D ccw_dev->sch; @@ -765,7 +765,6 @@ static int virtio_ccw_exit(VirtioCcwDevice *dev) release_indicator(&dev->routes.adapter, dev->indicators); dev->indicators =3D NULL; } - return 0; } =20 static void virtio_ccw_net_realize(VirtioCcwDevice *ccw_dev, Error **errp) @@ -1710,7 +1709,8 @@ static int virtio_ccw_busdev_exit(DeviceState *dev) VirtioCcwDevice *_dev =3D (VirtioCcwDevice *)dev; VirtIOCCWDeviceClass *_info =3D VIRTIO_CCW_DEVICE_GET_CLASS(dev); =20 - return _info->exit(_dev); + _info->exit(_dev); + return 0; } =20 static void virtio_ccw_busdev_unplug(HotplugHandler *hotplug_dev, diff --git a/hw/s390x/virtio-ccw.h b/hw/s390x/virtio-ccw.h index 3905f3a3d6..8ffe7fe095 100644 --- a/hw/s390x/virtio-ccw.h +++ b/hw/s390x/virtio-ccw.h @@ -76,7 +76,7 @@ typedef struct VirtioCcwDevice VirtioCcwDevice; typedef struct VirtIOCCWDeviceClass { CCWDeviceClass parent_class; void (*realize)(VirtioCcwDevice *dev, Error **errp); - int (*exit)(VirtioCcwDevice *dev); + void (*exit)(VirtioCcwDevice *dev); } VirtIOCCWDeviceClass; =20 /* Performance improves when virtqueue kick processing is decoupled from t= he diff --git a/include/hw/s390x/event-facility.h b/include/hw/s390x/event-fac= ility.h index 5119b9b7f0..833f12a5e7 100644 --- a/include/hw/s390x/event-facility.h +++ b/include/hw/s390x/event-facility.h @@ -174,7 +174,7 @@ typedef struct SCLPEvent { typedef struct SCLPEventClass { DeviceClass parent_class; int (*init)(SCLPEvent *event); - int (*exit)(SCLPEvent *event); + void (*exit)(SCLPEvent *event); =20 /* get SCLP's send mask */ unsigned int (*get_send_mask)(void); --=20 2.16.2