From patchwork Wed Mar 21 16:31:58 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andre Przywara X-Patchwork-Id: 132213 Delivered-To: patch@linaro.org Received: by 10.46.84.29 with SMTP id i29csp2356005ljb; Wed, 21 Mar 2018 09:34:57 -0700 (PDT) X-Google-Smtp-Source: AG47ELsu8Fn0r1d3AdJlY9pL8L30yA6vuaJbddhtnieEHwhjY1FMWPh0zkDmw4M6PIDQt2rpFMmn X-Received: by 10.107.184.198 with SMTP id i189mr20463563iof.228.1521650097086; Wed, 21 Mar 2018 09:34:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521650097; cv=none; d=google.com; s=arc-20160816; b=mr5wZ6ezc9PXK6C4EPdZcFrcHcK4AMIGlMe09Pm2zFeAZ7/HFDgw1+VeeJ30lsIDMQ gym97t3Y7tdZMCdYGQXge2jz01x7Q6BcCuzWGA3G6Ygj9sG6HJePyDZx89i5R0gL/Xxw P9VNhqzOCSONfSOkZYz37ggVkeWhAP6yMkCJw8StwS2dpHEQCrBp07Kjej0eKNG4XVh6 wE+gG261Ozh28BFLabw5u0lkWdz4Zs8WMSG51h4RGDKBpG1/1l+8WIIe0hF4dj0D/BlG y9p4355wSKZeUxCkisGjZ1giTfjXDQMJuQsWnt41Fc2CJWXWAVpHYX9Sceu3pmnyZM3L N8jQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc :list-subscribe:list-help:list-post:list-unsubscribe:list-id :precedence:subject:references:in-reply-to:message-id:date:to:from :dkim-signature:arc-authentication-results; bh=2Akjv4zUO6HBrmNrOryGmz5XgHPNjPcmaGEBJJ9a7X0=; b=l8b34zX3NF8HNqq9ppnvaayV8l6IHmW8Hm4EurOtRWI+NkPApZZbbDf00ScFqsqCC5 Vt0WKWynj/TGCgdxMCdxyNxnJfm2cQK4r9Cdg9Hp2Ly7CbnrVNKcSGGwz4NJhwpVuLsj zRKAJNQOXFoC7qeK9Q7nfLHhZqfirsXxrwd1wrlwCGOoOy0dukyB8T8JiUIAes/iGqJ0 TFKTo3Zp5Iua0TXNgtWN/SX7OTRn2x7kF68n1WRwt3lL/NOIdZTH7JHP5q7+OQetuCxH Sipz4FhJEuNhTd/Qmrb1RfLpJBFofwKZpWgu925lrKEIkgMMJKXuwXElCRt2JTe1blzs BIkQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=BZHBlomk; spf=pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id w184-v6si3448507itf.128.2018.03.21.09.34.56 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 21 Mar 2018 09:34:57 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=BZHBlomk; spf=pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1eygfV-0001zC-CD; Wed, 21 Mar 2018 16:32:53 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1eygfU-0001yT-Ps for xen-devel@lists.xenproject.org; Wed, 21 Mar 2018 16:32:52 +0000 X-Inumbo-ID: 7650519a-2d25-11e8-9728-bc764e045a96 Received: from mail-wm0-x242.google.com (unknown [2a00:1450:400c:c09::242]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTPS id 7650519a-2d25-11e8-9728-bc764e045a96; Wed, 21 Mar 2018 17:32:36 +0100 (CET) Received: by mail-wm0-x242.google.com with SMTP id l9so10908707wmh.2 for ; Wed, 21 Mar 2018 09:32:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=zBv+jsGEJOc7j8/GWxdvwMoisM8xpWDHpJ6/8+9Ijow=; b=BZHBlomkjSamVVD588vXTukRbcq+fYfwh31pzVW8pzfnCQkuEmsONqUy6MGvgWYGmC HC2P8eVwl9/aAQBYpIDH9zm0kv5eauYYJZoC2EusGZ02xTiou6o05wCGbRJcVioa0KOv GmUgm33rp6kITTpQktnzS90aZgJvPKzmLqc8I= 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:in-reply-to :references; bh=zBv+jsGEJOc7j8/GWxdvwMoisM8xpWDHpJ6/8+9Ijow=; b=Rxb6Md6i05BM5l1yGCg1BkwCzgtuU5u/RlvlqXyI5pBzvBERcdwnN3FWmZhGke78OV E1zzUYHlmVHMWJihGozrklaOMSWuiMD5ANZyVxWecR3dd8C2rHgyjGnaXScOZ29FFngx D9gFk4RX6S+6lr1qu0WDDAtXYCnfFPGF0x3ZnCnSvVxJFd2smnvpAYSGNt2wkWyRGV0u g7pb3Zu5hoO3kADXM6fCqnGGO2sTwD0BtYJyYn7t4+Jk65Ifd5hcsp3heC8WUTRWWJRc +AlOqE2Q8qDMCwfhtXTfz65KZ1l5n+U9YmuHmxeOm1P9xd9+TqpLRU3J4rQhpNdXn88I oUQg== X-Gm-Message-State: AElRT7Fgyv/6q2AS8I7F0MBnoXB8CQoDYdVuzXRUsim8z/yjy/JcQcFH A5p46RQXVxzZfq7UMtlANhWFQw== X-Received: by 10.28.35.76 with SMTP id j73mr2924922wmj.103.1521649970003; Wed, 21 Mar 2018 09:32:50 -0700 (PDT) Received: from e104803-lin.lan (mail.andrep.de. [217.160.17.100]) by smtp.gmail.com with ESMTPSA id n64sm4423724wmd.11.2018.03.21.09.32.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 21 Mar 2018 09:32:49 -0700 (PDT) From: Andre Przywara To: Julien Grall , Stefano Stabellini Date: Wed, 21 Mar 2018 16:31:58 +0000 Message-Id: <20180321163235.12529-3-andre.przywara@linaro.org> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180321163235.12529-1-andre.przywara@linaro.org> References: <20180321163235.12529-1-andre.przywara@linaro.org> Subject: [Xen-devel] [PATCH v3 02/39] ARM: GIC: add GIC_INVALID to enum gic_version 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: xen-devel@lists.xenproject.org, Andre Przywara MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" The enum gic_version at the moment just contains GIC_V2 and GIC_V3, where GIC_V2 happens to map to 0. So without having initialised a variable of that type, we will read back GIC_V2 (when allocated with zeroing the memory). To prevent ambiguities and to give an explicitly uninitialised state, add a new first member: GIC_INVALID. Also make it obvious that this has a "0" encoding. Signed-off-by: Andre Przywara Acked-by: Julien Grall Acked-by: Stefano Stabellini --- xen/include/asm-arm/gic.h | 1 + 1 file changed, 1 insertion(+) diff --git a/xen/include/asm-arm/gic.h b/xen/include/asm-arm/gic.h index 565b0875ca..3079387e06 100644 --- a/xen/include/asm-arm/gic.h +++ b/xen/include/asm-arm/gic.h @@ -227,6 +227,7 @@ struct gic_lr { }; enum gic_version { + GIC_INVALID = 0, /* the default until explicitly set up */ GIC_V2, GIC_V3, };