From nobody Sat Feb 7 07:15:23 2026 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.zoho.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; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1495193176314757.5312625253741; Fri, 19 May 2017 04:26:16 -0700 (PDT) Received: from localhost ([::1]:57947 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dBg2w-0008Vh-HC for importer@patchew.org; Fri, 19 May 2017 07:26:14 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49342) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dBfyF-0004HN-HX for qemu-devel@nongnu.org; Fri, 19 May 2017 07:21:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dBfyE-0000uD-9T for qemu-devel@nongnu.org; Fri, 19 May 2017 07:21:23 -0400 Received: from mail-wm0-x242.google.com ([2a00:1450:400c:c09::242]:32768) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dBfyE-0000u0-3J for qemu-devel@nongnu.org; Fri, 19 May 2017 07:21:22 -0400 Received: by mail-wm0-x242.google.com with SMTP id b84so1792004wmh.0 for ; Fri, 19 May 2017 04:21:22 -0700 (PDT) Received: from 640k.lan (94-39-157-43.adsl-ull.clienti.tiscali.it. [94.39.157.43]) by smtp.gmail.com with ESMTPSA id v65sm2640095wmv.5.2017.05.19.04.21.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 19 May 2017 04:21:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=5EYOBR43m1sK1N5wwDP+npsjedy09nV2p3ruO/nJHEQ=; b=Bugw1IFKsTu3jzI13p7zzz+AE9qXr8wFHkfQuqoxUedpRZA5uLDiC+EFiwjCUIqPG6 hcDshOubGenjQkT+9wgd8GnF2OxLZRmhhTPEb8uKnWDgK2kk7g4FjJNgpxcFp+fjX2vd XQ4Rb+HHWNnYgBmY1DPSCY42ZuLCq7azk7z9NiGLc6BU9/zaj5B3HpCtAZYm+pZ3u112 wNPgRGsE1zSqYhbq1bn2PNGmeXVNx/K6wnSbNZ3J5j4muSVQO6WO1/uWS9Oo5aPzQYIq 2mamnmeP+iwbFUgcDicKOoQambPgJgPxBOmbgN0hZRB/7hZ2+QO8XTV/yM16NlY4TTKC UarA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=5EYOBR43m1sK1N5wwDP+npsjedy09nV2p3ruO/nJHEQ=; b=uYEUx0igXtYenHv0ahYhMQCR9kBCLOPg3e3q9zVs8rZ/DttuRwD/L+/0gZpGwv0CeJ 8xfqce3SZ6e0q7tdI5pqgk/W3TmNzriqC7oG4J02AAq0tcQIIoz3T/HqHU8ucMnQYRef 9H8x27dbzjUKb33d4Jlck8MrP2o+0MmayglIo2vt5viL/Kf/whF4QAn93uU156RnlDdX Hb6ZiDKJMnqTsjaq373mXnzXOywCE79mzc9/8sur4E0ArQn8yvO5ymietNfVTPXZREeL 2vdVcWD258n1aSc3ry0s8KWilJ236F41VVSre2Ggyl8d/fVNaGBAMfKSvdB/xeZrkgMI yyOA== X-Gm-Message-State: AODbwcBl3Nx601F2STSMkujbd2Qm3i7rqGueGX9JPil9su2fYyo3bjFj IwmJ65eM1+mO2Q== X-Received: by 10.28.27.197 with SMTP id b188mr6597359wmb.61.1495192881189; Fri, 19 May 2017 04:21:21 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Fri, 19 May 2017 13:20:56 +0200 Message-Id: <1495192872-27667-5-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1495192872-27667-1-git-send-email-pbonzini@redhat.com> References: <1495192872-27667-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::242 Subject: [Qemu-devel] [PULL 04/20] mc146818rtc: drop unnecessary '#ifdef TARGET_I386' 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: Xiao Guangrong 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" From: Xiao Guangrong If the code purely depends on LOST_TICK_POLICY_SLEW, we can simply drop '#ifdef TARGET_I386' as only x86 can enable this tick policy Signed-off-by: Xiao Guangrong Message-Id: <20170510083259.3900-5-xiaoguangrong@tencent.com> Signed-off-by: Paolo Bonzini --- hw/timer/mc146818rtc.c | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/hw/timer/mc146818rtc.c b/hw/timer/mc146818rtc.c index 4870a72..f9d6181 100644 --- a/hw/timer/mc146818rtc.c +++ b/hw/timer/mc146818rtc.c @@ -112,7 +112,6 @@ static uint64_t get_guest_rtc_ns(RTCState *s) guest_clock - s->last_update + s->offset; } =20 -#ifdef TARGET_I386 static void rtc_coalesced_timer_update(RTCState *s) { if (s->irq_coalesced =3D=3D 0) { @@ -126,6 +125,7 @@ static void rtc_coalesced_timer_update(RTCState *s) } } =20 +#ifdef TARGET_I386 static void rtc_coalesced_timer(void *opaque) { RTCState *s =3D opaque; @@ -198,7 +198,6 @@ periodic_timer_update(RTCState *s, int64_t current_time= , uint32_t old_period) assert(lost_clock >=3D 0); } =20 -#ifdef TARGET_I386 /* * s->irq_coalesced can change for two reasons: * @@ -227,9 +226,7 @@ periodic_timer_update(RTCState *s, int64_t current_time= , uint32_t old_period) s->irq_coalesced, old_period, s->period); rtc_coalesced_timer_update(s); } - } else -#endif - { + } else { /* * no way to compensate the interrupt if LOST_TICK_POLICY_SLEW * is not used, we should make the time progress anyway. @@ -244,9 +241,7 @@ periodic_timer_update(RTCState *s, int64_t current_time= , uint32_t old_period) RTC_CLOCK_RATE) + 1; timer_mod(s->periodic_timer, s->next_periodic_time); } else { -#ifdef TARGET_I386 s->irq_coalesced =3D 0; -#endif timer_del(s->periodic_timer); } } @@ -835,13 +830,11 @@ static int rtc_post_load(void *opaque, int version_id) } } =20 -#ifdef TARGET_I386 if (version_id >=3D 2) { if (s->lost_tick_policy =3D=3D LOST_TICK_POLICY_SLEW) { rtc_coalesced_timer_update(s); } } -#endif return 0; } =20 @@ -898,11 +891,10 @@ static void rtc_notify_clock_reset(Notifier *notifier= , void *data) rtc_set_date_from_host(ISA_DEVICE(s)); periodic_timer_update(s, now, 0); check_update_timer(s); -#ifdef TARGET_I386 + if (s->lost_tick_policy =3D=3D LOST_TICK_POLICY_SLEW) { rtc_coalesced_timer_update(s); } -#endif } =20 /* set CMOS shutdown status register (index 0xF) as S3_resume(0xFE) @@ -923,12 +915,10 @@ static void rtc_reset(void *opaque) =20 qemu_irq_lower(s->irq); =20 -#ifdef TARGET_I386 if (s->lost_tick_policy =3D=3D LOST_TICK_POLICY_SLEW) { s->irq_coalesced =3D 0; s->irq_reinject_on_ack_count =3D 0; =09 } -#endif } =20 static const MemoryRegionOps cmos_ops =3D { --=20 1.8.3.1