From patchwork Tue May 23 06:12:04 2023 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: 684883 Delivered-To: patch@linaro.org Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp1548908wrt; Mon, 22 May 2023 23:13:03 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6kpylrWjOmDAhMxgH5xUGRtXmIlK65pXpn6HxVQ0mRGtxyTfpcCKyms6DaYgGT/NsfQqZc X-Received: by 2002:a05:622a:290:b0:3f6:a3d3:a506 with SMTP id z16-20020a05622a029000b003f6a3d3a506mr10850773qtw.37.1684822382964; Mon, 22 May 2023 23:13:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684822382; cv=none; d=google.com; s=arc-20160816; b=fGEkdBFEgaXWjMb6fMv8aIMDlWplBFx/KKrr2v4B3knWwJagQSRK+TRFUqrHVDJUlw +yqJrYV7PgPE+TUlvGWi243Vrsp/zI+SghM1zR2MAtja38xGQ/w0MIthgDSglOB3qp9w nk8GC526J/S/kF80lnx1vn7elLN3s6RiQbbDCeOEvdtVaoL5ai+Ld8RZhhWq02Hfm//2 RfcNWrsSRe6J3n7tk1klspvMchWwehXOLLApjBWBvyWPX8aCDOAJetcu4nqmVCCYG/pS KK50Gp+vl862EEjjTUm+CeuZnedUQcaCFHTXZiBSALziAOO+oKziywYeCM2k3x0twhUA jsvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=rvgfSp3TjhqQzTM2G/fo+fd/Hd3siY9cL5SrH7t8cjY=; b=sWDHLVfvo3JESvJ7xtPEq3jFiAbzgqArZN/TJYXvJjOWZDAZzw5yKMGMY+1dUjUtAb zwR4+t46gZql1kVxMGzfP3HA6EC2C7Wtof3i7+YBYID3rPpzcvxniYT4vr4ocBQQgH/b XLA0cCRCxaHG6h6nF+BGnKiJQaSXTf4jeO2/IjR8Iu35eB/mItnzL0urrXLEdTJuaL/m 4MMGP6WhDSTXZibNVW/YDVYHf/BjIa+D/kV/tGkJNnJ/WTPFRERsuvD/Yon480yngEGT wPIRtKDUh1qxzsXZSDB4qxch10tDk1ZPberV757b7ZlV3hO4DkgsMSiu2W0m/Mqp/3Zs BuKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=WbcZ09sU; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id y8-20020ac85f48000000b003f39816f046si4675476qta.609.2023.05.22.23.13.02 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 22 May 2023 23:13:02 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=WbcZ09sU; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q1LG1-00006n-Dr; Tue, 23 May 2023 02:12:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q1LFr-0008UZ-Dz for qemu-devel@nongnu.org; Tue, 23 May 2023 02:12:19 -0400 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q1LFp-0005GF-QU for qemu-devel@nongnu.org; Tue, 23 May 2023 02:12:19 -0400 Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-3f606a80d34so10522635e9.0 for ; Mon, 22 May 2023 23:12:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1684822336; x=1687414336; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=rvgfSp3TjhqQzTM2G/fo+fd/Hd3siY9cL5SrH7t8cjY=; b=WbcZ09sUjG+37IQGon9H7EIfRkiDXXksdz1F975KclEMNwL8LMBixytqcMxO5mo6yg sR4YkE/6re5LkWSj5cAzjbRxIaqqnTKKHUyWfzRpaEotNP8sN1/GaO9q8A9SwiE/5gbK UxpAK+jiD+GxqhjVhwqkV8uZB6voQdyhD63fTUXoi5uWvuO9juolSjw68YIHEOpWF/ZT 6fhWAvBG2RmiGrOsXc+7jEfotwBCqUqdcUhprWQ1UKtQPhUs7qirhty/fHgfOOWsu2IN ShYL3OjJXAJ4uOHuEP+rOqYQkJ4FfVI7TvVKbvCkHgOxZddj0Xkgceke9nypDb+bTnCL MtIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684822336; x=1687414336; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=rvgfSp3TjhqQzTM2G/fo+fd/Hd3siY9cL5SrH7t8cjY=; b=V+kIdXpp5EVOjz9vlQslYszc1YLlR7UoIHob/QxrLgOe/kBgFyBwK0s/zqhvXUmCAl 5DpZAUb1kE3E4GMpU1rf5xwF76/Vcy2KJTvntzH6tI3iyUjmiXvqPA57prM+M3NHyQk2 diecPy7dVOpM3rOK55jv7uh+8L+lUald1ZBbQKKTPCQkSNHKUOrXFvfy/l5DiK7GLbCb swwMqLkIub0EODva3YQNiW9EOD1Ar/M4AwoK7MpgSs8LNPH2rmoOtDZPaTTw+oxKZWqT uJQecPsQUlK3ZF6WFmBXespaNVTrz9suGuuF403FTHcDZduE7MqWGfaXZhUn+1iUDlpW fjHA== X-Gm-Message-State: AC+VfDzhbffFL9E6hSVMrw/mgW7dQ1TcziYn1ZXyvsspj1UZucvTn8A0 rUJyMGFHD3b7z399/9/mk9YMxlu+7ZKn595xw2U= X-Received: by 2002:adf:ee05:0:b0:307:a24f:c15e with SMTP id y5-20020adfee05000000b00307a24fc15emr8582480wrn.39.1684822336101; Mon, 22 May 2023 23:12:16 -0700 (PDT) Received: from localhost.localdomain (vil69-h02-176-184-48-94.dsl.sta.abo.bbox.fr. [176.184.48.94]) by smtp.gmail.com with ESMTPSA id k2-20020adfd842000000b0030647449730sm9894577wrl.74.2023.05.22.23.12.14 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 22 May 2023 23:12:15 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Sergio Lopez , "Michael S. Tsirkin" , Eduardo Habkost , qemu-trivial@nongnu.org, Richard Henderson , Gerd Hoffmann , Marcel Apfelbaum , =?utf-8?q?Philippe_Mathieu-D?= =?utf-8?q?aud=C3=A9?= Subject: [PATCH 1/4] hw/core/cpu: Simplify realize() using MACHINE_GET_CLASS() macro Date: Tue, 23 May 2023 08:12:04 +0200 Message-Id: <20230523061207.48818-2-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230523061207.48818-1-philmd@linaro.org> References: <20230523061207.48818-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::334; envelope-from=philmd@linaro.org; helo=mail-wm1-x334.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- hw/core/cpu-common.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/hw/core/cpu-common.c b/hw/core/cpu-common.c index 5ccc3837b6..620312e9a5 100644 --- a/hw/core/cpu-common.c +++ b/hw/core/cpu-common.c @@ -196,8 +196,7 @@ static void cpu_common_realizefn(DeviceState *dev, Error **errp) * no need to check the ignore_memory_transaction_failures board flag. */ if (object_dynamic_cast(machine, TYPE_MACHINE)) { - ObjectClass *oc = object_get_class(machine); - MachineClass *mc = MACHINE_CLASS(oc); + MachineClass *mc = MACHINE_GET_CLASS(machine); if (mc) { cpu->ignore_memory_transaction_failures = From patchwork Tue May 23 06:12:05 2023 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: 684884 Delivered-To: patch@linaro.org Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp1548998wrt; Mon, 22 May 2023 23:13:24 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5mNV1M+jLusLCs3dLJ2b8vJce1saGg4X5jMVQH56QrWynjP9qIipbCq4qFHi+Mx+jHbjcE X-Received: by 2002:a05:620a:8fcc:b0:75b:23a1:3638 with SMTP id rj12-20020a05620a8fcc00b0075b23a13638mr2957583qkn.73.1684822404544; Mon, 22 May 2023 23:13:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684822404; cv=none; d=google.com; s=arc-20160816; b=rFrKNsxFvs8NBjhqvCkfxT4oj9UyMOgFKWfupOynKYWO2XZ1aTz/DjIq65n//BIyyo +itUE7iB/aVSeMXntCi5/2auHjCAAKoQ8zdDIhVSQnoc7IJj37HW+mhqwVf02g96lqVB Og1lMJlbo42/kCo/KCKAQzXdhzATy6Q3iDB5gZs4tlOB/d/d+7kam1a1Thk0wVsFGlLA Sm9H1zmqMDwGmDhGcnIvFSHMtMKvbKliHgR9B8WD+13R1OHam1GjG3sQBK1G9poTMCzI k2eNJI93ryzjlATCn/T8NXc/+E/m7Pw6DuuG536fnixjHPJytngGkkwCwxxwdeZRB/tp cLGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=rQwCIhldMwC77ntdeaeg6sH3aScyUcbooXBZJsXEYow=; b=guqRKkm4dKZA9UrJB1nrwWL/sKO7GLLndITJTDisfejeZ3lUai8t1hQlLpJOg/+lgT /nU7rVzPhDHawjzP/MEXNwuTZrK0AdUldYpEfNyec/cIxW0XLsqpOTVkWgmXBEi/uN9h x/32yc4ePzm7hYlShLMUWtxG2JKYpAnnw1geFtkRSQ+LOijcqmVu77/IFaSNDbTUVwkT uGM1phgr85zwSPtOmSCYt8Inn4aTUZqAODoQloWhu3anSoCD/7RIRqiF7MsTdP/42avB Uq1ycSBxUyfYP0RqIw6Wia3r9jQQOxRLeUHNj+cJEE+22EXCK4wHaP4FgMPC39xmQcrh sI/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Yeb5fJ89; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id v1-20020ae9e301000000b0075947ef3253si1743325qkf.166.2023.05.22.23.13.24 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 22 May 2023 23:13:24 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Yeb5fJ89; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q1LGA-00009j-Ur; Tue, 23 May 2023 02:12:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q1LFx-000054-2B for qemu-devel@nongnu.org; Tue, 23 May 2023 02:12:28 -0400 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q1LFv-0005H4-JE for qemu-devel@nongnu.org; Tue, 23 May 2023 02:12:24 -0400 Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-3f423521b10so44793435e9.0 for ; Mon, 22 May 2023 23:12:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1684822341; x=1687414341; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=rQwCIhldMwC77ntdeaeg6sH3aScyUcbooXBZJsXEYow=; b=Yeb5fJ899eSOVzWUQqQyU1B7T8QMepA6aHQyF0ZqFxmvauCEok2oxk7EnRoPf4eW63 ewHT8q/aPGmJM01UU54a5byzgyodo1ERoDAl6wn4WKTmB2L3nFSo6aLlFS08AcHXpWu8 ZRFfHVTj7whIlD2+v/Abh7+bW9DJr9zV01nxlLtUWViDo5YzYBV30uC6j0aLh837X4F3 xzTZAjyur9422cT00+ama/ZqWVJ5dOjbI2xaKzEbdqCl+OVHtAuYZuvqcWeF1YT1iesb Yqbi4fXITwtnVKnFI1DM34dBtrTE/dCh6AJx8rrcRwMkB2xapEyApiEYnBGaVhwwJlvD rMjw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684822341; x=1687414341; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=rQwCIhldMwC77ntdeaeg6sH3aScyUcbooXBZJsXEYow=; b=Xq3+Ge8Hj3uyuHPxl6Ix9Y0EDafSVY3rNR4dR3suX4D8QD4li/wyof1fqlwQ6Xhj1n 7T8orNaxnSFzrygTeOb1lDFt9v1dEJD7uiXE4oF+iTMzIx55lOt7WnrobymTi9Ss3xwW J/sMrNCim+Oe5mXYEpuVqpowm7/S1W5I79FyJer5fP4xbbbx8lqsU/fcejmS3/urF/m+ eR2Rdl2tD2ZzN0tScpWXippme5DD0vvLMqJM6glI2wTc9+N5uIXpyoESRf3xsnhPLylr w/g9hmkZRp/ktFKCCk+tNDFR3/9lOySgpPBL3H349BajcBZJpbfODy5z3U4/jxdru6I/ 3R4A== X-Gm-Message-State: AC+VfDxVislYWG2TrjP8PK4kcaTTsgxBmRfnxMc605Gw82b3S197C7+8 MUZ2xq0X/n177zFhPALcvtf5PLnayCb3pJSbynM= X-Received: by 2002:a7b:c8cb:0:b0:3f6:2d8:4823 with SMTP id f11-20020a7bc8cb000000b003f602d84823mr5043528wml.3.1684822341801; Mon, 22 May 2023 23:12:21 -0700 (PDT) Received: from localhost.localdomain (vil69-h02-176-184-48-94.dsl.sta.abo.bbox.fr. [176.184.48.94]) by smtp.gmail.com with ESMTPSA id n16-20020a1c7210000000b003f6042d6d92sm5888628wmc.46.2023.05.22.23.12.20 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 22 May 2023 23:12:21 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Sergio Lopez , "Michael S. Tsirkin" , Eduardo Habkost , qemu-trivial@nongnu.org, Richard Henderson , Gerd Hoffmann , Marcel Apfelbaum , =?utf-8?q?Philippe_Mathieu-D?= =?utf-8?q?aud=C3=A9?= Subject: [PATCH 2/4] hw/i386/microvm: Simplify using object_dynamic_cast() Date: Tue, 23 May 2023 08:12:05 +0200 Message-Id: <20230523061207.48818-3-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230523061207.48818-1-philmd@linaro.org> References: <20230523061207.48818-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::334; envelope-from=philmd@linaro.org; helo=mail-wm1-x334.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Use object_dynamic_cast() to determine if 'dev' is a TYPE_VIRTIO_MMIO. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Reviewed-by: Sergio Lopez --- hw/i386/microvm.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/hw/i386/microvm.c b/hw/i386/microvm.c index 3d606a20b4..7227a2156c 100644 --- a/hw/i386/microvm.c +++ b/hw/i386/microvm.c @@ -389,9 +389,8 @@ static void microvm_fix_kernel_cmdline(MachineState *machine) bus = sysbus_get_default(); QTAILQ_FOREACH(kid, &bus->children, sibling) { DeviceState *dev = kid->child; - ObjectClass *class = object_get_class(OBJECT(dev)); - if (class == object_class_by_name(TYPE_VIRTIO_MMIO)) { + if (object_dynamic_cast(OBJECT(dev), TYPE_VIRTIO_MMIO)) { VirtIOMMIOProxy *mmio = VIRTIO_MMIO(OBJECT(dev)); VirtioBusState *mmio_virtio_bus = &mmio->bus; BusState *mmio_bus = &mmio_virtio_bus->parent_obj; From patchwork Tue May 23 06:12:06 2023 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: 684885 Delivered-To: patch@linaro.org Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp1549152wrt; Mon, 22 May 2023 23:13:53 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5kK2TnZQ9yJ46pg2NeuYjHn70Prrfac4Z6Jf/KbXxzMQXu+j2kwaUVaXPTw0WNQUH27tRT X-Received: by 2002:a05:6214:500a:b0:5ee:e4f8:c7e5 with SMTP id jo10-20020a056214500a00b005eee4f8c7e5mr19962714qvb.41.1684822432969; Mon, 22 May 2023 23:13:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684822432; cv=none; d=google.com; s=arc-20160816; b=KmzrvIgMXJ0MPF+SdhtzY3Cp2aix9/jJmtANR9XLWXbibpUc7+d1FUi0y3FNKxoE3w j/QbFB3yfCTSQzmyxAIpogAJRsK/JetW5BERIJVCFbAI8qDM5VQmxrxmfIcUsp7Iznbj mr4Y+p57oniayzCAoLRvvG66Gj0BLpYWlptkz4IHx2iSdhbLyFOQL4gaoXQ0U7Cnxj6/ 320zqBhJDfUmFxzz4/XyrT5Am2yQnDvjetLlPvPUyEoIl4l1Yxr1llOlHNUx2OeTaiKM j3m/GHlrW1o7su0YnHWLJ47CcE/93DZfJ3CX4r+DFsn/P1Cdw2uhMc64C/h4cmAYzXMR KbMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=COK8ArK9HCGV7dddfTJnezNiZomsbkwCtC2egyZo1Mg=; b=HfQnDvp6cjzJ3CUX6NnIRVtztYxr18N9LUjj5Xfv5aTlCAheUgdNWPKVzkn0r9Co/X bX6U0368kqFRDnrh0gUcabb0G881c3qvRo+jkDiE+aWhWyX+MozqSTwxdK4F+SDPjC2D C9P2/gCF6Ipid2whCGR51mZzNgBVGRYrQjBAZTgaCuufvs/pjRBIlCEbXBYiB/oRVD0K iO6uMQy7Sk6d3gYlWmgbkEmXzNk6inprX/XBRrMo7SoCi2S+ZDeHzJLLOzH8pQayp2K/ SHYI9okc5TqAKtOF/XoRHdBSnD8CEG3iD6u/mJpFde/Q5XHKL2XXoFtfMncyD9PDRS5k wesg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="Yq3/SmwS"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id jn10-20020ad45dea000000b0061b75442085si4451809qvb.40.2023.05.22.23.13.52 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 22 May 2023 23:13:52 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="Yq3/SmwS"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q1LGU-0000KU-PV; Tue, 23 May 2023 02:12:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q1LG3-000084-Df for qemu-devel@nongnu.org; Tue, 23 May 2023 02:12:34 -0400 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q1LG1-0005HY-46 for qemu-devel@nongnu.org; Tue, 23 May 2023 02:12:30 -0400 Received: by mail-wr1-x429.google.com with SMTP id ffacd0b85a97d-309d3e8777cso2206946f8f.0 for ; Mon, 22 May 2023 23:12:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1684822347; x=1687414347; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=COK8ArK9HCGV7dddfTJnezNiZomsbkwCtC2egyZo1Mg=; b=Yq3/SmwS4ficbNhmaVHY92cqgGJxycWoEDAN0RmwiKiWSlLO2G22aYs++YYfZdxd1Z mRgkISUri+Q6vwNFoV4CYDXTJXHWLLPeG9zXLop/2FzB0bLmALSYLYmxpoKfHkEVd05f rh5MispZtv2jMlgniLg1sJTmqtsQ+2Sh8ICUmCcBvDelVFZ9IUqXqjvc5Av/rhyvDGXA CHJEk3sIAwnvYT65vAWpLb9zWU1oOs1gdUpxzodcQN2uJr6dVnUoUKq2rMNfc5YkbgEE B45v1bDoJ6HXvoKyVkyAjk3TEKW8NW6bZZ6yv9jW8kPC7+v/yJaiSv5vdI/qvSJ0ObaE WdTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684822347; x=1687414347; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=COK8ArK9HCGV7dddfTJnezNiZomsbkwCtC2egyZo1Mg=; b=XBxovRV1+i8vEHxETvfXuwApW+KBiqlCY4SXp8WZ3kwCzx6xSmm28oXv1xFHnxeYWc t1CsCcXV+Wke5CtlJt1ICVEJWE60BDg4F+vaPivMoR0YHJwsXLyWMlDQn1LV1MQd3yzL asg3psC8GIxGji+DsEt/1teWcW+VkC161eSZcUAgZBV1e8CECZbC6HQhWJNDTCgDwlpg 4maUhl+XcZ7+cJbl/NYElvX8DRZV6HXq2eG4iF+RPNVQIOCWPrhz6rbuZjNKnZbHYI9c GL2UtbveXN/hWtdr7wkxaHd/xkmgS9fhqRvrXPCV4cc1swed85GyIb9B5JHKxUnLBDPA bSpg== X-Gm-Message-State: AC+VfDw647fqI7bhhZrdcStdsSmILi+gJSLImJYpX+vL9/+/tmEYFMlv uAl089ic7PcZBIxq1M9+9oDAisD4Fbusf62Gc7o= X-Received: by 2002:a5d:4204:0:b0:307:7d1a:20fd with SMTP id n4-20020a5d4204000000b003077d1a20fdmr10396367wrq.12.1684822347356; Mon, 22 May 2023 23:12:27 -0700 (PDT) Received: from localhost.localdomain (vil69-h02-176-184-48-94.dsl.sta.abo.bbox.fr. [176.184.48.94]) by smtp.gmail.com with ESMTPSA id o9-20020adfeac9000000b0030647d1f34bsm10031319wrn.1.2023.05.22.23.12.25 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 22 May 2023 23:12:27 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Sergio Lopez , "Michael S. Tsirkin" , Eduardo Habkost , qemu-trivial@nongnu.org, Richard Henderson , Gerd Hoffmann , Marcel Apfelbaum , =?utf-8?q?Philippe_Mathieu-D?= =?utf-8?q?aud=C3=A9?= Subject: [PATCH 3/4] hw/pci/pci: Simplify pci_bar_address() using MACHINE_GET_CLASS() macro Date: Tue, 23 May 2023 08:12:06 +0200 Message-Id: <20230523061207.48818-4-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230523061207.48818-1-philmd@linaro.org> References: <20230523061207.48818-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::429; envelope-from=philmd@linaro.org; helo=mail-wr1-x429.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Remove unnecessary intermediate variables. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- hw/pci/pci.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/hw/pci/pci.c b/hw/pci/pci.c index 1cc7c89036..a2cb6071cb 100644 --- a/hw/pci/pci.c +++ b/hw/pci/pci.c @@ -1444,9 +1444,7 @@ pcibus_t pci_bar_address(PCIDevice *d, { pcibus_t new_addr, last_addr; uint16_t cmd = pci_get_word(d->config + PCI_COMMAND); - Object *machine = qdev_get_machine(); - ObjectClass *oc = object_get_class(machine); - MachineClass *mc = MACHINE_CLASS(oc); + MachineClass *mc = MACHINE_GET_CLASS(qdev_get_machine()); bool allow_0_address = mc->pci_allow_0_address; if (type & PCI_BASE_ADDRESS_SPACE_IO) { From patchwork Tue May 23 06:12:07 2023 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: 684886 Delivered-To: patch@linaro.org Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp1549238wrt; Mon, 22 May 2023 23:14:08 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5INV33EYD66Fh+4WVBFnzf7Pw0LyrMvZfvIjocX/51IhLTRtvGE79LOi2vPq+IxF/CdSkw X-Received: by 2002:ac8:5a44:0:b0:3f3:669f:473c with SMTP id o4-20020ac85a44000000b003f3669f473cmr19624814qta.49.1684822448293; Mon, 22 May 2023 23:14:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684822448; cv=none; d=google.com; s=arc-20160816; b=YA85xVA525sLJEwtwZ/KTRaqtM7KbgAUgAQSvvKSa15uvl+7f61/+wu+KdQe+1J5Js GrzM/hySk2src8FEj+IzRf9VdTgA+3oe7qg9AieD5Sq8nim6OBdv3nq/Rg10b0Q6dWv3 FabuqraPbi+8IFuwcx0p6q3YXdJazw3Gb+a0hivseN0uZ4LGmbYhjzFGWBsD1nb6HF2Q 41nUdW4vBz4Rdo30GkS1nGHhkusWsJoMjdsUa6l/T80MwWgcoWvEcDRLcyRTcL3Mr4pO dK0BUbfeh0yLKlYCLGzmKN+FFcQ/pE+AihwWvg8oetWnncUF/qaD1hB20Pcsj4l7nibX dEBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=vkILo9SwujHxUBUp1ZR6EEs4lszUfK1/I8whdwDZtw4=; b=gBbb0bM3auwySayIe9OmNQjNfhzK5f3dXw1+WKib1cIqwlMsnh00DeD+GD7x+4elPU 5ynfS/4mafYHG0/dbqIEIsQ9zjlvHXu+4/FxCSJ78geUPSA/L+c/07QfVcPwjg/GLc+M KrwS91V0ln1UKVnTz8yjQIHC8p+ElzTgkxR10p53W9oob8Ydj4+UO1jE6VtZs2P/7nGf xlMfZvkBLwEcg4GLY+DzDwDuG7LZ2nI0p9KrHbvlyFv+KwxQDGQX0e+clK7NsaAOSTGM ctotWUzsvUx8nJAulfvZP3Q/WBf1yO2KyQIwrl+maPEIznn2AHKZjeN4bPrpLENXx60J MHIQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=eYUkRmIu; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id n20-20020a05622a041400b003f6b7262df3si1374273qtx.298.2023.05.22.23.14.08 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 22 May 2023 23:14:08 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=eYUkRmIu; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q1LGW-0000LQ-FE; Tue, 23 May 2023 02:13:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q1LG8-0000A5-5w for qemu-devel@nongnu.org; Tue, 23 May 2023 02:12:37 -0400 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q1LG6-0005I7-Jy for qemu-devel@nongnu.org; Tue, 23 May 2023 02:12:35 -0400 Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-3f608074b50so12296685e9.0 for ; Mon, 22 May 2023 23:12:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1684822353; x=1687414353; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=vkILo9SwujHxUBUp1ZR6EEs4lszUfK1/I8whdwDZtw4=; b=eYUkRmIuVeopkfcJ9LVh4LhwHPZS+6bZ4svQd24hcus0NHav5uY6o2S+goIp7tIdlI j4+v3OzHkpE427LcopqtoiiOmOGDJzUd2xLmnQI/jJROVLCBIpt0O8X1yUDvvFursZJd 5AbleFBw3yyRURMHHya3sRBMnIyZDNQglIqpx+TNh1EYc+njTv3njw3FVl3NU4HYvGta UdjUFryrSiMvlbh8LXDkpGBA6u/MSO0TDQNP3nAmZJxeTyZGHpeA5SSjh+y4key518cu t5e3eG6Ms0IEVmQfp5Wg9obJFJIYP9lRYZYXV7BWX25SEBLE3xVqV+TaKeM7JIWfLXJ7 A6cg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684822353; x=1687414353; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=vkILo9SwujHxUBUp1ZR6EEs4lszUfK1/I8whdwDZtw4=; b=BbbMR/aHvE0i+Clj7gORiTR56X8cBh0M0HWEm0wke2jFmM483zMBUBqA+P1g/Xeb3N 5vn8JyGgpCO/fEYHQHZuVSn/Xupthla26pkb9nikkZlLKOjZZ77qRT5toONMAA4Rz+m1 XAuBLkGB57Ft36+RTBv7pbRqNeBWSYbsu1NtPKcxX4DC2wXr6H95ssqRMW9fNoZWicxW VPChUaCjrbQBL3IqP0wDK1abUH/73S/XdlqUue98qDOnoKV5Si6mlNr1VdurA6Y2/vpX Z+DT/M+rBeJNbj3UDUpLRMClcQ0d4hz63hf4jF2E8ftSTASvgns8DQKWGwWR0aZm+att 1S+A== X-Gm-Message-State: AC+VfDxBtBIQN8Y3IUjHDPlBr9iFu4y3EOm9gtX4GMIp1U7N+152wPGA UvhEfqvc5WcGiX0HpWMgBcKQj1pvcyNug9MWjww= X-Received: by 2002:a7b:c393:0:b0:3f6:a66:a36d with SMTP id s19-20020a7bc393000000b003f60a66a36dmr860850wmj.10.1684822352954; Mon, 22 May 2023 23:12:32 -0700 (PDT) Received: from localhost.localdomain (vil69-h02-176-184-48-94.dsl.sta.abo.bbox.fr. [176.184.48.94]) by smtp.gmail.com with ESMTPSA id k21-20020a7bc315000000b003f60a9ccd34sm1074830wmj.37.2023.05.22.23.12.31 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 22 May 2023 23:12:32 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Sergio Lopez , "Michael S. Tsirkin" , Eduardo Habkost , qemu-trivial@nongnu.org, Richard Henderson , Gerd Hoffmann , Marcel Apfelbaum , =?utf-8?q?Philippe_Mathieu-D?= =?utf-8?q?aud=C3=A9?= Subject: [PATCH 4/4] hw/usb/hcd-ehci-pci: Simplify using DEVICE_GET_CLASS() macro Date: Tue, 23 May 2023 08:12:07 +0200 Message-Id: <20230523061207.48818-5-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230523061207.48818-1-philmd@linaro.org> References: <20230523061207.48818-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32b; envelope-from=philmd@linaro.org; helo=mail-wm1-x32b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- hw/usb/hcd-ehci-pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/usb/hcd-ehci-pci.c b/hw/usb/hcd-ehci-pci.c index 4c37c8e227..345444a573 100644 --- a/hw/usb/hcd-ehci-pci.c +++ b/hw/usb/hcd-ehci-pci.c @@ -74,7 +74,7 @@ static void usb_ehci_pci_realize(PCIDevice *dev, Error **errp) static void usb_ehci_pci_init(Object *obj) { - DeviceClass *dc = OBJECT_GET_CLASS(DeviceClass, obj, TYPE_DEVICE); + DeviceClass *dc = DEVICE_GET_CLASS(obj); EHCIPCIState *i = PCI_EHCI(obj); EHCIState *s = &i->ehci;