From nobody Sun Nov 9 23:23:27 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.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 209.51.188.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 [209.51.188.17]) by mx.zohomail.com with SMTPS id 1552729932706332.07580346782845; Sat, 16 Mar 2019 02:52:12 -0700 (PDT) Received: from localhost ([127.0.0.1]:39645 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h55z4-0006X8-7i for importer@patchew.org; Sat, 16 Mar 2019 05:52:06 -0400 Received: from eggs.gnu.org ([209.51.188.92]:47392) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h55xx-0005rU-RW for qemu-devel@nongnu.org; Sat, 16 Mar 2019 05:50:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h55xu-0007yw-Pi for qemu-devel@nongnu.org; Sat, 16 Mar 2019 05:50:56 -0400 Received: from mail-wm1-x342.google.com ([2a00:1450:4864:20::342]:39395) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h55xu-0007y1-EO; Sat, 16 Mar 2019 05:50:54 -0400 Received: by mail-wm1-x342.google.com with SMTP id t124so8165561wma.4; Sat, 16 Mar 2019 02:50:53 -0700 (PDT) Received: from localhost.localdomain ([176.228.155.165]) by smtp.gmail.com with ESMTPSA id v20sm11113059wmj.2.2019.03.16.02.50.51 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 16 Mar 2019 02:50:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=SuKDbFL4FlQTyocLfwj84UEe0RnB6zB5FaHyq+udtaU=; b=eorom0fptFomhMfnw7/pG1R7OaDi7iZblbObBX+pwC8jZ2AG6dGDdMnfw+73RsFzUo WK/vPjLlviXqrbCFPTAqXCFiUh5uXVtJ1fwYUI+30IIo8WuLrbcuTwcElS4WNlxos1bS ZxyGzZ12ryJ5oIF4ux1m07U5I5svTo3PDN1Cngiv6DdpQKff5WZXjRditf82G28uun3Q DLzLFFA1lDDyawKtqVeKqsWQaeCyUh8oX7Lan4cM26P28EKKT11fZ6ZTqYU9MRMz2EZZ 4nzPdD+VBufj3svHS2Iau9F39S/0hCaE2eueFPr0IDsFXwP2I9aOazIioXBRwpkP6T+s AUkg== 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=SuKDbFL4FlQTyocLfwj84UEe0RnB6zB5FaHyq+udtaU=; b=a5iUoYrP3jDJ5ZUgdADKqCj4NEcjIsoK+w7lruGYYZ0ozwGGllAdGED09kedhteCBY XKFOGRlELSNwFY6F1F8r60eBTfZJO60982EFLf5yNY5ZpDBUSGHo6RrS9jxSDs46PbMB IKNLMb7fKxj4sOKBntF8d030bFRy7ykdQjbpcsenq/XHWX+EpIB/aT937de2wpoaqUzI gSwzdlsIAoBmlrB/fb1mYLm0kufPcOz15zFyDihHcJ+8kovK+RRpOo5jKFajNB1PeEXz YB2PUnLbOvqb43XMIEgA/89LcuH3HhJpXANL+x4ysa+bfw2mbOqsQ2q7BAaTVuFi1Kh/ uAAA== X-Gm-Message-State: APjAAAUDDic/EPA7Agx0siu6BUjJ6rUY3B6hycsalCFhonCntMUR0daI 72yK1lyLRBugWryzRG4XziKf9o33 X-Google-Smtp-Source: APXvYqw8TvXesItl3fLK0n7l0sJsRVNXr7yeS4UALZTQBDWnAiA1hrqv6e1PqZJOM2npUzLhzYJQYA== X-Received: by 2002:a1c:ef02:: with SMTP id n2mr4931206wmh.51.1552729852440; Sat, 16 Mar 2019 02:50:52 -0700 (PDT) From: Marcel Apfelbaum To: qemu-devel@nongnu.org Date: Sat, 16 Mar 2019 11:50:49 +0200 Message-Id: <20190316095049.28941-1-marcel.apfelbaum@gmail.com> X-Mailer: git-send-email 2.17.1 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::342 Subject: [Qemu-devel] [PATCH] hw/s390x: fix clang compilation on 32bit machines 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: borntraeger@de.ibm.com, qemu-s390x@nongnu.org, cohuck@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Configuring QEMU with: configure --cc=3Dclang --target-list=3Ds390x-softmmu And compiling it using a 32 bit machine leads to: hw/s390x/s390-virtio-ccw.c:175:27: error: implicit conversion from 'unsigned long long' to 'ram_addr_t' (aka 'unsigned int') changes val= ue from 8796091973632 to 4293918720 [-Werror,-Wconstant-conversion] chunk =3D MIN(size, KVM_SLOT_MAX_BYTES); ~ ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~ Fix the missmatch by declaring the 'chunk' variable as uint64_t. Signed-off-by: Marcel Apfelbaum Reviewed-by: Halil Pasic --- hw/s390x/s390-virtio-ccw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c index d11069b860..2efa47bc3e 100644 --- a/hw/s390x/s390-virtio-ccw.c +++ b/hw/s390x/s390-virtio-ccw.c @@ -161,7 +161,7 @@ static void virtio_ccw_register_hcalls(void) static void s390_memory_init(ram_addr_t mem_size) { MemoryRegion *sysmem =3D get_system_memory(); - ram_addr_t chunk, offset =3D 0; + uint64_t chunk, offset =3D 0; unsigned int number =3D 0; gchar *name; =20 --=20 2.17.1