From patchwork Thu Jun 1 09:34:51 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: 687693 Delivered-To: patch@linaro.org Received: by 2002:a5d:4d8a:0:0:0:0:0 with SMTP id b10csp235167wru; Thu, 1 Jun 2023 02:36:11 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5C9tWVH0MImcPhRJ0Vhwuy6nW20iki7xLLJYc32dQFXLn8Ff1tbzhfEHR+S+UtdBEKQ4Ib X-Received: by 2002:a05:620a:3f0c:b0:75b:23a0:de86 with SMTP id tx12-20020a05620a3f0c00b0075b23a0de86mr7184882qkn.4.1685612171550; Thu, 01 Jun 2023 02:36:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685612171; cv=none; d=google.com; s=arc-20160816; b=DpKYMIsm2aXEp4TT4Ei0jkQNwlNaLIm4ilg/Ktx5tRp107mdmEi9VZJ/Hxs/Jv4akE sOh+K+DLMzPCW0PkUx/0l3fgDN7EUsjS4ToHWEeDQfl49nbhM4D6w7YDs4OifFxLG4wY JMfxRrK+zR0uDJhKwn0kM+/HvYsqek2U6AuC1swlPbRPLAZGvKxTny0w4GIscykN9pvm z9PtziwlkcY/703hq+MKIopbm04zS2pO2rRrFJr9OsexfgCKqq0BYztF+gWjmFRC1A9E SoilITlxOm4WJZjukVW/JwKnO4qtjTE0OlOUu3rxkMST6i6dbIsaLj7fk9tqhri46GWD wkYw== 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=iBmRFGSCUyWrpqUCkJ9/kvAcmY0X7VBtc3pe1bAu4Nw=; b=tjhegEWEA9QQOw36dA8zOvxSzJVWjDr234PLn7DmTTO9mdgMz2mk6eIury56Q7466E rUpUZKwuzdb23BbApPhJAlnYxkCPmHfv286OCT/Gkc/PRriJ4yRUdd8j1rf3QibytVKI 0w0/zZYJkDwX6XIeeDMrNDbsYAO10/1LGLnpHAfkV4cd8zheD0ICRtX2gqBYDa6OpvpG Eg2LIFLlR3FuGlu5m5EpT6GBoAYOnizDsLNGvZfX479lNtSsZzQIQf1nbZXmiWOMnA0O VmjwiNLdc/2hN/msf+TeUSVXjuRLV8eiDwWNFpAwIWkRe9etS8nS1xZxd6cMut1fb+xl zEXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=m+53Rqw4; 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 i7-20020a05620a144700b0075cceb751a3si6954246qkl.547.2023.06.01.02.36.11 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 01 Jun 2023 02:36:11 -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=m+53Rqw4; 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 1q4eiJ-0007iu-E7; Thu, 01 Jun 2023 05:35:23 -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 1q4eiF-0007hL-TJ for qemu-devel@nongnu.org; Thu, 01 Jun 2023 05:35:20 -0400 Received: from mail-lf1-x12a.google.com ([2a00:1450:4864:20::12a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q4ei0-0008Sy-5V for qemu-devel@nongnu.org; Thu, 01 Jun 2023 05:35:09 -0400 Received: by mail-lf1-x12a.google.com with SMTP id 2adb3069b0e04-4f3b9e54338so704596e87.0 for ; Thu, 01 Jun 2023 02:35:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1685612100; x=1688204100; 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=iBmRFGSCUyWrpqUCkJ9/kvAcmY0X7VBtc3pe1bAu4Nw=; b=m+53Rqw4BvkMKcWgY8ijZYQZ3MvEhO4yd3IBzpmQXtgmat8Fuijcn8ZNKPpJQyO2Gq hnDP6OQNh8fYfyAERrj1toGGmwNqkcH+wCrSBrd42VH5mOcu/Vdu+o0XRK7A4hNcGKMj IPCUt2is3km3TLvkvpkm4lGzDT8Zt0xNmxY2p5LZTPxptADt+xXkYnrWK/9YSCozNVwc W7USHT5gnm1ZZZvkd3g0HcmgKdckwmcPnyzv/L1da5lC4ambnmmDTI50z0MrV8PveJ2L YUl7HbEO3LWXKanfwJ+Vvx5R2BidfMjvOx7XOWj/mT1VdtapjSkwy/sedFUscRS0gQQ5 R0tQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685612100; x=1688204100; 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=iBmRFGSCUyWrpqUCkJ9/kvAcmY0X7VBtc3pe1bAu4Nw=; b=ejcVYuO8/53YLpmd5n3WHmG7VUNxG+h+7lt1Ef1h+vqvonJbmiyvChOgULULiBgDzN 43bj8VxWfEQevUUbZLZnoeXIhx6IeZ1iQOzsHr0pHCPlTvNd88yrXG9zN6q+5ZqChJJC irtr78Vgth9c9pNGWzB2dieDccD4tTX8V0OeFczUIZgvVFtcT0qruXcFTn8v5w72KW2p E0gK9aar8VL8gp4vIfw65sCjspkGDud2gx86DJLBsFf2O+vbWfG9dkJIQ1TsZKTyuy0+ 2SYmF3tsznvo0csn2EmJY1fQEzDQ923Vs2S8BDGbQFbUJhqF8KFs2+GIaq1/Kqb9T+Oq 6eRQ== X-Gm-Message-State: AC+VfDxCBaP27Uvz5xxllj1cWNYve+EMGUOVDEItoU/ZxyEFSbbL6AY0 t1U/OG4DeT7Z4qveM7xg7A5XXFwCn0uC9geC3tI= X-Received: by 2002:ac2:5505:0:b0:4f3:b221:558c with SMTP id j5-20020ac25505000000b004f3b221558cmr914245lfk.43.1685612099981; Thu, 01 Jun 2023 02:34:59 -0700 (PDT) Received: from localhost.localdomain ([176.176.141.224]) by smtp.gmail.com with ESMTPSA id n16-20020a1c7210000000b003f60119ee08sm1658709wmc.43.2023.06.01.02.34.58 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 01 Jun 2023 02:34:59 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Markus Armbruster , Eduardo Habkost Cc: qemu-riscv@nongnu.org, qemu-ppc@nongnu.org, qemu-arm@nongnu.org, Thomas Huth , qemu-block@nongnu.org, =?utf-8?q?Philippe_M?= =?utf-8?q?athieu-Daud=C3=A9?= Subject: [PATCH 1/2] scripts: Add qom-cast-macro-clean-cocci-gen.py Date: Thu, 1 Jun 2023 11:34:51 +0200 Message-Id: <20230601093452.38972-2-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230601093452.38972-1-philmd@linaro.org> References: <20230601093452.38972-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::12a; envelope-from=philmd@linaro.org; helo=mail-lf1-x12a.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 Add a script to generate Coccinelle semantic patch removing all pointless QOM cast macro uses. Suggested-by: Markus Armbruster Signed-off-by: Philippe Mathieu-Daudé --- MAINTAINERS | 1 + scripts/qom-cast-macro-clean-cocci-gen.py | 49 +++++++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 scripts/qom-cast-macro-clean-cocci-gen.py diff --git a/MAINTAINERS b/MAINTAINERS index 4b025a7b63..37a2412011 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -3044,6 +3044,7 @@ F: include/qom/ F: qapi/qom.json F: qapi/qdev.json F: scripts/coccinelle/qom-parent-type.cocci +F: scripts/qom-cast-macro-clean-cocci-gen.py F: softmmu/qdev-monitor.c F: stubs/qdev.c F: qom/ diff --git a/scripts/qom-cast-macro-clean-cocci-gen.py b/scripts/qom-cast-macro-clean-cocci-gen.py new file mode 100644 index 0000000000..2fa8438a14 --- /dev/null +++ b/scripts/qom-cast-macro-clean-cocci-gen.py @@ -0,0 +1,49 @@ +#!/usr/bin/env python3 +# +# Generate a Coccinelle semantic patch to remove pointless QOM cast. +# +# Usage: +# +# $ qom-cast-macro-clean-cocci-gen.py $(git ls-files) > qom_pointless_cast.cocci +# $ spatch \ +# --macro-file scripts/cocci-macro-file.h \ +# --sp-file qom_pointless_cast.cocci \ +# --keep-comments \ +# --use-gitgrep \ +# --in-place \ +# --dir . +# +# SPDX-FileContributor: Philippe Mathieu-Daudé +# SPDX-FileCopyrightText: 2023 Linaro Ltd. +# SPDX-License-Identifier: GPL-2.0-or-later + +import re +import sys + +assert len(sys.argv) > 0 + +def print_cocci_rule(qom_typedef, qom_cast_macro): + print(f'''@@ +typedef {qom_typedef}; +{qom_typedef} *obj; +@@ +- {qom_cast_macro}(obj) ++ obj +''') + +patterns = [ + r'DECLARE_INSTANCE_CHECKER\((\w+),\W*(\w+),\W*TYPE_\w+\)', + r'DECLARE_OBJ_CHECKERS\((\w+),\W*\w+,\W*(\w+),\W*TYPE_\w+\)', + r'OBJECT_DECLARE_TYPE\((\w+),\W*\w+,\W*(\w+)\)', + r'OBJECT_DECLARE_SIMPLE_TYPE\((\w+),\W*(\w+)\)', + r'INTERFACE_CHECK\((\w+),\W*\(\w+\),\W*TYPE_(\w+)\)', +] + +for fn in sys.argv[1:]: + try: + content = open(fn, 'rt').read() + except: + continue + for pattern in patterns: + for match in re.findall(pattern, content): + print_cocci_rule(match[0], match[1]) From patchwork Thu Jun 1 09:34:52 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: 687694 Delivered-To: patch@linaro.org Received: by 2002:a5d:4d8a:0:0:0:0:0 with SMTP id b10csp235379wru; Thu, 1 Jun 2023 02:36:43 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5S4MbRFZtIggu9x5PKBKp9AfSmS9XD4bTPKYHQX2O580aJPj5ihXcWsxR6huY2qBo27XQW X-Received: by 2002:ac8:5783:0:b0:3f6:b055:81fe with SMTP id v3-20020ac85783000000b003f6b05581femr8962457qta.60.1685612203391; Thu, 01 Jun 2023 02:36:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685612203; cv=none; d=google.com; s=arc-20160816; b=w6ZTmbh+/PKndxki7bNvNtYKRuCi2UNM9xEyMD11mDe2D/oxbHFCiPTnX+1DhYUbr9 w59I0uCuKRPHpss3vAM98SdIIHU9zRcHLGKoVat4Es6pfrBl2T0l0A81YIheNKRvEd12 M6EiEAYM+48sJrjQs5ryKIkNsfYbTiWDiqNfL0+DzBSTifWNUfra+m6L9hLQOUpOC1qt M7AlMARdBabLMgzfLIm7Ah26zjE/BkBnhXkh1zHciGXFStDOrsWbj2WsifC8zGVtrsCO y8WN8dW2o0tEoO8NbUHiWp9ielwlYwK5lhrjh2yWzcsA9Ke3jZzsw5SAfIRBa9M+1N6q gQRQ== 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=TdXkShqXWPbWzEZ0sD1ST7mNiLXOQxbG4dnB48iOt9Y=; b=SqC0O+VuFmZVrQWXraafiBGtuh9JkMo3h2WcX1fAfrwhs7DIl+IFB10cuvUhkqtVM+ GdATiDYeTkbaOuq7B6QEBWW7yMdsPqwfpMG11Lx83vL2Z8Hp25Y4mKBHfwUInc5wqHtS 5d15bvsrxZI0/WFmaid6R30RgQiHlLpny/CCvmuQBGY6cQ3JwyFIfnx6SsWaGvzZbwbg +oegqll4fqGR9ozpneCR8ovMOOeYRb/63yP78GJVk0QLK9dGdQKIAYgZaDyyseHKKHdp GXaUie2LNPz1R4kWMCRBZIz5Su7NtSqBNHdbrBGEaLN14/VbYdX2ZidH2YzIWtuHdCyH j7bw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ofFVUJM8; 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 14-20020ac8594e000000b003f518050347si9567453qtz.480.2023.06.01.02.36.43 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 01 Jun 2023 02:36:43 -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=ofFVUJM8; 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 1q4eiL-0007lW-MF; Thu, 01 Jun 2023 05:35:25 -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 1q4eiJ-0007jI-UU for qemu-devel@nongnu.org; Thu, 01 Jun 2023 05:35:23 -0400 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q4eiF-0000GH-JG for qemu-devel@nongnu.org; Thu, 01 Jun 2023 05:35:23 -0400 Received: by mail-wr1-x42b.google.com with SMTP id ffacd0b85a97d-30ae69ef78aso1504977f8f.1 for ; Thu, 01 Jun 2023 02:35:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1685612106; x=1688204106; 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=TdXkShqXWPbWzEZ0sD1ST7mNiLXOQxbG4dnB48iOt9Y=; b=ofFVUJM8Gprwb2GehV3ZgIqY+5QwlzSMP+jR+PaSFiwTTXTRNoYANiqH6fTKmAe6Cf fX6SNBC2ZZa9+T3WQsHCKVQeo6T5cHOWLz3BhSveo/l9k0MFjLpUDaTgt2TbKnbu77lf 4ORin8Xayfmeedfw70lk8RzKygNd2PPelXK5CQhFp4oPI8HPo4U3K3EilwgTPIC0hWRY oxqvb36St8OvE6Jl65vjszOefUnny4kgaDqwZ+Ra0qH2WVrhVQT30YU+JphAIExM6pt1 JRjpyGnIzjKEj/k6GvPkEcFxfxhoV/eVSStbo2RMng+FJpnT213kx8mUBHJCDLUjrfA6 /mWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685612106; x=1688204106; 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=TdXkShqXWPbWzEZ0sD1ST7mNiLXOQxbG4dnB48iOt9Y=; b=RAR5PgaYJauN6B8GFP/OKaADuGwT6aiwOHgCAKZMpl/PvKrCOgjsR40OcCG46CS2Zh t6BAq5MZTtZWM+Rv1KAjDbM2vd4ma89tG/wfLPvLc0nt201gnozMPWxuwf0w2y++w77d Z5TQDZwZKFR9YF4Z5AUoGPqwV3iUj4UZxiE+7BubUkai4pKt1QcJdWkDploliuXfgJd4 Jai/HLxxd9KTACO9lWiSQKs10qooZEHfVVNNE7XhissoeICQUHxRu1yDFm10TJwsfCRD NLE/v2Dmqv1REakAlhE5VOPm42P4HFm5xcgZu9RCseScoh2+tWqLGVDT/UcOfGjtJSLh M6Vw== X-Gm-Message-State: AC+VfDz84MtXL5zmby405EZwVXbjwjyynxGgJtE7Ww3y5JQOz8pImJaU l/nIiFcHhxJJ3+JOs08o2TXWtm78Xu9fjZiM22Y= X-Received: by 2002:adf:dc91:0:b0:307:7d1a:20fd with SMTP id r17-20020adfdc91000000b003077d1a20fdmr1052138wrj.12.1685612105716; Thu, 01 Jun 2023 02:35:05 -0700 (PDT) Received: from localhost.localdomain ([176.176.141.224]) by smtp.gmail.com with ESMTPSA id o11-20020adfeacb000000b0030ae7bd1737sm9714903wrn.45.2023.06.01.02.35.04 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 01 Jun 2023 02:35:05 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Markus Armbruster , Eduardo Habkost Cc: qemu-riscv@nongnu.org, qemu-ppc@nongnu.org, qemu-arm@nongnu.org, Thomas Huth , qemu-block@nongnu.org, =?utf-8?q?Philippe_M?= =?utf-8?q?athieu-Daud=C3=A9?= Subject: [PATCH 2/2] bulk: Remove pointless QOM casts Date: Thu, 1 Jun 2023 11:34:52 +0200 Message-Id: <20230601093452.38972-3-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230601093452.38972-1-philmd@linaro.org> References: <20230601093452.38972-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42b; envelope-from=philmd@linaro.org; helo=mail-wr1-x42b.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 Mechanical change running Coccinelle spatch with content generated from the qom-cast-macro-clean-cocci-gen.py added in the previous commit. Suggested-by: Markus Armbruster Signed-off-by: Philippe Mathieu-Daudé --- block/nbd.c | 4 ++-- chardev/char-pty.c | 2 +- hw/arm/musicpal.c | 2 +- hw/arm/xlnx-versal.c | 2 +- hw/display/vhost-user-gpu.c | 4 ++-- hw/intc/loongarch_extioi.c | 6 +++--- hw/m68k/q800.c | 2 +- hw/pci-host/bonito.c | 2 +- hw/ppc/pnv_lpc.c | 2 +- hw/ppc/pnv_occ.c | 2 +- hw/ppc/pnv_sbe.c | 2 +- hw/riscv/virt.c | 10 +++++----- hw/rx/rx62n.c | 2 +- hw/scsi/esp-pci.c | 18 +++++++++--------- hw/sparc/sun4m.c | 4 ++-- hw/virtio/virtio-mem-pci.c | 6 +++--- hw/virtio/virtio-pmem-pci.c | 6 +++--- migration/fd.c | 4 ++-- migration/multifd.c | 2 +- migration/yank_functions.c | 4 ++-- nbd/client-connection.c | 2 +- nbd/server.c | 2 +- softmmu/qdev-monitor.c | 2 +- ui/vnc-ws.c | 6 +++--- 24 files changed, 49 insertions(+), 49 deletions(-) diff --git a/block/nbd.c b/block/nbd.c index a3f8f8a9d5..5aef5cb6bd 100644 --- a/block/nbd.c +++ b/block/nbd.c @@ -397,7 +397,7 @@ static void coroutine_fn GRAPH_RDLOCK nbd_reconnect_attempt(BDRVNBDState *s) /* Finalize previous connection if any */ if (s->ioc) { - qio_channel_detach_aio_context(QIO_CHANNEL(s->ioc)); + qio_channel_detach_aio_context(s->ioc); yank_unregister_function(BLOCKDEV_YANK_INSTANCE(s->bs->node_name), nbd_yank, s->bs); object_unref(OBJECT(s->ioc)); @@ -1455,7 +1455,7 @@ static void nbd_yank(void *opaque) BDRVNBDState *s = (BDRVNBDState *)bs->opaque; QEMU_LOCK_GUARD(&s->requests_lock); - qio_channel_shutdown(QIO_CHANNEL(s->ioc), QIO_CHANNEL_SHUTDOWN_BOTH, NULL); + qio_channel_shutdown(s->ioc, QIO_CHANNEL_SHUTDOWN_BOTH, NULL); s->state = NBD_CLIENT_QUIT; } diff --git a/chardev/char-pty.c b/chardev/char-pty.c index 92fd33c854..4e5deac18a 100644 --- a/chardev/char-pty.c +++ b/chardev/char-pty.c @@ -334,7 +334,7 @@ static void char_pty_open(Chardev *chr, s = PTY_CHARDEV(chr); s->ioc = QIO_CHANNEL(qio_channel_file_new_fd(master_fd)); name = g_strdup_printf("chardev-pty-%s", chr->label); - qio_channel_set_name(QIO_CHANNEL(s->ioc), name); + qio_channel_set_name(s->ioc, name); g_free(name); s->timer_src = NULL; *be_opened = false; diff --git a/hw/arm/musicpal.c b/hw/arm/musicpal.c index 58f3d30c9b..dc4e43e0ee 100644 --- a/hw/arm/musicpal.c +++ b/hw/arm/musicpal.c @@ -1250,7 +1250,7 @@ static void musicpal_init(MachineState *machine) uart_orgate = DEVICE(object_new(TYPE_OR_IRQ)); object_property_set_int(OBJECT(uart_orgate), "num-lines", 2, &error_fatal); qdev_realize_and_unref(uart_orgate, NULL, &error_fatal); - qdev_connect_gpio_out(DEVICE(uart_orgate), 0, + qdev_connect_gpio_out(uart_orgate, 0, qdev_get_gpio_in(pic, MP_UART_SHARED_IRQ)); serial_mm_init(address_space_mem, MP_UART1_BASE, 2, diff --git a/hw/arm/xlnx-versal.c b/hw/arm/xlnx-versal.c index 69b1b99e93..db1e0dee6e 100644 --- a/hw/arm/xlnx-versal.c +++ b/hw/arm/xlnx-versal.c @@ -327,7 +327,7 @@ static void versal_create_rtc(Versal *s, qemu_irq *pic) object_initialize_child(OBJECT(s), "rtc", &s->pmc.rtc, TYPE_XLNX_ZYNQMP_RTC); sbd = SYS_BUS_DEVICE(&s->pmc.rtc); - sysbus_realize(SYS_BUS_DEVICE(sbd), &error_fatal); + sysbus_realize(sbd, &error_fatal); mr = sysbus_mmio_get_region(sbd, 0); memory_region_add_subregion(&s->mr_ps, MM_PMC_RTC, mr); diff --git a/hw/display/vhost-user-gpu.c b/hw/display/vhost-user-gpu.c index 71dfd956b8..1386e869e5 100644 --- a/hw/display/vhost-user-gpu.c +++ b/hw/display/vhost-user-gpu.c @@ -364,11 +364,11 @@ vhost_user_gpu_gl_flushed(VirtIOGPUBase *b) VhostUserGPU *g = VHOST_USER_GPU(b); if (g->backend_blocked) { - vhost_user_gpu_unblock(VHOST_USER_GPU(g)); + vhost_user_gpu_unblock(g); g->backend_blocked = false; } - vhost_user_gpu_update_blocked(VHOST_USER_GPU(g), false); + vhost_user_gpu_update_blocked(g, false); } static bool diff --git a/hw/intc/loongarch_extioi.c b/hw/intc/loongarch_extioi.c index 0e7a3e32f3..af75460643 100644 --- a/hw/intc/loongarch_extioi.c +++ b/hw/intc/loongarch_extioi.c @@ -276,7 +276,7 @@ static void loongarch_extioi_instance_init(Object *obj) int i, cpu, pin; for (i = 0; i < EXTIOI_IRQS; i++) { - sysbus_init_irq(SYS_BUS_DEVICE(dev), &s->irq[i]); + sysbus_init_irq(dev, &s->irq[i]); } qdev_init_gpio_in(DEVICE(obj), extioi_setirq, EXTIOI_IRQS); @@ -284,14 +284,14 @@ static void loongarch_extioi_instance_init(Object *obj) for (cpu = 0; cpu < EXTIOI_CPUS; cpu++) { memory_region_init_io(&s->extioi_iocsr_mem[cpu], OBJECT(s), &extioi_ops, s, "extioi_iocsr", 0x900); - sysbus_init_mmio(SYS_BUS_DEVICE(dev), &s->extioi_iocsr_mem[cpu]); + sysbus_init_mmio(dev, &s->extioi_iocsr_mem[cpu]); for (pin = 0; pin < LS3A_INTC_IP; pin++) { qdev_init_gpio_out(DEVICE(obj), &s->parent_irq[cpu][pin], 1); } } memory_region_init_io(&s->extioi_system_mem, OBJECT(s), &extioi_ops, s, "extioi_system_mem", 0x900); - sysbus_init_mmio(SYS_BUS_DEVICE(dev), &s->extioi_system_mem); + sysbus_init_mmio(dev, &s->extioi_system_mem); } static void loongarch_extioi_class_init(ObjectClass *klass, void *data) diff --git a/hw/m68k/q800.c b/hw/m68k/q800.c index b35ecafbc7..68f0cd8cac 100644 --- a/hw/m68k/q800.c +++ b/hw/m68k/q800.c @@ -525,7 +525,7 @@ static void q800_init(MachineState *machine) qdev_realize_and_unref(escc_orgate, NULL, &error_fatal); sysbus_connect_irq(sysbus, 0, qdev_get_gpio_in(escc_orgate, 0)); sysbus_connect_irq(sysbus, 1, qdev_get_gpio_in(escc_orgate, 1)); - qdev_connect_gpio_out(DEVICE(escc_orgate), 0, + qdev_connect_gpio_out(escc_orgate, 0, qdev_get_gpio_in(glue, GLUE_IRQ_IN_ESCC)); sysbus_mmio_map(sysbus, 0, SCC_BASE); diff --git a/hw/pci-host/bonito.c b/hw/pci-host/bonito.c index 1cf25bab8d..4701481b9b 100644 --- a/hw/pci-host/bonito.c +++ b/hw/pci-host/bonito.c @@ -656,7 +656,7 @@ static void bonito_pci_realize(PCIDevice *dev, Error **errp) PCIBonitoState *s = PCI_BONITO(dev); SysBusDevice *sysbus = SYS_BUS_DEVICE(s->pcihost); PCIHostState *phb = PCI_HOST_BRIDGE(s->pcihost); - BonitoState *bs = BONITO_PCI_HOST_BRIDGE(s->pcihost); + BonitoState *bs = s->pcihost; MemoryRegion *pcimem_alias = g_new(MemoryRegion, 1); /* diff --git a/hw/ppc/pnv_lpc.c b/hw/ppc/pnv_lpc.c index 605d390861..d692858bee 100644 --- a/hw/ppc/pnv_lpc.c +++ b/hw/ppc/pnv_lpc.c @@ -744,7 +744,7 @@ static void pnv_lpc_realize(DeviceState *dev, Error **errp) memory_region_add_subregion(&lpc->opb_mr, LPC_HC_REGS_OPB_ADDR, &lpc->lpc_hc_regs); - qdev_init_gpio_out(DEVICE(dev), &lpc->psi_irq, 1); + qdev_init_gpio_out(dev, &lpc->psi_irq, 1); } static void pnv_lpc_class_init(ObjectClass *klass, void *data) diff --git a/hw/ppc/pnv_occ.c b/hw/ppc/pnv_occ.c index 9fa6d91d31..48123ceae1 100644 --- a/hw/ppc/pnv_occ.c +++ b/hw/ppc/pnv_occ.c @@ -278,7 +278,7 @@ static void pnv_occ_realize(DeviceState *dev, Error **errp) occ, "occ-common-area", PNV_OCC_SENSOR_DATA_BLOCK_SIZE); - qdev_init_gpio_out(DEVICE(dev), &occ->psi_irq, 1); + qdev_init_gpio_out(dev, &occ->psi_irq, 1); } static void pnv_occ_class_init(ObjectClass *klass, void *data) diff --git a/hw/ppc/pnv_sbe.c b/hw/ppc/pnv_sbe.c index 1c7812a135..74cee4eea7 100644 --- a/hw/ppc/pnv_sbe.c +++ b/hw/ppc/pnv_sbe.c @@ -381,7 +381,7 @@ static void pnv_sbe_realize(DeviceState *dev, Error **errp) psc->xscom_mbox_ops, sbe, "xscom-sbe-mbox", psc->xscom_mbox_size); - qdev_init_gpio_out(DEVICE(dev), &sbe->psi_irq, 1); + qdev_init_gpio_out(dev, &sbe->psi_irq, 1); sbe->timer = timer_new_us(QEMU_CLOCK_VIRTUAL, sbe_timer, sbe); } diff --git a/hw/riscv/virt.c b/hw/riscv/virt.c index 4e3efbee16..245c7b97b2 100644 --- a/hw/riscv/virt.c +++ b/hw/riscv/virt.c @@ -1488,7 +1488,7 @@ static void virt_machine_init(MachineState *machine) for (i = 0; i < VIRTIO_COUNT; i++) { sysbus_create_simple("virtio-mmio", memmap[VIRT_VIRTIO].base + i * memmap[VIRT_VIRTIO].size, - qdev_get_gpio_in(DEVICE(virtio_irqchip), VIRTIO_IRQ + i)); + qdev_get_gpio_in(virtio_irqchip, VIRTIO_IRQ + i)); } gpex_pcie_init(system_memory, @@ -1499,16 +1499,16 @@ static void virt_machine_init(MachineState *machine) virt_high_pcie_memmap.base, virt_high_pcie_memmap.size, memmap[VIRT_PCIE_PIO].base, - DEVICE(pcie_irqchip)); + pcie_irqchip); - create_platform_bus(s, DEVICE(mmio_irqchip)); + create_platform_bus(s, mmio_irqchip); serial_mm_init(system_memory, memmap[VIRT_UART0].base, - 0, qdev_get_gpio_in(DEVICE(mmio_irqchip), UART0_IRQ), 399193, + 0, qdev_get_gpio_in(mmio_irqchip, UART0_IRQ), 399193, serial_hd(0), DEVICE_LITTLE_ENDIAN); sysbus_create_simple("goldfish_rtc", memmap[VIRT_RTC].base, - qdev_get_gpio_in(DEVICE(mmio_irqchip), RTC_IRQ)); + qdev_get_gpio_in(mmio_irqchip, RTC_IRQ)); virt_flash_create(s); diff --git a/hw/rx/rx62n.c b/hw/rx/rx62n.c index fa5add9f9d..3e887a0fc7 100644 --- a/hw/rx/rx62n.c +++ b/hw/rx/rx62n.c @@ -154,7 +154,7 @@ static void register_icu(RX62NState *s) sysbus_connect_irq(icu, 0, qdev_get_gpio_in(DEVICE(&s->cpu), RX_CPU_IRQ)); sysbus_connect_irq(icu, 1, qdev_get_gpio_in(DEVICE(&s->cpu), RX_CPU_FIR)); sysbus_connect_irq(icu, 2, s->irq[SWI]); - sysbus_mmio_map(SYS_BUS_DEVICE(icu), 0, RX62N_ICU_BASE); + sysbus_mmio_map(icu, 0, RX62N_ICU_BASE); } static void register_tmr(RX62NState *s, int unit) diff --git a/hw/scsi/esp-pci.c b/hw/scsi/esp-pci.c index 2f7f11e70b..4e890db0e2 100644 --- a/hw/scsi/esp-pci.c +++ b/hw/scsi/esp-pci.c @@ -79,7 +79,7 @@ struct PCIESPState { static void esp_pci_handle_idle(PCIESPState *pci, uint32_t val) { - ESPState *s = ESP(&pci->esp); + ESPState *s = &pci->esp; trace_esp_pci_dma_idle(val); esp_dma_enable(s, 0, 0); @@ -93,7 +93,7 @@ static void esp_pci_handle_blast(PCIESPState *pci, uint32_t val) static void esp_pci_handle_abort(PCIESPState *pci, uint32_t val) { - ESPState *s = ESP(&pci->esp); + ESPState *s = &pci->esp; trace_esp_pci_dma_abort(val); if (s->current_req) { @@ -103,7 +103,7 @@ static void esp_pci_handle_abort(PCIESPState *pci, uint32_t val) static void esp_pci_handle_start(PCIESPState *pci, uint32_t val) { - ESPState *s = ESP(&pci->esp); + ESPState *s = &pci->esp; trace_esp_pci_dma_start(val); @@ -161,7 +161,7 @@ static void esp_pci_dma_write(PCIESPState *pci, uint32_t saddr, uint32_t val) static uint32_t esp_pci_dma_read(PCIESPState *pci, uint32_t saddr) { - ESPState *s = ESP(&pci->esp); + ESPState *s = &pci->esp; uint32_t val; val = pci->dma_regs[saddr]; @@ -183,7 +183,7 @@ static void esp_pci_io_write(void *opaque, hwaddr addr, uint64_t val, unsigned int size) { PCIESPState *pci = opaque; - ESPState *s = ESP(&pci->esp); + ESPState *s = &pci->esp; if (size < 4 || addr & 3) { /* need to upgrade request: we only support 4-bytes accesses */ @@ -228,7 +228,7 @@ static uint64_t esp_pci_io_read(void *opaque, hwaddr addr, unsigned int size) { PCIESPState *pci = opaque; - ESPState *s = ESP(&pci->esp); + ESPState *s = &pci->esp; uint32_t ret; if (addr < 0x40) { @@ -315,7 +315,7 @@ static const MemoryRegionOps esp_pci_io_ops = { static void esp_pci_hard_reset(DeviceState *dev) { PCIESPState *pci = PCI_ESP(dev); - ESPState *s = ESP(&pci->esp); + ESPState *s = &pci->esp; esp_hard_reset(s); pci->dma_regs[DMA_CMD] &= ~(DMA_CMD_DIR | DMA_CMD_INTE_D | DMA_CMD_INTE_P @@ -366,7 +366,7 @@ static void esp_pci_scsi_realize(PCIDevice *dev, Error **errp) { PCIESPState *pci = PCI_ESP(dev); DeviceState *d = DEVICE(dev); - ESPState *s = ESP(&pci->esp); + ESPState *s = &pci->esp; uint8_t *pci_conf; if (!qdev_realize(DEVICE(s), NULL, errp)) { @@ -394,7 +394,7 @@ static void esp_pci_scsi_realize(PCIDevice *dev, Error **errp) static void esp_pci_scsi_exit(PCIDevice *d) { PCIESPState *pci = PCI_ESP(d); - ESPState *s = ESP(&pci->esp); + ESPState *s = &pci->esp; qemu_free_irq(s->irq); } diff --git a/hw/sparc/sun4m.c b/hw/sparc/sun4m.c index d9288326d6..17bf5f2879 100644 --- a/hw/sparc/sun4m.c +++ b/hw/sparc/sun4m.c @@ -982,7 +982,7 @@ static void sun4m_hw_init(MachineState *machine) qdev_realize_and_unref(ms_kb_orgate, NULL, &error_fatal); sysbus_connect_irq(s, 0, qdev_get_gpio_in(ms_kb_orgate, 0)); sysbus_connect_irq(s, 1, qdev_get_gpio_in(ms_kb_orgate, 1)); - qdev_connect_gpio_out(DEVICE(ms_kb_orgate), 0, slavio_irq[14]); + qdev_connect_gpio_out(ms_kb_orgate, 0, slavio_irq[14]); dev = qdev_new(TYPE_ESCC); qdev_prop_set_uint32(dev, "disabled", 0); @@ -1004,7 +1004,7 @@ static void sun4m_hw_init(MachineState *machine) qdev_realize_and_unref(serial_orgate, NULL, &error_fatal); sysbus_connect_irq(s, 0, qdev_get_gpio_in(serial_orgate, 0)); sysbus_connect_irq(s, 1, qdev_get_gpio_in(serial_orgate, 1)); - qdev_connect_gpio_out(DEVICE(serial_orgate), 0, slavio_irq[15]); + qdev_connect_gpio_out(serial_orgate, 0, slavio_irq[15]); if (hwdef->apc_base) { apc_init(hwdef->apc_base, qemu_allocate_irq(cpu_halt_signal, NULL, 0)); diff --git a/hw/virtio/virtio-mem-pci.c b/hw/virtio/virtio-mem-pci.c index e8c338c5d9..b85c12668d 100644 --- a/hw/virtio/virtio-mem-pci.c +++ b/hw/virtio/virtio-mem-pci.c @@ -42,7 +42,7 @@ static MemoryRegion *virtio_mem_pci_get_memory_region(MemoryDeviceState *md, Error **errp) { VirtIOMEMPCI *pci_mem = VIRTIO_MEM_PCI(md); - VirtIOMEM *vmem = VIRTIO_MEM(&pci_mem->vdev); + VirtIOMEM *vmem = &pci_mem->vdev; VirtIOMEMClass *vmc = VIRTIO_MEM_GET_CLASS(vmem); return vmc->get_memory_region(vmem, errp); @@ -60,7 +60,7 @@ static void virtio_mem_pci_fill_device_info(const MemoryDeviceState *md, { VirtioMEMDeviceInfo *vi = g_new0(VirtioMEMDeviceInfo, 1); VirtIOMEMPCI *pci_mem = VIRTIO_MEM_PCI(md); - VirtIOMEM *vmem = VIRTIO_MEM(&pci_mem->vdev); + VirtIOMEM *vmem = &pci_mem->vdev; VirtIOMEMClass *vpc = VIRTIO_MEM_GET_CLASS(vmem); DeviceState *dev = DEVICE(md); @@ -123,7 +123,7 @@ static void virtio_mem_pci_instance_init(Object *obj) TYPE_VIRTIO_MEM); dev->size_change_notifier.notify = virtio_mem_pci_size_change_notify; - vmem = VIRTIO_MEM(&dev->vdev); + vmem = &dev->vdev; vmc = VIRTIO_MEM_GET_CLASS(vmem); /* * We never remove the notifier again, as we expect both devices to diff --git a/hw/virtio/virtio-pmem-pci.c b/hw/virtio/virtio-pmem-pci.c index 1b89ade9d1..197d219204 100644 --- a/hw/virtio/virtio-pmem-pci.c +++ b/hw/virtio/virtio-pmem-pci.c @@ -42,7 +42,7 @@ static MemoryRegion *virtio_pmem_pci_get_memory_region(MemoryDeviceState *md, Error **errp) { VirtIOPMEMPCI *pci_pmem = VIRTIO_PMEM_PCI(md); - VirtIOPMEM *pmem = VIRTIO_PMEM(&pci_pmem->vdev); + VirtIOPMEM *pmem = &pci_pmem->vdev; VirtIOPMEMClass *vpc = VIRTIO_PMEM_GET_CLASS(pmem); return vpc->get_memory_region(pmem, errp); @@ -52,7 +52,7 @@ static uint64_t virtio_pmem_pci_get_plugged_size(const MemoryDeviceState *md, Error **errp) { VirtIOPMEMPCI *pci_pmem = VIRTIO_PMEM_PCI(md); - VirtIOPMEM *pmem = VIRTIO_PMEM(&pci_pmem->vdev); + VirtIOPMEM *pmem = &pci_pmem->vdev; VirtIOPMEMClass *vpc = VIRTIO_PMEM_GET_CLASS(pmem); MemoryRegion *mr = vpc->get_memory_region(pmem, errp); @@ -65,7 +65,7 @@ static void virtio_pmem_pci_fill_device_info(const MemoryDeviceState *md, { VirtioPMEMDeviceInfo *vi = g_new0(VirtioPMEMDeviceInfo, 1); VirtIOPMEMPCI *pci_pmem = VIRTIO_PMEM_PCI(md); - VirtIOPMEM *pmem = VIRTIO_PMEM(&pci_pmem->vdev); + VirtIOPMEM *pmem = &pci_pmem->vdev; VirtIOPMEMClass *vpc = VIRTIO_PMEM_GET_CLASS(pmem); DeviceState *dev = DEVICE(md); diff --git a/migration/fd.c b/migration/fd.c index 6f2f50475f..0eb677dcae 100644 --- a/migration/fd.c +++ b/migration/fd.c @@ -38,7 +38,7 @@ void fd_start_outgoing_migration(MigrationState *s, const char *fdname, Error ** return; } - qio_channel_set_name(QIO_CHANNEL(ioc), "migration-fd-outgoing"); + qio_channel_set_name(ioc, "migration-fd-outgoing"); migration_channel_connect(s, ioc, NULL, NULL); object_unref(OBJECT(ioc)); } @@ -68,7 +68,7 @@ void fd_start_incoming_migration(const char *fdname, Error **errp) return; } - qio_channel_set_name(QIO_CHANNEL(ioc), "migration-fd-incoming"); + qio_channel_set_name(ioc, "migration-fd-incoming"); qio_channel_add_watch_full(ioc, G_IO_IN, fd_accept_incoming_migration, NULL, NULL, diff --git a/migration/multifd.c b/migration/multifd.c index 0bf5958a9c..3387d8277f 100644 --- a/migration/multifd.c +++ b/migration/multifd.c @@ -894,7 +894,7 @@ static void multifd_new_send_channel_async(QIOTask *task, gpointer opaque) trace_multifd_new_send_channel_async(p->id); if (!qio_task_propagate_error(task, &local_err)) { - p->c = QIO_CHANNEL(sioc); + p->c = sioc; qio_channel_set_delay(p->c, false); p->running = true; if (multifd_channel_connect(p, sioc, local_err)) { diff --git a/migration/yank_functions.c b/migration/yank_functions.c index 8c08aef14a..d5a710a3f2 100644 --- a/migration/yank_functions.c +++ b/migration/yank_functions.c @@ -35,7 +35,7 @@ void migration_ioc_register_yank(QIOChannel *ioc) if (migration_ioc_yank_supported(ioc)) { yank_register_function(MIGRATION_YANK_INSTANCE, migration_yank_iochannel, - QIO_CHANNEL(ioc)); + ioc); } } @@ -44,7 +44,7 @@ void migration_ioc_unregister_yank(QIOChannel *ioc) if (migration_ioc_yank_supported(ioc)) { yank_unregister_function(MIGRATION_YANK_INSTANCE, migration_yank_iochannel, - QIO_CHANNEL(ioc)); + ioc); } } diff --git a/nbd/client-connection.c b/nbd/client-connection.c index e5b1046a1c..3d14296c04 100644 --- a/nbd/client-connection.c +++ b/nbd/client-connection.c @@ -156,7 +156,7 @@ static int nbd_connect(QIOChannelSocket *sioc, SocketAddress *addr, * channel. */ if (outioc && *outioc) { - qio_channel_close(QIO_CHANNEL(*outioc), NULL); + qio_channel_close(*outioc, NULL); object_unref(OBJECT(*outioc)); *outioc = NULL; } else { diff --git a/nbd/server.c b/nbd/server.c index 2664d43bff..febe001a39 100644 --- a/nbd/server.c +++ b/nbd/server.c @@ -1189,7 +1189,7 @@ static int nbd_negotiate_options(NBDClient *client, Error **errp) } ret = 0; object_unref(OBJECT(client->ioc)); - client->ioc = QIO_CHANNEL(tioc); + client->ioc = tioc; break; case NBD_OPT_EXPORT_NAME: diff --git a/softmmu/qdev-monitor.c b/softmmu/qdev-monitor.c index b8d2c4dadd..74f4e41338 100644 --- a/softmmu/qdev-monitor.c +++ b/softmmu/qdev-monitor.c @@ -711,7 +711,7 @@ DeviceState *qdev_device_add_from_qdict(const QDict *opts, goto err_del_dev; } - if (!qdev_realize(DEVICE(dev), bus, errp)) { + if (!qdev_realize(dev, bus, errp)) { goto err_del_dev; } return dev; diff --git a/ui/vnc-ws.c b/ui/vnc-ws.c index 6d79f3e5a5..9e3503d93d 100644 --- a/ui/vnc-ws.c +++ b/ui/vnc-ws.c @@ -40,9 +40,9 @@ static void vncws_tls_handshake_done(QIOTask *task, if (vs->ioc_tag) { g_source_remove(vs->ioc_tag); } - vs->ioc_tag = qio_channel_add_watch( - QIO_CHANNEL(vs->ioc), G_IO_IN | G_IO_HUP | G_IO_ERR, - vncws_handshake_io, vs, NULL); + vs->ioc_tag = qio_channel_add_watch(vs->ioc, + G_IO_IN | G_IO_HUP | G_IO_ERR, + vncws_handshake_io, vs, NULL); } }