From nobody Tue Nov 11 00:18:16 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1559819391; cv=none; d=zoho.com; s=zohoarc; b=lUDzBs1BWxYZikgPDG1uMzXcDb76ueQPzU5MSentOfN+OpxDjF3vqAIINt5+4zqWlaOnwlIsMqXksBDTf6GPAoZfLY2PfQLBUbEzKiw6RwaUSoIhhH4gXs9spE2HMHzAfXxb5OdNgUVVDgs0ubfj4IODTD6/OWTk0z0zw4tjM8E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1559819391; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=Xe3BYpTJWoJyptmvFPpfpPQxxU0ROkIJdJNCCAKIb8I=; b=axEcCWhPuLwjVtbVQU+Ppmx0SYMlM74SCkWYqSwX3vqjd+g+JKeDRuZSQ++3jrD6h2UrvQcePEvoLh6U7tB3wMjRbSL8hJneA/+b1T50HbRNyTwROEeN+l6fSrjFZQrti2+QZyXbnn9gL6LLW3d6w9/yusRrdhxsKXLpOLjPg6g= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (209.51.188.17 [209.51.188.17]) by mx.zohomail.com with SMTPS id 1559819391125471.86376632572285; Thu, 6 Jun 2019 04:09:51 -0700 (PDT) Received: from localhost ([127.0.0.1]:58375 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hYqH7-0001Wu-So for importer@patchew.org; Thu, 06 Jun 2019 07:09:41 -0400 Received: from eggs.gnu.org ([209.51.188.92]:60314) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hYqF8-0000BW-Lr for qemu-devel@nongnu.org; Thu, 06 Jun 2019 07:07:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hYqF6-0003G2-8Z for qemu-devel@nongnu.org; Thu, 06 Jun 2019 07:07:38 -0400 Received: from mout.kundenserver.de ([212.227.17.24]:59545) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hYqF3-00037Y-JN; Thu, 06 Jun 2019 07:07:33 -0400 Received: from localhost.localdomain ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue107 [212.227.15.183]) with ESMTPSA (Nemesis) id 1N3KDM-1gZYHa2AiY-010LEk; Thu, 06 Jun 2019 13:06:56 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Date: Thu, 6 Jun 2019 13:06:20 +0200 Message-Id: <20190606110625.32127-12-laurent@vivier.eu> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190606110625.32127-1-laurent@vivier.eu> References: <20190606110625.32127-1-laurent@vivier.eu> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:sJX7kOEASuUqzKMQ0rklS29mfRE7eUYEEoU/Bn7KIEsOMKwqJ2X YWBGxkVKP21No4MYqZEreaKD3SKmNr0IVXBWh40+U/9wjURMbjPqw8xeygGtw6C5ruUhURw 5PTP2d1ArFFy1tfPiZ2v60S3hEqYzBDPMVDYHsP6/bOT7MTQFtMBMFBnNyiu2k8qqxW4zGN d5/gMCNINInwKR1/la0Hw== X-UI-Out-Filterresults: notjunk:1;V03:K0:wzw5+xshbZk=:eOln+xl+YM9UAHFJYpiARo kMAa5EWoxeJf34xxDTgqQC7fOaimZY1Apa9qaRK20b2mH5uttdGv5MT0xv8KkiEvQwmXTKOrI G2w9K0lP2YVN4PKXr3HXSK0hfP1ilcrHsjdI9FfPWdj40yGFwONc+PLcvGlkcsaqIextT69My rWsilrh0PqEV/gOa+bSvsZmd2o6oXtWzcINnTA2TM2kyejnf5FaobVGleekLnqui3iiB3KDdm +mrthPjiRiF+4ZoRmeNyHoQJadUmb1D9jXvzXFpkSk2FIaa3V+e4pEwGFocsoa+5Qziid1dXL G/hSg2quGyzbJoQizY0Is1jXorDCvkW1jORInWTjiYN+eXsJ0JSH0xCf9bGlS4niFydQTqsRu NfNWtaSO09TbKrjupcwPheqsAkmieZoeh7OtLq0lvDQSWXVObbQbzxUQTOsB0u5F0tCEnNQ+x KnarwqmnqkOCRTaNrbJJ/iGOaFAaWo/Ok/3OcNTC30q6TnYKqgV5pzyP814fkUGLUVJ9AczkQ wMRWKKLAifJ1iX+FYEu5sfFCAM5mw6I8j6qsXaHiYS+WDrO28oOUmtqwZ1r+Ced6EkQhr9Tah 7OKszfHeqfKOaG7tEXrqVWN9gnCjLP1Lcr2AQ1KhdtQpCPZ437d1npzmQju6AyY11X2l4RDT2 lOZtGC96V3nZOncQEtpZptxJsmP4A3jVp0PxHXvfVRwUadEL9507lG4oScg+uHRfOhJQxiupc +21hzqQAGybZD2uXCflfJLXdq9D7qS8WmCZrFi5lKSxFoCg+NiVzEQWCFi8= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 212.227.17.24 Subject: [Qemu-devel] [PULL 11/16] hw/usb-storage: Use the QOM DEVICE() macro to access DeviceState.qdev X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Fam Zheng , Peter Maydell , Dmitry Fleytman , David Hildenbrand , Michael Tokarev , Gerd Hoffmann , Juan Quintela , Aleksandar Rikalo , "Michael S. Tsirkin" , Halil Pasic , Christian Borntraeger , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , "Dr. David Alan Gilbert" , Yuval Shaia , Alex Williamson , Richard Henderson , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , qemu-s390x@nongnu.org, Cornelia Huck , Laurent Vivier , qemu-trivial@nongnu.org, Michael Walle , Aleksandar Markovic , Paolo Bonzini Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daud=C3=A9 Rather than looking inside the definition of a DeviceState with "s->qdev", use the QOM prefered style: "DEVICE(s)". This patch was generated using the following Coccinelle script: // Use DEVICE() macros to access DeviceState.qdev @use_device_macro_to_access_qdev@ expression obj; identifier dev; @@ -&obj->dev.qdev +DEVICE(obj) Suggested-by: Peter Maydell Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Gerd Hoffmann Message-Id: <20190528164020.32250-9-philmd@redhat.com> Signed-off-by: Laurent Vivier --- hw/usb/dev-storage.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/usb/dev-storage.c b/hw/usb/dev-storage.c index cd5551d94f35..0e4e93ef1673 100644 --- a/hw/usb/dev-storage.c +++ b/hw/usb/dev-storage.c @@ -616,7 +616,7 @@ static void usb_msd_storage_realize(USBDevice *dev, Err= or **errp) * The hack is probably a bad idea. */ blk_ref(blk); - blk_detach_dev(blk, &s->dev.qdev); + blk_detach_dev(blk, DEVICE(s)); s->conf.blk =3D NULL; =20 usb_desc_create_serial(dev); --=20 2.21.0