From patchwork Mon Dec 9 09:49:59 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 11278875 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 46E29930 for ; Mon, 9 Dec 2019 09:51:35 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 23F3D2072D for ; Mon, 9 Dec 2019 09:51:35 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="U3HV4rr7" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 23F3D2072D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1ieFgk-0004TA-7p; Mon, 09 Dec 2019 09:50:46 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1ieFgj-0004Sn-49 for xen-devel@lists.xenproject.org; Mon, 09 Dec 2019 09:50:45 +0000 X-Inumbo-ID: 5e77a15b-1a69-11ea-87af-12813bfff9fa Received: from us-smtp-1.mimecast.com (unknown [207.211.31.81]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTP id 5e77a15b-1a69-11ea-87af-12813bfff9fa; Mon, 09 Dec 2019 09:50:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1575885044; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=nQooNv4KuAJbOCpnZQESZEyWieR/hAlT1WGgxUjJTpQ=; b=U3HV4rr7iW79bGAKPiRi+Rd8YGmb53rNOOlxOe+UHSKPEVZ738PbEKBO8bIpRz5lfJh0jK an7mObpz0dFn/6F2SSK9+ASkaRL37n/Q03TPIi2j1AnvKFP34dt/boOSB0hKd+mWi1p8K3 isCGQuhhBlUuc4rzv0aJ1TfETmYZ/Lw= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-13-gfa2tifNPLWJqkaOzwt-IQ-1; Mon, 09 Dec 2019 04:50:41 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 3A7CD800D53; Mon, 9 Dec 2019 09:50:40 +0000 (UTC) Received: from x1w.redhat.com (ovpn-205-142.brq.redhat.com [10.40.205.142]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5472519C5B; Mon, 9 Dec 2019 09:50:27 +0000 (UTC) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Date: Mon, 9 Dec 2019 10:49:59 +0100 Message-Id: <20191209095002.32194-4-philmd@redhat.com> In-Reply-To: <20191209095002.32194-1-philmd@redhat.com> References: <20191209095002.32194-1-philmd@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-MC-Unique: gfa2tifNPLWJqkaOzwt-IQ-1 X-Mimecast-Spam-Score: 0 Subject: [Xen-devel] [PATCH-for-5.0 v3 3/6] hw/pci-host/i440fx: Use size_t to iterate over ARRAY_SIZE() X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Thomas Huth , Stefano Stabellini , "Michael S. Tsirkin" , Paul Durrant , Markus Armbruster , Alex Williamson , Marcel Apfelbaum , Paolo Bonzini , Anthony Perard , xen-devel@lists.xenproject.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" We don't enforce the -Wsign-conversion CPPFLAG, but it doesn't hurt to avoid this warning: warning: implicit conversion changes signedness: 'int' to 'size_t' (aka 'unsigned long') [-Wsign-conversion] Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Thomas Huth --- hw/pci-host/i440fx.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/hw/pci-host/i440fx.c b/hw/pci-host/i440fx.c index fbdc563599..0cc80b276d 100644 --- a/hw/pci-host/i440fx.c +++ b/hw/pci-host/i440fx.c @@ -419,12 +419,11 @@ out: static void igd_pt_i440fx_realize(PCIDevice *pci_dev, Error **errp) { uint32_t val = 0; - int i, num; + size_t i; int pos, len; Error *local_err = NULL; - num = ARRAY_SIZE(igd_host_bridge_infos); - for (i = 0; i < num; i++) { + for (i = 0; i < ARRAY_SIZE(igd_host_bridge_infos); i++) { pos = igd_host_bridge_infos[i].offset; len = igd_host_bridge_infos[i].len; host_pci_config_read(pos, len, &val, &local_err);