From patchwork Tue Mar 13 15:34:53 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 131477 Delivered-To: patches@linaro.org Received: by 10.46.84.17 with SMTP id i17csp884730ljb; Tue, 13 Mar 2018 08:35:04 -0700 (PDT) X-Google-Smtp-Source: AG47ELuGyPc+AV4M9Y7pFlkMnq1a9PNLqJsPu3rZV5QTibppXLwTsLqPFT7AY6kKgPoRwQ0DbGGF X-Received: by 10.223.152.141 with SMTP id w13mr995111wrb.12.1520955304340; Tue, 13 Mar 2018 08:35:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1520955304; cv=none; d=google.com; s=arc-20160816; b=sWMg0AaFLU5N7PXkNzXQz9jnGv/1RuVYq0PTyw/qGVPI0vFkNGrAQV3BXPxNdBBuy6 V/wJSUsZpxN0Z77xagnHzoqjnX/PBO85XuUXfFOMu+xb0xhTF14Lqo6QEDcA/tQ3xm/6 jsqU3Z/77qg7RlFpa/ziULzxxBTDkVCjZ5J5uMDnFzhdOnoEHaOMIOI47Nt+3AnxkMZ+ 8VK7nhYMi1tmiDl4Esp2iYh4yVnvmHYju45xhVD40kvWx+M8EaPuUgBVFUqnb0wcQChj MP9Kcj1IZP5nsau7eEO9O/6jhnuzsYtscI4DOcs5uQJGJ1WhD/IR566e9+BEj0fzgOT8 oZGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=7q/S/h/s+d+0rvFHj5+iyJEKE2u2/qG5rNt6ixZ5Qrg=; b=q7TkHQEM/RuzB5KZ1H8zmt0m5DE9xTWB1dH5Z660tOjo+Ibmuv294XjoSFVOsKm1U3 S744fl28ldV8Ys5jKepI43agrTt4Yoq6ZIY31tHqVWXbcI/qco70wzSkLKGt8QowkolE 87jNvx+Oij88BwRv3vC13tjej5DjehHN/j1ackp/uoMIK1iqvlNvgjKSyyOtn8Q/3jL7 VVqx1+emzvkrB0jjwKHRotv/ROlCRzhUlIPiRXni1pkFkkYaaFyx5sRWl/GRiN6ppYGi tlevH4wsgjK+jz0XovxVCwLX7yBGTdvZNilDUDAncUW8xh+8rcJgzJv+vAGLKy1nKpXX Sj4w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of pm215@archaic.org.uk designates 2001:8b0:1d0::2 as permitted sender) smtp.mailfrom=pm215@archaic.org.uk; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by mx.google.com with ESMTPS id 62si305321wra.342.2018.03.13.08.35.04 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 13 Mar 2018 08:35:04 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of pm215@archaic.org.uk designates 2001:8b0:1d0::2 as permitted sender) client-ip=2001:8b0:1d0::2; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of pm215@archaic.org.uk designates 2001:8b0:1d0::2 as permitted sender) smtp.mailfrom=pm215@archaic.org.uk; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from pm215 by orth.archaic.org.uk with local (Exim 4.89) (envelope-from ) id 1evlx9-0003F5-S1; Tue, 13 Mar 2018 15:35:03 +0000 From: Peter Maydell To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Cc: patches@linaro.org, Pekka Enberg , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Andrew Baumann Subject: [PATCH 4/9] hw/arm/bcm2386: Fix parent type of bcm2386 Date: Tue, 13 Mar 2018 15:34:53 +0000 Message-Id: <20180313153458.26822-5-peter.maydell@linaro.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180313153458.26822-1-peter.maydell@linaro.org> References: <20180313153458.26822-1-peter.maydell@linaro.org> The TypeInfo and state struct for bcm2386 disagree about what the parent class is -- the TypeInfo says it's TYPE_SYS_BUS_DEVICE, but the BCM2386State struct only defines the parent_obj field as DeviceState. This would have caused problems if anything actually tried to treat the object as a TYPE_SYS_BUS_DEVICE. Fix the TypeInfo to use TYPE_DEVICE as the parent, since we don't need any of the additional functionality TYPE_SYS_BUS_DEVICE provides. Signed-off-by: Peter Maydell --- I noticed this when I tried to make the type into one which has its own class struct, because we hit the assert that the child's class struct had better be bigger than the parent's. --- hw/arm/bcm2836.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.16.2 Reviewed-by: Andrew Baumann Reviewed-by: Philippe Mathieu-Daudé diff --git a/hw/arm/bcm2836.c b/hw/arm/bcm2836.c index 40e8b25a46..9266f27c14 100644 --- a/hw/arm/bcm2836.c +++ b/hw/arm/bcm2836.c @@ -165,7 +165,7 @@ static void bcm2836_class_init(ObjectClass *oc, void *data) static const TypeInfo bcm2836_type_info = { .name = TYPE_BCM2836, - .parent = TYPE_SYS_BUS_DEVICE, + .parent = TYPE_DEVICE, .instance_size = sizeof(BCM2836State), .instance_init = bcm2836_init, .class_init = bcm2836_class_init,