From nobody Mon Feb 9 03:30:32 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1684508021; cv=none; d=zohomail.com; s=zohoarc; b=h5ybsVfg4umiUv4pfYCwVja7FozF7j+Ob8ZsA4OHRrR3PVJNQgFL10YGJ0lfoG2MwPdAbzfVJ+CYmXyFvZ8gOoWXxSWAIQ/LyB7uHb9j44mDUcBV3gXGP0r+p7hdKGcG5D2zdhUm0EQoIjX6BWhkuXDEh7e+XN/WGiHDNfokLII= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1684508021; h=Content-Type: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; bh=D2IiRUt7FD7TGEQRwdHh0IrJ8V8/JXfdzIWlpXzqwtg=; b=XptWTpfTJuesDK5I9y4oinkXAUWsHL01r/ZO00+cn/0Drf1p1C8pH7Im33cUmEGkfre9riMgzKvml3x1LHArSIDfTMLA6iplN3vhZrs9MjdbcddS+JQ1WvoJ1ok4VCfNPEIAzDkvy+x9PGK9T4kfIY/SduiU2N7//wIdPanhl1A= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1684508021061895.930172033777; Fri, 19 May 2023 07:53:41 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q01Rz-0002dH-2v; Fri, 19 May 2023 10:51: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 1q01Rx-0002Hw-9P for qemu-devel@nongnu.org; Fri, 19 May 2023 10:51:21 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q01Rl-0003cA-2C for qemu-devel@nongnu.org; Fri, 19 May 2023 10:51:20 -0400 Received: from mail-lj1-f199.google.com (mail-lj1-f199.google.com [209.85.208.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-658-4GH_g_iQMAKKBjVkMYKMxQ-1; Fri, 19 May 2023 10:51:07 -0400 Received: by mail-lj1-f199.google.com with SMTP id 38308e7fff4ca-2ac8c5e4aafso6154621fa.1 for ; Fri, 19 May 2023 07:51:06 -0700 (PDT) Received: from redhat.com ([176.12.184.180]) by smtp.gmail.com with ESMTPSA id 18-20020a05651c041200b002adbe01cd69sm864841lja.9.2023.05.19.07.51.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 May 2023 07:51:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1684507868; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=D2IiRUt7FD7TGEQRwdHh0IrJ8V8/JXfdzIWlpXzqwtg=; b=MqAHNW0cUUGiw5hhggHJ0xRCCGAyH68ZpOPzDDkTYxTC+UK/uMleUwrZc1DT/UKUJ83VEZ DFW+lM25MusrFHble7vFvpU0huQdAXL4GSM4xamxPOI+j0gE/LfLpctf3pArk3+wIwpfhZ d4sT2bvjSExK3gt0ubgXkbm8L71BPGI= X-MC-Unique: 4GH_g_iQMAKKBjVkMYKMxQ-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684507865; x=1687099865; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=D2IiRUt7FD7TGEQRwdHh0IrJ8V8/JXfdzIWlpXzqwtg=; b=JaT+ufHdRyl0c4nSJvtGt8nyxA2k+tuV/Wv/St+hECsJmXzriqaM739dJ2mXvqNR9j wUFcTduM+KTVv7vU6Ew1HKy/GXpa0yRB7WkHtQ4XtjIOLwAdL3MBulwv0koD+osxDqP+ M6WJoyulws17WkafKOCqLl1zVxP9+OY3liijWGD+4tn6cLrRXEFQ2aNMywvArc6hW+JM ilMz2nIuhGL4XL5rc8DnCl3HR0/Xe3lHBaJVnT8dn+7CEWsGdLsyO/gsgo+smzdFOx6U 78g0kZt6xnWC2ouqrYWecRGEsLox5mJ84UGq1/W6Q6rlf4ClgWtSjCmxE+8Zsz952sIH IuUQ== X-Gm-Message-State: AC+VfDwClHx3em+jRQSCFbaBJ0KruexZjVNSjN+W/MWdKwH4c3r1uCgh mmWt5gq0ZgK0caOQUxtd5rMvrFB9ZVNOJ3Unm15U5YqAVLBja1NhOEjhWTcXfnMukx0tvTDD8dM +knjBjZMNXwz8ykMI7itA8XsgbpLDv08UW3uK+UYQDE/XkawkqK8Mn3vmeXFGHtOFOVCd X-Received: by 2002:a2e:b62c:0:b0:2a9:d4f0:6 with SMTP id s12-20020a2eb62c000000b002a9d4f00006mr824227ljn.17.1684507865299; Fri, 19 May 2023 07:51:05 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ50eR1CGuqIQEE74Ya31XxSNmarC218WeOqygFsE/lGHoYvCI5qd4uo69vfx7rgt5LFRDvxew== X-Received: by 2002:a2e:b62c:0:b0:2a9:d4f0:6 with SMTP id s12-20020a2eb62c000000b002a9d4f00006mr824215ljn.17.1684507865026; Fri, 19 May 2023 07:51:05 -0700 (PDT) Date: Fri, 19 May 2023 10:51:00 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Vladimir Sementsov-Ogievskiy , David Hildenbrand , Juan Quintela , Marcel Apfelbaum Subject: [PULL 16/40] pci: pci_add_option_rom(): improve style Message-ID: <4ab049c7e68919b92a5ece5ad5baa52d0a963676.1684507742.git.mst@redhat.com> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=170.10.133.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1684508022116100006 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Vladimir Sementsov-Ogievskiy Fix over-80 lines and missing curly brackets for if-operators, which are required by QEMU coding style. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: David Hildenbrand Message-Id: <20230515125229.44836-2-vsementsov@yandex-team.ru> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin Reviewed-by: Juan Quintela --- hw/pci/pci.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/hw/pci/pci.c b/hw/pci/pci.c index 8a87ccc8b0..e26e2a7e65 100644 --- a/hw/pci/pci.c +++ b/hw/pci/pci.c @@ -2312,10 +2312,9 @@ static void pci_add_option_rom(PCIDevice *pdev, bool= is_default_rom, char name[32]; const VMStateDescription *vmsd; =20 - if (!pdev->romfile) - return; - if (strlen(pdev->romfile) =3D=3D 0) + if (!pdev->romfile || !strlen(pdev->romfile)) { return; + } =20 if (!pdev->rom_bar) { /* @@ -2364,7 +2363,8 @@ static void pci_add_option_rom(PCIDevice *pdev, bool = is_default_rom, } if (pdev->romsize !=3D -1) { if (size > pdev->romsize) { - error_setg(errp, "romfile \"%s\" (%u bytes) is too large for R= OM size %u", + error_setg(errp, "romfile \"%s\" (%u bytes) " + "is too large for ROM size %u", pdev->romfile, (uint32_t)size, pdev->romsize); g_free(path); return; @@ -2374,14 +2374,13 @@ static void pci_add_option_rom(PCIDevice *pdev, boo= l is_default_rom, } =20 vmsd =3D qdev_get_vmsd(DEVICE(pdev)); + snprintf(name, sizeof(name), "%s.rom", + vmsd ? vmsd->name : object_get_typename(OBJECT(pdev))); =20 - if (vmsd) { - snprintf(name, sizeof(name), "%s.rom", vmsd->name); - } else { - snprintf(name, sizeof(name), "%s.rom", object_get_typename(OBJECT(= pdev))); - } pdev->has_rom =3D true; - memory_region_init_rom(&pdev->rom, OBJECT(pdev), name, pdev->romsize, = &error_fatal); + memory_region_init_rom(&pdev->rom, OBJECT(pdev), name, pdev->romsize, + &error_fatal); + ptr =3D memory_region_get_ram_ptr(&pdev->rom); if (load_image_size(path, ptr, size) < 0) { error_setg(errp, "failed to load romfile \"%s\"", pdev->romfile); --=20 MST