From nobody Mon Oct 6 14:42:37 2025 Delivered-To: importer@patchew.org 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; Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1583412432; cv=none; d=zohomail.com; s=zohoarc; b=LRnz43fMUOBgnZxRhzpmlDoUQ+GbC+Nd5T+VNWEU2JTG3Ule/43frbU4qeYOQhfEx66Ugucd/uM8kVi16910wo5oCIc/c4YohdE/x+CLeybqrM6+FP5d8czAq/uL8Srd9LYt5dacF95Aw2Gn8aZsznWGD4izdFMkoYKDBagqNqs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1583412432; 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; bh=g8JgHjC2tXoZAEY+Z+QWQFzxkwOUopjQLXjv3/2fagw=; b=BbRv54r1BM4nofp7BjHY91TpoKsATrq4g3KdX3Xa8FJwDm4jDHOLKq3M3LJPwg8Q6r2stSVQKVfMI/YKQHBdQ3T4SjyBqja72PCoer1j+9cUOZUgVjlHSVdUP2ZBKJ9k9qJJmZ0H76MYcMmntrzszGWCwSJ2ZBfSUC7iTdpsew4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1583412432049785.4716065151073; Thu, 5 Mar 2020 04:47:12 -0800 (PST) Received: from localhost ([::1]:48344 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j9puB-00007o-1G for importer@patchew.org; Thu, 05 Mar 2020 07:47:11 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:41600) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j9psg-00066m-J7 for qemu-devel@nongnu.org; Thu, 05 Mar 2020 07:45:39 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j9psf-0001Km-FB for qemu-devel@nongnu.org; Thu, 05 Mar 2020 07:45:38 -0500 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:58044 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1j9psf-0001Ke-Am for qemu-devel@nongnu.org; Thu, 05 Mar 2020 07:45:37 -0500 Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-84-Ew-UClyXMz64FZgDfKNDVQ-1; Thu, 05 Mar 2020 07:45:35 -0500 Received: by mail-wr1-f72.google.com with SMTP id b12so2282043wro.4 for ; Thu, 05 Mar 2020 04:45:34 -0800 (PST) Received: from localhost.localdomain (47.red-88-21-205.staticip.rima-tde.net. [88.21.205.47]) by smtp.gmail.com with ESMTPSA id w16sm10556707wrp.8.2020.03.05.04.45.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Mar 2020 04:45:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1583412336; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=g8JgHjC2tXoZAEY+Z+QWQFzxkwOUopjQLXjv3/2fagw=; b=AHyeOnsSnrDsx5B/GH9UcQVwIsdQbrgBK1Rcw9FjHArxO7/dpvigDu2fGAiFjENOGYplRd +t9lv4ZoP/e9IOomdxJFNR7BeKDCZ91FSw5DcC22wy1ArsASIy1PkyJooNWuiJntKRwgvD EK1wry7DJ0TUfrh3TAiCWBlLL+j9t0g= X-MC-Unique: Ew-UClyXMz64FZgDfKNDVQ-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=e8/VptnNWOgnx0RgaFPk1+9lrGqKzxjndWbawBpy4oA=; b=EDswy+DAyadaUm0gVo0CI+nBuNIEznZeX/YX3CcdOuqFx467Z0bJry4+UUSKgPvoTv kOKsQho6Yv9X4BfZv+HYYdRQGQLMPRJktL0zdGrLUblLrhUiM/EkTILUI43LoHVyZ8Dv qlMT8yQzw3Ua0ZskiieNBBR50At2/3fFTeLFMjdNdDh+TqLZR7s7nBcOgARdoc/Bk3h7 00XX86EfTWNFT/LuSh6k1DOnyaJUullCNnkAHyWOBdfKB3vEfhz2g72GW2L1q29dyhII 4WABqcAPaWX7wL/fxzenjMFq+37MBmBXHHWBTGGPDO1OsXSJ6N7Na2Ewnr9REqY/XoiO KJ8A== X-Gm-Message-State: ANhLgQ300zMXqCmcJ9wxzTpKg2bkedS4MoqqpJf0DdWpweVAOZtt/Nfe +b5AOLvyaoning5oqeRn9E/Bl0NbqNwOwXsy4rqaX+N7KkMQ4+sTR3G63t+2B+rTD03mVyholwN Y/91swfqyvN14PJA= X-Received: by 2002:adf:f041:: with SMTP id t1mr9555754wro.98.1583412334057; Thu, 05 Mar 2020 04:45:34 -0800 (PST) X-Google-Smtp-Source: ADFU+vvBJX4eBPj6deoHJ3R1XiuP/1oQusUpv01W1MI5QD8pSRm/PrjA2JhtMn33wjd9Ey+mMm3Npg== X-Received: by 2002:adf:f041:: with SMTP id t1mr9555734wro.98.1583412333897; Thu, 05 Mar 2020 04:45:33 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-trivial@nongnu.org, qemu-devel@nongnu.org Subject: [PATCH v2 1/9] hw/audio/fmopl: Fix a typo twice Date: Thu, 5 Mar 2020 13:45:17 +0100 Message-Id: <20200305124525.14555-2-philmd@redhat.com> X-Mailer: git-send-email 2.21.1 In-Reply-To: <20200305124525.14555-1-philmd@redhat.com> References: <20200305124525.14555-1-philmd@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 205.139.110.120 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Dmitry Fleytman , Jason Wang , Christian Schoenebeck , Greg Kurz , Laurent Vivier , Gerd Hoffmann , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Stefano Garzarella Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8"; text/plain; charset="utf-8" Reviewed-by: Laurent Vivier Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Stefano Garzarella --- hw/audio/fmopl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/audio/fmopl.c b/hw/audio/fmopl.c index 9f50a89b4a..173a7521f2 100644 --- a/hw/audio/fmopl.c +++ b/hw/audio/fmopl.c @@ -1066,7 +1066,7 @@ static void OPLResetChip(FM_OPL *OPL) } } =20 -/* ---------- Create one of vietual YM3812 ---------- */ +/* ---------- Create one of virtual YM3812 ---------- */ /* 'rate' is sampling rate and 'bufsiz' is the size of the */ FM_OPL *OPLCreate(int clock, int rate) { @@ -1115,7 +1115,7 @@ FM_OPL *OPLCreate(int clock, int rate) return OPL; } =20 -/* ---------- Destroy one of vietual YM3812 ---------- */ +/* ---------- Destroy one of virtual YM3812 ---------- */ void OPLDestroy(FM_OPL *OPL) { #ifdef OPL_OUTPUT_LOG --=20 2.21.1 From nobody Mon Oct 6 14:42:37 2025 Delivered-To: importer@patchew.org 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; Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1583412440; cv=none; d=zohomail.com; s=zohoarc; b=YyGllur8TRfmb43aHbjMGnjlgpbgiDU+IfGAy4qkb3nHC9Gz8Ha3s4wer9x7wKsReJ0GlWRAWXWXQKI1kcV/7//CpUckJnFPpR55TyHNJyzfVEoPMpNDt2g2e6UVfg9nLFSnUiQMzLgo+UhcMrysLv3zTvBd2fIJDi4teSTilQU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1583412440; 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; bh=HfnT8d1lOc8oOW388s3B4mt/9tuFbIC8PeXMCcmaMOk=; b=Esoow7ppQw9OhOusW14RZjB3iEGVPtdySmr3bjIE39w+7Ke/nMX2DsYKTEyOreg3SSHR3fSeSU5+nE1jJphTXmG5FCBTh26iDQ0pfq8qcuN3rnQ9wJeundJ6i1Lzrweh63/IzNI+mjM46pnYlAelxJpqXUxEVmmqxIZCyWlsERI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1583412440484475.96481771485185; Thu, 5 Mar 2020 04:47:20 -0800 (PST) Received: from localhost ([::1]:48346 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j9puJ-0000PV-DH for importer@patchew.org; Thu, 05 Mar 2020 07:47:19 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:41629) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j9psn-0006Un-Oi for qemu-devel@nongnu.org; Thu, 05 Mar 2020 07:45:46 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j9psm-0001PW-Ou for qemu-devel@nongnu.org; Thu, 05 Mar 2020 07:45:45 -0500 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:29636 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1j9psm-0001Oy-LV for qemu-devel@nongnu.org; Thu, 05 Mar 2020 07:45:44 -0500 Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-191--E0rBE8jPSKLYV0Jur9KIw-1; Thu, 05 Mar 2020 07:45:40 -0500 Received: by mail-wr1-f70.google.com with SMTP id m13so2266969wrw.3 for ; Thu, 05 Mar 2020 04:45:40 -0800 (PST) Received: from localhost.localdomain (47.red-88-21-205.staticip.rima-tde.net. [88.21.205.47]) by smtp.gmail.com with ESMTPSA id m3sm25274864wrx.9.2020.03.05.04.45.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Mar 2020 04:45:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1583412344; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=HfnT8d1lOc8oOW388s3B4mt/9tuFbIC8PeXMCcmaMOk=; b=arjfed0zfDmzfwX7S+UVdHfY7DDTi/rdqzG6nXzwk1Z6OB8mjeSo1ZhCvnBxJtR3E3icZJ lOvtZUM83lxPVuHRXN7gbImEOB4tS7Txv6i2/lNd6xx5W4CsFGkdiF1WoTjUUAjQ7weGxa +i27of4MHO1dnoijeeh03lNRQGMsMdU= X-MC-Unique: -E0rBE8jPSKLYV0Jur9KIw-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=7WthtJEuF/N+eAMadHF0Sd51QGcmnmZoupRAgou8XDo=; b=rDdApjMtgSXSD7Ggh0la+DZeeOQta5NJpQPJnbL86TRTWfGaforpK0HBfquAwbplr7 7Z7KkB6jvsR8qQSledUG0f5I7Q60JCWjVr+QQwn0RCiKHJmCzGpHNulGYyjAB5ZYfcB6 PBpSLX9f2LI+fP4/Hz9gaEVosD9pKbSL2XAmPIcUU9lJ5BoFE2cGqQ+95ml/5oAPebUQ SgY643/KZUGesjEmV5M3jXDn6jaouSBhl9Q/LtpJkJRp1qYUHmhGUP+UFxdybpVkNy0k WH8PAg0KpbEJbf3Ck85A7JxDb4jXzh7xF787PwYe94yIjX0/P2pJCQt3xk2RBMlko1OQ LWNg== X-Gm-Message-State: ANhLgQ1Wo0BYPIwOToCPf6wbK6NSLJjcCqcsBHG+v1TkNhlT8JEQTE36 vZkycfgWUpnmRDACFi22lwPNWZ9eYlXxxxVujODrNMnIFkhX7uvyyB4mHTq6v6jw3ovK8BLGPEw A3U4O+9QtVUiK8Pk= X-Received: by 2002:a1c:6884:: with SMTP id d126mr9090948wmc.38.1583412339471; Thu, 05 Mar 2020 04:45:39 -0800 (PST) X-Google-Smtp-Source: ADFU+vszSRNbFNB70lPwi1+dJrIysVzEGOnhLy69XyNqvWJZ5pFATslY5R70zu29Mm0icEgl9lXtrw== X-Received: by 2002:a1c:6884:: with SMTP id d126mr9090927wmc.38.1583412339278; Thu, 05 Mar 2020 04:45:39 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-trivial@nongnu.org, qemu-devel@nongnu.org Subject: [PATCH v2 2/9] hw/audio/fmopl: Move ENV_CURVE to .heap to save 32KiB of .bss Date: Thu, 5 Mar 2020 13:45:18 +0100 Message-Id: <20200305124525.14555-3-philmd@redhat.com> X-Mailer: git-send-email 2.21.1 In-Reply-To: <20200305124525.14555-1-philmd@redhat.com> References: <20200305124525.14555-1-philmd@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 207.211.31.120 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Dmitry Fleytman , Jason Wang , Christian Schoenebeck , Greg Kurz , Gerd Hoffmann , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Stefano Garzarella Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8"; text/plain; charset="utf-8" This buffer is only used by the adlib audio device. Move it to the .heap to release 32KiB of .bss (size reported on x86_64 host). Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Stefano Garzarella --- hw/audio/fmopl.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hw/audio/fmopl.c b/hw/audio/fmopl.c index 173a7521f2..356d4dfbca 100644 --- a/hw/audio/fmopl.c +++ b/hw/audio/fmopl.c @@ -186,7 +186,7 @@ static int32_t *VIB_TABLE; =20 /* envelope output curve table */ /* attack + decay + OFF */ -static int32_t ENV_CURVE[2*EG_ENT+1]; +static int32_t *ENV_CURVE; =20 /* multiple table */ #define ML 2 @@ -1090,6 +1090,7 @@ FM_OPL *OPLCreate(int clock, int rate) OPL->clock =3D clock; OPL->rate =3D rate; OPL->max_ch =3D max_ch; + ENV_CURVE =3D g_new(int32_t, 2 * EG_ENT + 1); /* init grobal tables */ OPL_initialize(OPL); /* reset chip */ @@ -1127,6 +1128,7 @@ void OPLDestroy(FM_OPL *OPL) #endif OPL_UnLockTable(); free(OPL); + g_free(ENV_CURVE); } =20 /* ---------- Option handlers ---------- */ --=20 2.21.1 From nobody Mon Oct 6 14:42:37 2025 Delivered-To: importer@patchew.org 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; Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1583412547; cv=none; d=zohomail.com; s=zohoarc; b=O5vLDCiYsUfe522FgqKaS3VevhdqMbpoDIj2CbhjcDW32Y2qpdbUHf5QHOgUHYJ5/Doj+ZUVqt/v0ODm2ZX5LU+iADCkPot44sNbp+bnrSRCuDaUhfQdWYP/Cfz0swGhC7bXXritYqxpS1gVtuaQzsTFIn1s0IIjWHGpgOhkDB8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1583412547; 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; bh=8g6dQ3CpRHKhm3JtMqVTXiTXrin8V/riv5Rhf5txJno=; b=AWoRm2MNDH2br9tXz1QyCEpWiBZeEAVQSpZSPwQi+iIW65WxMpZ8NOOa5+YP/L8NDyte8XgBKY8/tSDcF1hYxe43VpKB0HtEGZknrJu5j5gYzvjQ2An8QhQQ+IhtqFrCoYHl/072oPZb76eKgIv06u3ft2m/RmrTuSm3t6Fx4zs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 15834125474888.522211124986711; Thu, 5 Mar 2020 04:49:07 -0800 (PST) Received: from localhost ([::1]:48370 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j9pw2-0003qT-FD for importer@patchew.org; Thu, 05 Mar 2020 07:49:06 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:41651) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j9psr-0006hJ-EM for qemu-devel@nongnu.org; Thu, 05 Mar 2020 07:45:50 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j9psq-0001S1-2s for qemu-devel@nongnu.org; Thu, 05 Mar 2020 07:45:49 -0500 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:60429 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1j9psp-0001RQ-Vt for qemu-devel@nongnu.org; Thu, 05 Mar 2020 07:45:48 -0500 Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-24-IV01yIoaNfSt_T31cVBn0g-1; Thu, 05 Mar 2020 07:45:45 -0500 Received: by mail-wm1-f69.google.com with SMTP id t2so1538067wmj.2 for ; Thu, 05 Mar 2020 04:45:45 -0800 (PST) Received: from localhost.localdomain (47.red-88-21-205.staticip.rima-tde.net. [88.21.205.47]) by smtp.gmail.com with ESMTPSA id w16sm10557400wrp.8.2020.03.05.04.45.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Mar 2020 04:45:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1583412347; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=8g6dQ3CpRHKhm3JtMqVTXiTXrin8V/riv5Rhf5txJno=; b=esLpdeUHOgQstwxLXbAnmQ52zeFAhnj/Yc+AJYSXzKtSiHDUqQwhZr4Zmbse1qMu550mv7 QuQh25fMwxiveCmC78RfbrgPxHIsAsVaOrcWwLtB4BevZWNoBbI+BddTZ7MwXI4QIFXysL 2AI+1pcj/Iu3dEfQcFFd8x5RpS9f8dk= X-MC-Unique: IV01yIoaNfSt_T31cVBn0g-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=8ag/+xxkZSZEkgkSM8quJuguUY+bU0lgLQ4HQ0DMXWs=; b=kwXvebrjD0qVbQzO4ohyn3Cq7SowgiRvmhqf9+/n949PdRDUqXDf9nLFeg5iE9lQ7F k+s6Q152cQcV6qGarKDqshFYl/gTBYcbhs8q3tJeRaff9RWXTCKkdk2aRM7KM9fyfGfD UiwlVRanS9v6qdUQZ7H1Sspge3Fd5DtBvtC2/hgnAUQHDHq9hoFQq05rgwpBasUjHK+3 UChiRCcXz95jj//xCnYlmwUPHtB4WzW6ixvQ9X/yOV5jwxMh0el+/Y0Z45HSMdcj4sWw iuhUS95OPSEZkU22f7lZk8B37HyGroXRvpqFCxHQmn2N7eYQ7LOMYgWc2n9slV1LS6FP IhRg== X-Gm-Message-State: ANhLgQ36jld7SpqpzdT9J09NNiv2c4RpoFuojjNzw27uifD8XJpvPqfd 9seKE6yLqHV0yVUU/4ZDdA9nJh7vtJ8S12Nnr2kR2mlJ4mIS2CFYXW3IoOm9oQJ4BHXtC3X6gY4 ORS0MFPXTEGiPVgg= X-Received: by 2002:adf:c44a:: with SMTP id a10mr9610702wrg.279.1583412344761; Thu, 05 Mar 2020 04:45:44 -0800 (PST) X-Google-Smtp-Source: ADFU+vvV45icIeKnJohi2wwznflJoac7ddAA7c8GDji6ulzoJK4tbHIpm7Ij2Vs4WTB93r6z1hLpEA== X-Received: by 2002:adf:c44a:: with SMTP id a10mr9610688wrg.279.1583412344548; Thu, 05 Mar 2020 04:45:44 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-trivial@nongnu.org, qemu-devel@nongnu.org Subject: [PATCH v2 3/9] hw/audio/intel-hda: Use memory region alias to reduce .rodata by 4.34MB Date: Thu, 5 Mar 2020 13:45:19 +0100 Message-Id: <20200305124525.14555-4-philmd@redhat.com> X-Mailer: git-send-email 2.21.1 In-Reply-To: <20200305124525.14555-1-philmd@redhat.com> References: <20200305124525.14555-1-philmd@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 205.139.110.120 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Dmitry Fleytman , Jason Wang , Christian Schoenebeck , Greg Kurz , Gerd Hoffmann , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Stefano Garzarella Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8"; text/plain; charset="utf-8" The intel-hda model uses an array of register indexed by the register address. This array also contains a pair of aliased registers at offset 0x2000. This creates a huge hole in the array, which ends up eating 4.6MiB of .rodata (size reported on x86_64 host, building with --extra-cflags=3D-Os). By using a memory region alias, we reduce this array to 132kB. Before: (qemu) info mtree 00000000febd4000-00000000febd7fff (prio 1, i/o): intel-hda After: (qemu) info mtree 00000000febd4000-00000000febd7fff (prio 1, i/o): intel-hda 00000000febd4000-00000000febd7fff (prio 1, i/o): intel-hda-container 00000000febd4000-00000000febd5fff (prio 0, i/o): intel-hda 00000000febd6000-00000000febd7fff (prio 0, i/o): alias intel-hda-alia= s @intel-hda 0000000000000000-0000000000001fff Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/audio/intel-hda.c | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/hw/audio/intel-hda.c b/hw/audio/intel-hda.c index 1bcc3e5cf8..e8d18b7c58 100644 --- a/hw/audio/intel-hda.c +++ b/hw/audio/intel-hda.c @@ -181,7 +181,9 @@ struct IntelHDAState { IntelHDAStream st[8]; =20 /* state */ + MemoryRegion container; MemoryRegion mmio; + MemoryRegion alias; uint32_t rirb_count; int64_t wall_base_ns; =20 @@ -670,12 +672,6 @@ static const struct IntelHDAReg regtab[] =3D { .offset =3D offsetof(IntelHDAState, wall_clk), .rhandler =3D intel_hda_get_wall_clk, }, - [ ICH6_REG_WALLCLK + 0x2000 ] =3D { - .name =3D "WALLCLK(alias)", - .size =3D 4, - .offset =3D offsetof(IntelHDAState, wall_clk), - .rhandler =3D intel_hda_get_wall_clk, - }, =20 /* dma engine */ [ ICH6_REG_CORBLBASE ] =3D { @@ -837,12 +833,6 @@ static const struct IntelHDAReg regtab[] =3D { .size =3D 4, \ .offset =3D offsetof(IntelHDAState, st[_i].lpib), \ }, \ - [ ST_REG(_i, ICH6_REG_SD_LPIB) + 0x2000 ] =3D { \ - .stream =3D _i, \ - .name =3D _t stringify(_i) " LPIB(alias)", \ - .size =3D 4, \ - .offset =3D offsetof(IntelHDAState, st[_i].lpib), \ - }, \ [ ST_REG(_i, ICH6_REG_SD_CBL) ] =3D { \ .stream =3D _i, \ .name =3D _t stringify(_i) " CBL", \ @@ -1125,9 +1115,15 @@ static void intel_hda_realize(PCIDevice *pci, Error = **errp) error_free(err); } =20 + memory_region_init(&d->container, OBJECT(d), + "intel-hda-container", 0x4000); memory_region_init_io(&d->mmio, OBJECT(d), &intel_hda_mmio_ops, d, - "intel-hda", 0x4000); - pci_register_bar(&d->pci, 0, 0, &d->mmio); + "intel-hda", 0x2000); + memory_region_add_subregion(&d->container, 0x0000, &d->mmio); + memory_region_init_alias(&d->alias, OBJECT(d), "intel-hda-alias", + &d->mmio, 0, 0x2000); + memory_region_add_subregion(&d->container, 0x2000, &d->alias); + pci_register_bar(&d->pci, 0, 0, &d->container); =20 hda_codec_bus_init(DEVICE(pci), &d->codecs, sizeof(d->codecs), intel_hda_response, intel_hda_xfer); --=20 2.21.1 From nobody Mon Oct 6 14:42:37 2025 Delivered-To: importer@patchew.org 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; Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1583412637; cv=none; d=zohomail.com; s=zohoarc; b=aA0MJYOXgI7ksFeMbdQhkbxRfbfi8hnURZh3gTZT59FM+XrzfeHTskbFUs703Y/5bOArhW9PfM6rHalh/MhulsfSjGx2TrKThdK80JKdQ5+kvmcOQ7/wvE8aIrJqw9POIDUIujtk4enRIMuVyuUXn7POqjzqhU5L4dg5vdUHGXc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1583412637; 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; bh=JfaE+0axlKWiznACDUVr5NFMk2fsnhKxXDiz+PMDV4Y=; b=YVY6NQwmsIa3gUhMx0DBK+yBaXVhkwfglwh4Yumu9xVr4i51xhnh5VN353v4rane5uiKGMmDgvnZNlzssPtMnBxROxCOdqoTxld+nLLMNZ5LO2LSc6MmucvEfbRLecmwjAdJxxyRTvm9SIPxUVxvz8czNAqVvBpWq7VzET7CpYY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1583412637510728.2671692937972; Thu, 5 Mar 2020 04:50:37 -0800 (PST) Received: from localhost ([::1]:48394 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j9pxT-0007DN-SI for importer@patchew.org; Thu, 05 Mar 2020 07:50:35 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:41701) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j9psz-00073M-1j for qemu-devel@nongnu.org; Thu, 05 Mar 2020 07:45:58 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j9psx-0001Wi-Op for qemu-devel@nongnu.org; Thu, 05 Mar 2020 07:45:56 -0500 Received: from us-smtp-2.mimecast.com ([207.211.31.81]:34958 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1j9psx-0001WY-KY for qemu-devel@nongnu.org; Thu, 05 Mar 2020 07:45:55 -0500 Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-97-_0KXLWMnN2qr69nfToXtVQ-1; Thu, 05 Mar 2020 07:45:51 -0500 Received: by mail-wr1-f70.google.com with SMTP id s10so494158wrr.21 for ; Thu, 05 Mar 2020 04:45:50 -0800 (PST) Received: from localhost.localdomain (47.red-88-21-205.staticip.rima-tde.net. [88.21.205.47]) by smtp.gmail.com with ESMTPSA id j14sm44924328wrn.32.2020.03.05.04.45.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Mar 2020 04:45:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1583412355; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=JfaE+0axlKWiznACDUVr5NFMk2fsnhKxXDiz+PMDV4Y=; b=KpjgaBvN/geU6cdjF4P4+omH8MwS0MNBgj6JKGdzemTQEaTtSnJfeBHhzm/l4DU7Ok+Pkd lZbDj/V29baTT2/otwXt25KEASd6hqS+Gv/2VHtM/glfx6ZkJk3YGYNrWrFvb3AjC55EY3 ah6xLMAvdRH/3E5ovs3PyY6+KOjIKnc= X-MC-Unique: _0KXLWMnN2qr69nfToXtVQ-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=42bbadqUAgxtcc+IIT/30qYCAcYJc9y0Vsbx4Pz3gIU=; b=Ecxn/RpEdytcNdeunmcLEY0BT/uZRhnzE8+7jgGtf7qtBslLcOe70To2TkDkQCP2Wf RZdqO2PBcKejleVBoYRxoVak93jMgeHCza+iAC0zdNjF+ud/vtEpsoLmHGWQUB8qA+6l Wy1Fzzzy5wU1wbwAiOUc3lCsl16ALg4ADvx4Rj47o+9ugx122RLe7DwWElKdb+BrXbMI Q6BFZpUqIJGvcrORdiLLWniv1RyFai2gtPtPnGIBsbFYrBn5evgU0izeX4WpEN4CLexo ohWVstE/hsvaXYD9J0YrJR9XI+wDcB2u0VejH4kx3i2HJdPFa09UMZrCHnXwvfioe1bU qViA== X-Gm-Message-State: ANhLgQ3+5qdlm+L2MKh39rzkhDLWEN87T1L1344Ju6DcIB0yTJCBRnn4 MUokVZxH//k+wmD0LX6zwlcz8JaTnIPSGFNaE12zXy9YpUWdRu/edFmb78EKnt61vZKQgL3JWek 63NDsK55kx3it6VE= X-Received: by 2002:a1c:e146:: with SMTP id y67mr9108383wmg.81.1583412350052; Thu, 05 Mar 2020 04:45:50 -0800 (PST) X-Google-Smtp-Source: ADFU+vthWhcpjJ0QtztZkI8eKhbEYA0N0BtUoJ9LPdGVIeSPURfmP7IqY9VKyto/DkMvQ6hUEDzqPA== X-Received: by 2002:a1c:e146:: with SMTP id y67mr9108368wmg.81.1583412349872; Thu, 05 Mar 2020 04:45:49 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-trivial@nongnu.org, qemu-devel@nongnu.org Subject: [PATCH v2 4/9] hw/net/e1000: Add readops/writeops typedefs Date: Thu, 5 Mar 2020 13:45:20 +0100 Message-Id: <20200305124525.14555-5-philmd@redhat.com> X-Mailer: git-send-email 2.21.1 In-Reply-To: <20200305124525.14555-1-philmd@redhat.com> References: <20200305124525.14555-1-philmd@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 207.211.31.81 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Dmitry Fleytman , Jason Wang , Christian Schoenebeck , Greg Kurz , Gerd Hoffmann , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Stefano Garzarella Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8"; text/plain; charset="utf-8" Express the macreg[] arrays using typedefs. No logical changes introduced here. Reviewed-by: Dmitry Fleytman Reviewed-by: Stefano Garzarella Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/net/e1000.c | 6 ++++-- hw/net/e1000e_core.c | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/hw/net/e1000.c b/hw/net/e1000.c index 0b833d5a15..972d9b5083 100644 --- a/hw/net/e1000.c +++ b/hw/net/e1000.c @@ -1150,7 +1150,8 @@ set_ims(E1000State *s, int index, uint32_t val) } =20 #define getreg(x) [x] =3D mac_readreg -static uint32_t (*macreg_readops[])(E1000State *, int) =3D { +typedef uint32_t (*readops)(E1000State *, int); +static readops macreg_readops[] =3D { getreg(PBA), getreg(RCTL), getreg(TDH), getreg(TXDCTL), getreg(WUFC), getreg(TDT), getreg(CTRL), getreg(LEDCTL), getreg(MANC), getreg(MDIC), getreg(SWSM), getreg(STATUS), @@ -1205,7 +1206,8 @@ static uint32_t (*macreg_readops[])(E1000State *, int= ) =3D { enum { NREADOPS =3D ARRAY_SIZE(macreg_readops) }; =20 #define putreg(x) [x] =3D mac_writereg -static void (*macreg_writeops[])(E1000State *, int, uint32_t) =3D { +typedef void (*writeops)(E1000State *, int, uint32_t); +static writeops macreg_writeops[] =3D { putreg(PBA), putreg(EERD), putreg(SWSM), putreg(WUFC), putreg(TDBAL), putreg(TDBAH), putreg(TXDCTL), putreg(RDBAH), putreg(RDBAL), putreg(LEDCTL), putreg(VET), putreg(FCRUC), diff --git a/hw/net/e1000e_core.c b/hw/net/e1000e_core.c index 94ea34dca5..38bdb90114 100644 --- a/hw/net/e1000e_core.c +++ b/hw/net/e1000e_core.c @@ -2855,7 +2855,8 @@ e1000e_set_gcr(E1000ECore *core, int index, uint32_t = val) } =20 #define e1000e_getreg(x) [x] =3D e1000e_mac_readreg -static uint32_t (*e1000e_macreg_readops[])(E1000ECore *, int) =3D { +typedef uint32_t (*readops)(E1000ECore *, int); +static readops e1000e_macreg_readops[] =3D { e1000e_getreg(PBA), e1000e_getreg(WUFC), e1000e_getreg(MANC), @@ -3061,7 +3062,8 @@ static uint32_t (*e1000e_macreg_readops[])(E1000ECore= *, int) =3D { enum { E1000E_NREADOPS =3D ARRAY_SIZE(e1000e_macreg_readops) }; =20 #define e1000e_putreg(x) [x] =3D e1000e_mac_writereg -static void (*e1000e_macreg_writeops[])(E1000ECore *, int, uint32_t) =3D { +typedef void (*writeops)(E1000ECore *, int, uint32_t); +static writeops e1000e_macreg_writeops[] =3D { e1000e_putreg(PBA), e1000e_putreg(SWSM), e1000e_putreg(WUFC), --=20 2.21.1 From nobody Mon Oct 6 14:42:37 2025 Delivered-To: importer@patchew.org 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; Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1583412456; cv=none; d=zohomail.com; s=zohoarc; b=ChmjdcNLKzhCIxouYNsYdHoB/1WJ/veILWjglynBDU29zw521cSeyzbp0UDeK50h5iGNMsL+BrKQLiv0XEKUDHTTUH5xVbCOjSnrEEU3HXtS2gBzCvXMccIAzJy1H+SjMueVcdLvhN2hObckzwBlvo+nGjWhnZ021uOJCZTDt1U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1583412456; 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; bh=bpO/T7UwPAvLhYM4LuPfNzVKKs4kmwvLsNBfOTPVceU=; b=d5N+ZfVYpSgYLhmWAwTAfeGIFW5GscykhYoaBy7SQXrlZ9w1P9yb9dqkgyAseRRK9vlWjWJZJ8gxpXJKDXxI8rUGNYzq1su5Rev8EeinTEUGs4RutuNZlRcnWEXOHQXtqp83dDR6KdsfVL9w4UM2ucIKYmlLM8RfwA+aDthG0mA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1583412456078847.3107215230407; Thu, 5 Mar 2020 04:47:36 -0800 (PST) Received: from localhost ([::1]:48350 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j9puZ-0000vj-38 for importer@patchew.org; Thu, 05 Mar 2020 07:47:35 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:41728) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j9pt1-0007Ai-Rr for qemu-devel@nongnu.org; Thu, 05 Mar 2020 07:46:00 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j9pt0-0001Y7-LX for qemu-devel@nongnu.org; Thu, 05 Mar 2020 07:45:59 -0500 Received: from us-smtp-2.mimecast.com ([205.139.110.61]:30985 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1j9pt0-0001XT-Gk for qemu-devel@nongnu.org; Thu, 05 Mar 2020 07:45:58 -0500 Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-494-Ph6ukPyvND-1XKyBXVjKNQ-1; Thu, 05 Mar 2020 07:45:56 -0500 Received: by mail-wr1-f72.google.com with SMTP id 72so2260218wrc.6 for ; Thu, 05 Mar 2020 04:45:56 -0800 (PST) Received: from localhost.localdomain (47.red-88-21-205.staticip.rima-tde.net. [88.21.205.47]) by smtp.gmail.com with ESMTPSA id z16sm43034175wrp.33.2020.03.05.04.45.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Mar 2020 04:45:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1583412358; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=bpO/T7UwPAvLhYM4LuPfNzVKKs4kmwvLsNBfOTPVceU=; b=FSUWYO0+BRW2EDPETDgQ3JAamjrnkxXVR7t379nMo/0uiXZtscsVUaJp03SHgZ1d0aE0co SddVhXbjIv3D+yLz70cOCiCkajQ4gMYH4Aku8iuCxfxh33jaEtb01wa7DICqxeingoFHt2 naSDbdSSY7/oXDNpLqEBC8WHzOD5qEs= X-MC-Unique: Ph6ukPyvND-1XKyBXVjKNQ-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=E/nIlQM3WrOtft5YLrhenWftF1BsF4c8+Al/4nVYdhE=; b=If4HnAJM7ZloAuMg3ypwIhXGwUdLXNKwnsSj3BdfxUU/iniNivsvznnOJdUVyKYn7+ vyaIah+gVXkKqpP03lP4hn3TBTVUMWvLzoWcmxOAlRFc2xSkkWp/76au9Om2NH0YSJxF T8hE88rbpMqSs3SOkFq9uYmKeTkzX+qf/y3QtXuMnU0KIkXyIC3cyJVPqfjfbJea2xsb BVFhVtDr7P6wrN0Z6e4UTmU2huHg27yVwaYxMwcPuza0DalkQosF8p+G1IhJaZqjJj5B QemYzQUkhvmcxHr9MRyRHq8LrYk03WaTTAvG2csIT1wPMdSmdTlLi7nFQ2V5wF2FNjj9 f79g== X-Gm-Message-State: ANhLgQ3ER9hudZOWhhB6FEyvTSEYP8qG2C62bsyBBCd5q6SMDFYpyocG +SrlCPyMLPlLuA+XEJv+kKEAEo+u4QVSe95RbnKBvG71Q4BpmWP/I38GCfe7VAEQgmNiW/wRM19 ltlh3Ws1n+7doiVU= X-Received: by 2002:a05:600c:218d:: with SMTP id e13mr4741077wme.127.1583412355474; Thu, 05 Mar 2020 04:45:55 -0800 (PST) X-Google-Smtp-Source: ADFU+vs1oX/E7fiCsD5PzTUeaRwCXmsMRvTr+x5pc79kbnj7zmdYKLg5JMMhcW6UJhtQzYxketXY/Q== X-Received: by 2002:a05:600c:218d:: with SMTP id e13mr4741057wme.127.1583412355279; Thu, 05 Mar 2020 04:45:55 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-trivial@nongnu.org, qemu-devel@nongnu.org Subject: [PATCH v2 5/9] hw/net/e1000: Move macreg[] arrays to .rodata to save 1MiB of .data Date: Thu, 5 Mar 2020 13:45:21 +0100 Message-Id: <20200305124525.14555-6-philmd@redhat.com> X-Mailer: git-send-email 2.21.1 In-Reply-To: <20200305124525.14555-1-philmd@redhat.com> References: <20200305124525.14555-1-philmd@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 205.139.110.61 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Dmitry Fleytman , Jason Wang , Christian Schoenebeck , Greg Kurz , Gerd Hoffmann , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Stefano Garzarella Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8"; text/plain; charset="utf-8" Each array consumes 256KiB of .data. As we do not reassign entries, we can move it to the .rodata section, and save a total of 1MiB of .data (size reported on x86_64 host). Reviewed-by: Dmitry Fleytman Reviewed-by: Stefano Garzarella Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/net/e1000.c | 4 ++-- hw/net/e1000e_core.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/net/e1000.c b/hw/net/e1000.c index 972d9b5083..9233248c9a 100644 --- a/hw/net/e1000.c +++ b/hw/net/e1000.c @@ -1151,7 +1151,7 @@ set_ims(E1000State *s, int index, uint32_t val) =20 #define getreg(x) [x] =3D mac_readreg typedef uint32_t (*readops)(E1000State *, int); -static readops macreg_readops[] =3D { +static const readops macreg_readops[] =3D { getreg(PBA), getreg(RCTL), getreg(TDH), getreg(TXDCTL), getreg(WUFC), getreg(TDT), getreg(CTRL), getreg(LEDCTL), getreg(MANC), getreg(MDIC), getreg(SWSM), getreg(STATUS), @@ -1207,7 +1207,7 @@ enum { NREADOPS =3D ARRAY_SIZE(macreg_readops) }; =20 #define putreg(x) [x] =3D mac_writereg typedef void (*writeops)(E1000State *, int, uint32_t); -static writeops macreg_writeops[] =3D { +static const writeops macreg_writeops[] =3D { putreg(PBA), putreg(EERD), putreg(SWSM), putreg(WUFC), putreg(TDBAL), putreg(TDBAH), putreg(TXDCTL), putreg(RDBAH), putreg(RDBAL), putreg(LEDCTL), putreg(VET), putreg(FCRUC), diff --git a/hw/net/e1000e_core.c b/hw/net/e1000e_core.c index 38bdb90114..df957e0c1a 100644 --- a/hw/net/e1000e_core.c +++ b/hw/net/e1000e_core.c @@ -2856,7 +2856,7 @@ e1000e_set_gcr(E1000ECore *core, int index, uint32_t = val) =20 #define e1000e_getreg(x) [x] =3D e1000e_mac_readreg typedef uint32_t (*readops)(E1000ECore *, int); -static readops e1000e_macreg_readops[] =3D { +static const readops e1000e_macreg_readops[] =3D { e1000e_getreg(PBA), e1000e_getreg(WUFC), e1000e_getreg(MANC), @@ -3063,7 +3063,7 @@ enum { E1000E_NREADOPS =3D ARRAY_SIZE(e1000e_macreg_r= eadops) }; =20 #define e1000e_putreg(x) [x] =3D e1000e_mac_writereg typedef void (*writeops)(E1000ECore *, int, uint32_t); -static writeops e1000e_macreg_writeops[] =3D { +static const writeops e1000e_macreg_writeops[] =3D { e1000e_putreg(PBA), e1000e_putreg(SWSM), e1000e_putreg(WUFC), --=20 2.21.1 From nobody Mon Oct 6 14:42:37 2025 Delivered-To: importer@patchew.org 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; Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1583412567; cv=none; d=zohomail.com; s=zohoarc; b=W3GdVhN8wDIsLG/OoticnVOBSU6ElTagbkhjZGmGSlsWMA4AQzWqEiV1X5EXgfGVAB+7/i8mwRtLcgIA+HokvKD6gg+4euRi5Pi2fRw8srXK5nGmHmWS+ByAs06Z0sl76fj1XEAvPe3LIyXU+oB+3dkumzNxTNO2lgPMqxTHs6Q= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1583412567; 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; bh=BfL2wrp1xmfb4e/iaQpRjnEbNuM8Iy0Ua18MeCip/nA=; b=kTmcmXz5oQp0x1Cd46RwWFO4aoXzmAyWGi9gNO/+HgCIn8hIWY9oq9clot3P9AIpKfpR3QSLvxTKp8v23VczzpLnMNvuHj4f0jQwWEiVZQSBJv5Kc8FbtfrraHS+VMNRuE0JrSPiDZ8uJ0APfSOOnwu1sy3dXhhO5gOGsyg+zWk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1583412567107608.1464657748178; Thu, 5 Mar 2020 04:49:27 -0800 (PST) Received: from localhost ([::1]:48374 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j9pwM-0004Pb-5B for importer@patchew.org; Thu, 05 Mar 2020 07:49:26 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:41763) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j9pt7-0007NN-Kv for qemu-devel@nongnu.org; Thu, 05 Mar 2020 07:46:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j9pt6-0001bi-Dk for qemu-devel@nongnu.org; Thu, 05 Mar 2020 07:46:05 -0500 Received: from us-smtp-2.mimecast.com ([205.139.110.61]:38156 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1j9pt6-0001b6-9H for qemu-devel@nongnu.org; Thu, 05 Mar 2020 07:46:04 -0500 Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-20-H9dQGy4OPBGMq5WN70j7lg-1; Thu, 05 Mar 2020 07:46:02 -0500 Received: by mail-wr1-f69.google.com with SMTP id p11so2255787wrn.10 for ; Thu, 05 Mar 2020 04:46:02 -0800 (PST) Received: from localhost.localdomain (47.red-88-21-205.staticip.rima-tde.net. [88.21.205.47]) by smtp.gmail.com with ESMTPSA id z12sm17054451wrs.43.2020.03.05.04.45.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Mar 2020 04:46:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1583412363; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=BfL2wrp1xmfb4e/iaQpRjnEbNuM8Iy0Ua18MeCip/nA=; b=Z4bFPt15GH4RT06GeGeyeyZwS16pPZMLQG0Zkq5EDkaJPVUdji6oIr3q7BEA6hz8BtNn+y rw50v75zc/zOATP5Oa1u7orIYFFCbb1Imh/KLIo1WAundc4duwssRIDz094J3LXWbk1e8c uJLOpT3JIqCmcklBGRvGJr4fCx57Obc= X-MC-Unique: H9dQGy4OPBGMq5WN70j7lg-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=cOfgZg45p005Cf8aNVaFJuLhPI+JdhyWRao0wzg6LoM=; b=kFoFRPYahhvk91z/Bz46XBTIDPHJ97T0ms3Q1CcdvftdlndharpeCq0y1XflRSpTMw Xe2NqAHxSp+UAQI5qQI1RhytsAb2U/+QyrkR1xKWRVzgJcNdtbaCAMB4ru/8S241IgdC K4CL7D8HYnoZk2TGc42ttUbr3R2/O4NnjUE3MsuHFS50fjf7W/9S5nZ2d+JxfaCAQiEO y0M30dHr1ir68HmjH68pjZxATP5uyLK679mRZ9CGEGF6+ycOqym6v/kY+VDRWRGCk3vy O1WKw7rlIWj+4TzTcWa/V1MwyYIYMs69P2tQ0HZOGOMgn8cC6Lz7eTWtfx3eskqPomOL MEDA== X-Gm-Message-State: ANhLgQ0yBSyhYcsWZXphUVAHXEcQ0WfAl60PkUyxtWNWXdsr+lgEYOLr zQzCOTs6NiR/OevF6Vyt5EmakV2aPQajq+kAXaFy5qLNVWk+eT5oYDwdywt+NFFUEP0tU+nKp35 AnCAhuv1MyIJjkoY= X-Received: by 2002:a7b:ce99:: with SMTP id q25mr9353857wmj.34.1583412360850; Thu, 05 Mar 2020 04:46:00 -0800 (PST) X-Google-Smtp-Source: ADFU+vtYQ3Fcji41liGZ4F/ZeQyFAYO+TfPXs7EPSdszQCv1mrO1EYqxHjHgHw9ceMByt1uuFupuDw== X-Received: by 2002:a7b:ce99:: with SMTP id q25mr9353820wmj.34.1583412360562; Thu, 05 Mar 2020 04:46:00 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-trivial@nongnu.org, qemu-devel@nongnu.org Subject: [PATCH v2 6/9] hw/usb/quirks: Use smaller types to reduce .rodata by 10KiB Date: Thu, 5 Mar 2020 13:45:22 +0100 Message-Id: <20200305124525.14555-7-philmd@redhat.com> X-Mailer: git-send-email 2.21.1 In-Reply-To: <20200305124525.14555-1-philmd@redhat.com> References: <20200305124525.14555-1-philmd@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 205.139.110.61 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Dmitry Fleytman , Jason Wang , Christian Schoenebeck , Greg Kurz , Gerd Hoffmann , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Stefano Garzarella Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8"; text/plain; charset="utf-8" The USB descriptor sizes are specified as 16-bit for idVendor / idProduct, and 8-bit for bInterfaceClass / bInterfaceSubClass / bInterfaceProtocol. Doing so we reduce the usbredir_raw_serial_ids[] and usbredir_ftdi_serial_ids[] arrays from 16KiB to 6KiB (size reported on x86_64 host, building with --extra-cflags=3D-Os). Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- v2: Add bitfield values and use unsigned types (Gerd) --- hw/usb/quirks.h | 22 +++++++++++++--------- hw/usb/quirks.c | 4 ++-- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/hw/usb/quirks.h b/hw/usb/quirks.h index 89480befd7..50ef2f9c2e 100644 --- a/hw/usb/quirks.h +++ b/hw/usb/quirks.h @@ -21,19 +21,23 @@ #include "quirks-pl2303-ids.h" =20 struct usb_device_id { - int vendor_id; - int product_id; - int interface_class; - int interface_subclass; - int interface_protocol; + uint16_t vendor_id; + uint16_t product_id; + uint8_t interface_class; + uint8_t interface_subclass; + uint8_t interface_protocol; + uint8_t interface_protocol_used:1, + terminating_entry:1, + reserved:6; }; =20 #define USB_DEVICE(vendor, product) \ - .vendor_id =3D vendor, .product_id =3D product, .interface_class =3D -= 1, + .vendor_id =3D vendor, .product_id =3D product, .interface_protocol_us= ed =3D 0, =20 #define USB_DEVICE_AND_INTERFACE_INFO(vend, prod, iclass, isubclass, iprot= o) \ .vendor_id =3D vend, .product_id =3D prod, .interface_class =3D iclass= , \ - .interface_subclass =3D isubclass, .interface_protocol =3D iproto + .interface_subclass =3D isubclass, .interface_protocol =3D iproto, \ + .interface_protocol_used =3D 1 =20 static const struct usb_device_id usbredir_raw_serial_ids[] =3D { /* @@ -206,7 +210,7 @@ static const struct usb_device_id usbredir_raw_serial_i= ds[] =3D { { USB_DEVICE(ADLINK_VENDOR_ID, ADLINK_ND6530_PRODUCT_ID) }, { USB_DEVICE(SMART_VENDOR_ID, SMART_PRODUCT_ID) }, =20 - { USB_DEVICE(-1, -1) } /* Terminating Entry */ + { .terminating_entry =3D 1 } /* Terminating Entry */ }; =20 static const struct usb_device_id usbredir_ftdi_serial_ids[] =3D { @@ -906,7 +910,7 @@ static const struct usb_device_id usbredir_ftdi_serial_= ids[] =3D { { USB_DEVICE(FTDI_VID, FTDI_DISTORTEC_JTAG_LOCK_PICK_PID) }, { USB_DEVICE(FTDI_VID, FTDI_LUMEL_PD12_PID) }, =20 - { USB_DEVICE(-1, -1) } /* Terminating Entry */ + { .terminating_entry =3D 1 } /* Terminating Entry */ }; =20 #undef USB_DEVICE diff --git a/hw/usb/quirks.c b/hw/usb/quirks.c index 38a9c5634a..23ea7a23ea 100644 --- a/hw/usb/quirks.c +++ b/hw/usb/quirks.c @@ -22,10 +22,10 @@ static bool usb_id_match(const struct usb_device_id *id= s, uint8_t interface_protocol) { int i; =20 - for (i =3D 0; ids[i].vendor_id !=3D -1; i++) { + for (i =3D 0; ids[i].terminating_entry =3D=3D 0; i++) { if (ids[i].vendor_id =3D=3D vendor_id && ids[i].product_id =3D=3D product_id && - (ids[i].interface_class =3D=3D -1 || + (ids[i].interface_protocol_used =3D=3D 0 || (ids[i].interface_class =3D=3D interface_class && ids[i].interface_subclass =3D=3D interface_subclass && ids[i].interface_protocol =3D=3D interface_protocol))) { --=20 2.21.1 From nobody Mon Oct 6 14:42:37 2025 Delivered-To: importer@patchew.org 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; Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1583412529; cv=none; d=zohomail.com; s=zohoarc; b=Bx8aFwNStyOgiM4dXvnlAHrsyPl7ibUGRAKCrXao2sIFSpJfnwTrHwBg3fb9SbpF2EL9mk5bNjvVVE1+78BGDJpTFURaK6XfarqHFE8CC0PEZt2gczZgSxrkttHpGi5sl8LVqaiV00iUWgZJ9PSWEN+2ghiPBqp5hejM8IoP4QM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1583412529; 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; bh=CFcihQRQW984a0z/mekZG0vNwXsxhiN/8+AlkGU0X9k=; b=nB/XCIQ3s8g9qsBsh+LY/5UA18X1JL3We9ptpUxPRwEbrmZCBrvk5atI05ZXtRFmAh6aibRLx/TZFsI2ShXkA1afvMgtjgi4TnFTZ2gVmPZJHRtL+jOs6qDT4PWLLkQAhA+Y9wH1XXtt0VOcdsxB8+1+bT21D/6IF53k62i4iT8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1583412529720515.1965143706553; Thu, 5 Mar 2020 04:48:49 -0800 (PST) Received: from localhost ([::1]:48368 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j9pvk-0003Wx-Mn for importer@patchew.org; Thu, 05 Mar 2020 07:48:48 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:41794) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j9ptC-0007VO-8l for qemu-devel@nongnu.org; Thu, 05 Mar 2020 07:46:11 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j9ptB-0001hx-CR for qemu-devel@nongnu.org; Thu, 05 Mar 2020 07:46:10 -0500 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:39623 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1j9ptB-0001hS-8w for qemu-devel@nongnu.org; Thu, 05 Mar 2020 07:46:09 -0500 Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-428--SSzPZvrMQ23pLLWQoIX2Q-1; Thu, 05 Mar 2020 07:46:07 -0500 Received: by mail-wr1-f69.google.com with SMTP id u8so273486wrq.13 for ; Thu, 05 Mar 2020 04:46:07 -0800 (PST) Received: from localhost.localdomain (47.red-88-21-205.staticip.rima-tde.net. [88.21.205.47]) by smtp.gmail.com with ESMTPSA id s15sm19858655wrr.45.2020.03.05.04.46.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Mar 2020 04:46:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1583412368; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=CFcihQRQW984a0z/mekZG0vNwXsxhiN/8+AlkGU0X9k=; b=LXZF6hxkRfrgJrPJPqdv3y0FvtkYPXEc95IEAzYNVH+roOc4gO3pZlb0pA/PXfo/e3rsom +soeu/fMh7p9YMvUGtfambVdlE7fmXZU4FrfYarYz1VS2oiemEw3hAU+usVOAM4O6Y7fes WbSd+K7Yv/fd7IGPlTOwc8Rg+1CbZmE= X-MC-Unique: -SSzPZvrMQ23pLLWQoIX2Q-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=NxwSRvf3xC8N2g5o+oXCsfEFodIN9fcThiRrbeywMlg=; b=o7PSfusuSPcNi5lhCyQMjMLhZ61ui8VX6woEc9oHJ4OHTO0WwpnbIFh/2x8Ypl7IEu A+8vsC+H8aWUaiP2ECSEqy0vZDjdxHf7veNb2ghNVbv/VYzv9awzsYsiEj72QBGSVeJ2 nyG36/ICZtqlFOjaJ5wJtLw7Pnz6hFSsM5Evz4enre3uzzE8bF3MZLxX7+v9raolRWwJ 5Yw5vg+DsK5V7meo0SFOhtX/IcWnIXtyZFILBtrry5ZlVJNy39zb6QpsjmY5eHyje0Jk 24ft7RfNzp75oVMAp73DhxcSePx8cDATny2uWdOwmaD2hQHPtBGBQzwFb1xGVWEWX3DL 0KCg== X-Gm-Message-State: ANhLgQ1o+Ju4N3bsV6JQ8XGOznff4L88NpDVi5W7v2vL7w0baIYH9pE4 E2bLY8PGdg1Qy3op01uIkrulRWSA11qQrjEkfFbvEifbPcA4w4tAk8f9I2e1cFxsb5TaUYeTe4/ OEEMGiC9yUF2swCk= X-Received: by 2002:a7b:c5cd:: with SMTP id n13mr9396188wmk.172.1583412366070; Thu, 05 Mar 2020 04:46:06 -0800 (PST) X-Google-Smtp-Source: ADFU+vtEolt81viS5nizZiXUpufL+W79KWORVOPU66RVR7yAROIfUMT4WtGb5nf8YINqFgi/mzUU9A== X-Received: by 2002:a7b:c5cd:: with SMTP id n13mr9396172wmk.172.1583412365912; Thu, 05 Mar 2020 04:46:05 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-trivial@nongnu.org, qemu-devel@nongnu.org Subject: [PATCH v2 7/9] ui/curses: Make control_characters[] array const Date: Thu, 5 Mar 2020 13:45:23 +0100 Message-Id: <20200305124525.14555-8-philmd@redhat.com> X-Mailer: git-send-email 2.21.1 In-Reply-To: <20200305124525.14555-1-philmd@redhat.com> References: <20200305124525.14555-1-philmd@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 205.139.110.120 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Dmitry Fleytman , Jason Wang , Christian Schoenebeck , Greg Kurz , Gerd Hoffmann , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Stefano Garzarella Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8"; text/plain; charset="utf-8" As we only use this array as input, make it const. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Stefano Garzarella --- ui/curses.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/curses.c b/ui/curses.c index 3a1b71451c..3bafc10c1c 100644 --- a/ui/curses.c +++ b/ui/curses.c @@ -529,7 +529,7 @@ static void font_setup(void) * Control characters are normally non-printable, but VGA does have * well-known glyphs for them. */ - static uint16_t control_characters[0x20] =3D { + static const uint16_t control_characters[0x20] =3D { 0x0020, 0x263a, 0x263b, --=20 2.21.1 From nobody Mon Oct 6 14:42:37 2025 Delivered-To: importer@patchew.org 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; Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1583412853; cv=none; d=zohomail.com; s=zohoarc; b=QyhzEbebfxrCppjj2jFMvggOjyWKu70SqPKwsTUCjwPT3cwt/dY50692WMIkX4sZ6zFImUhpNbsSwunW55Vcw5VeMz+mVDdV2EyhG3FJH9l1n0NFkXokXlg6GHO27JI5X5s5J3zj7HfuzRfnEjLINBqGYf50oma44ouvOJ5QNcE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1583412853; 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; bh=bHjWSXQJGHXqNSVRp2m+ndgaVWWtzd8pKBpNi2noriY=; b=XhCPDsfxstZo9scisQmulsrfFU2NXk6oV0X2TsoonPrcIdXL/10cuacUDlFzsTUIbB/nRXgdyEBNo60yLM8Mj2SuB5x4oB6BstlriqjjiMp9GFTotlWTXgQ/lOTo662PF3qEwm8Slvq/jYTc+/rRW6gtyl++SqP51LMYlUysQ/o= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1583412853735950.7758995769361; Thu, 5 Mar 2020 04:54:13 -0800 (PST) Received: from localhost ([::1]:48518 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j9q0y-0004D3-Mn for importer@patchew.org; Thu, 05 Mar 2020 07:54:12 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:41835) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j9ptH-0007bk-LL for qemu-devel@nongnu.org; Thu, 05 Mar 2020 07:46:16 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j9ptG-0001mP-M9 for qemu-devel@nongnu.org; Thu, 05 Mar 2020 07:46:15 -0500 Received: from us-smtp-2.mimecast.com ([207.211.31.81]:46563 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1j9ptG-0001mJ-J0 for qemu-devel@nongnu.org; Thu, 05 Mar 2020 07:46:14 -0500 Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-215-9d7VKVjiMzC7hnrtXTy9-g-1; Thu, 05 Mar 2020 07:46:12 -0500 Received: by mail-wm1-f69.google.com with SMTP id 7so2033004wmo.7 for ; Thu, 05 Mar 2020 04:46:12 -0800 (PST) Received: from localhost.localdomain (47.red-88-21-205.staticip.rima-tde.net. [88.21.205.47]) by smtp.gmail.com with ESMTPSA id r12sm9493551wrw.77.2020.03.05.04.46.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Mar 2020 04:46:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1583412374; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=bHjWSXQJGHXqNSVRp2m+ndgaVWWtzd8pKBpNi2noriY=; b=icWHILUMfHGiRIMH+8LQ3lLAU9/Eq+mopmOdCsFMeCQwDyF3iD0r9NA/0p5X7xWW6WohBn QmvP//+7PpyZQkY0VVqoz4hyjwGe42pdKJkqrdI+GTDsHuu5Ak8hQdeZp5ca1MHtMOJyd8 c+apTWfqv7zW4T5Lh1GaZmpvCoUAEdw= X-MC-Unique: 9d7VKVjiMzC7hnrtXTy9-g-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=37TekRuQ1Sj7bzipU9xMQGxHx7Oe/Uk9FNfgupkTT1U=; b=Ihshiq1QR0i3zYBgCFnTEuNee0aTeqQouZhwysqM10Zt/XxCBA8/u9beoyrHk2blgP +ZLuguDDB2RZbm04cN0r6i1H52rvmLWx1qGJ80Vj9ZqTP7xURQwW0di1kBOjNX7P/Kvj CewrPGJYSam01yNziVHRJtmWmX0AMlUM5h8EK3wyB7IXjqw0TJd49Ar2w1p1TgTH/HNi GdxMabZWnjOGf8cWNn8SCNdmTsg76YTvWWJaVaBRCAYIbCw7XyFer/hWtALni9S6NG6o 8clMABtLZUMcFS+R5Z7kjg9yvFaag6lmscQtbb7cWPKua0a/YRch9tLVZRQoFj2h+8Oo AeFg== X-Gm-Message-State: ANhLgQ35Tuhqr9egYW61YPzuHtxGKhEUyFhLTDguAWWIqHrUBMI41jkb pbhqUPfjB9G1fYdTCrdEIeXynnTmFPjqQwkWOkwg6BCGKw6V0cJzNDxO9n/91/FpTE/GNVxRfsj +fzb1CJCEw/FVIhQ= X-Received: by 2002:a5d:6544:: with SMTP id z4mr9651516wrv.31.1583412371623; Thu, 05 Mar 2020 04:46:11 -0800 (PST) X-Google-Smtp-Source: ADFU+vvVrt/Sswq4FSHm0E1EBtr0g0kjYs6V37K0HOy2fXC7aQIxGtsR2optAa52Vkzx0QP0QDKzXQ== X-Received: by 2002:a5d:6544:: with SMTP id z4mr9651493wrv.31.1583412371400; Thu, 05 Mar 2020 04:46:11 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-trivial@nongnu.org, qemu-devel@nongnu.org Subject: [PATCH v2 8/9] ui/curses: Move arrays to .heap to save 74KiB of .bss Date: Thu, 5 Mar 2020 13:45:24 +0100 Message-Id: <20200305124525.14555-9-philmd@redhat.com> X-Mailer: git-send-email 2.21.1 In-Reply-To: <20200305124525.14555-1-philmd@redhat.com> References: <20200305124525.14555-1-philmd@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 207.211.31.81 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Dmitry Fleytman , Jason Wang , Christian Schoenebeck , Greg Kurz , Gerd Hoffmann , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Stefano Garzarella Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8"; text/plain; charset="utf-8" We only need these arrays when using the curses display. Move them from the .bss to the .heap (sizes reported on x86_64 host: screen[] is 64KiB, vga_to_curses 7KiB). Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- ui/curses.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ui/curses.c b/ui/curses.c index 3bafc10c1c..a59b23a9cf 100644 --- a/ui/curses.c +++ b/ui/curses.c @@ -54,13 +54,13 @@ enum maybe_keycode { }; =20 static DisplayChangeListener *dcl; -static console_ch_t screen[160 * 100]; +static console_ch_t *screen; static WINDOW *screenpad =3D NULL; static int width, height, gwidth, gheight, invalidate; static int px, py, sminx, sminy, smaxx, smaxy; =20 static const char *font_charset =3D "CP437"; -static cchar_t vga_to_curses[256]; +static cchar_t *vga_to_curses; =20 static void curses_update(DisplayChangeListener *dcl, int x, int y, int w, int h) @@ -405,6 +405,8 @@ static void curses_refresh(DisplayChangeListener *dcl) static void curses_atexit(void) { endwin(); + g_free(vga_to_curses); + g_free(screen); } =20 /* @@ -783,6 +785,8 @@ static void curses_display_init(DisplayState *ds, Displ= ayOptions *opts) if (opts->u.curses.charset) { font_charset =3D opts->u.curses.charset; } + screen =3D g_new0(console_ch_t, 160 * 100); + vga_to_curses =3D g_new0(cchar_t, 256); curses_setup(); curses_keyboard_setup(); atexit(curses_atexit); --=20 2.21.1 From nobody Mon Oct 6 14:42:37 2025 Delivered-To: importer@patchew.org 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; Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1583412735; cv=none; d=zohomail.com; s=zohoarc; b=b0R3sCWlNTA3hqZUnD8oWt3d5tuSJNSty0aIIpVNdsiN4k/7GCYmXzCESiiNpbrddaR9XEJG6jY9l6/3+jz745izOhcwopD0AwU/dS3vK62QkS51aJVV+zGoPMTw92DJgW/zy64+VVyHLPnU6gNQ8wjU0kyeUFsgKbvblkGoLfc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1583412735; 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; bh=PX36u3szPgZ2Q41knWXAoeXL+fhHmUrIIdFIn10MJtI=; b=YWRE6D1f+lTSWVJH/bc67xZ26Vg/648Ow3sVVxb3dxLflim4+8PNSA3MnN7VWjmnebBMjyPCyvPqiLPdxcFEgk8x2qLGYhEQcvXinSe+NR6kDEwkjyU78iG+RXSODnMKo/9g/xRZHsyRBe/LiTA9VXlQsG8qN4dYaTU5oULxscY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 15834127357041013.1253466025406; Thu, 5 Mar 2020 04:52:15 -0800 (PST) Received: from localhost ([::1]:48476 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j9pz4-0001O0-JN for importer@patchew.org; Thu, 05 Mar 2020 07:52:14 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:41880) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j9ptN-0007kf-HO for qemu-devel@nongnu.org; Thu, 05 Mar 2020 07:46:22 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j9ptM-0001pR-DD for qemu-devel@nongnu.org; Thu, 05 Mar 2020 07:46:21 -0500 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:51949 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1j9ptM-0001pC-9H for qemu-devel@nongnu.org; Thu, 05 Mar 2020 07:46:20 -0500 Received: from mail-ed1-f72.google.com (mail-ed1-f72.google.com [209.85.208.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-93-JK7X30X1NeKRKAZ99QGIGA-1; Thu, 05 Mar 2020 07:46:18 -0500 Received: by mail-ed1-f72.google.com with SMTP id d11so4280264eds.7 for ; Thu, 05 Mar 2020 04:46:17 -0800 (PST) Received: from localhost.localdomain (47.red-88-21-205.staticip.rima-tde.net. [88.21.205.47]) by smtp.gmail.com with ESMTPSA id q26sm1529544ejb.50.2020.03.05.04.46.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Mar 2020 04:46:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1583412380; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=PX36u3szPgZ2Q41knWXAoeXL+fhHmUrIIdFIn10MJtI=; b=Xk5phjzFY4/qeHNpugGsyn3awK2cUsg7BRv51zeAmrewZZbEXftUDw/MdC06f+yhlMAe+b baSEUUXlffXnL38uFSUNBmwnmnR6tRXq9RsOALHGaji1x1ELfgWuOnN8TW3VP+6hqSRKR1 a7bWd3Gl/jKfv6QiGPa9O8i14+lXUDU= X-MC-Unique: JK7X30X1NeKRKAZ99QGIGA-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=AaV1ZZro3f+XiD92hHRr5sJi0Jy1dhCplYtiC3TxZ9Q=; b=NisteF513YSRStQ2ksNywRutmUAtbtLOpexNK6hOh2UE0HtYKi4nUoXOKXL3uzbSVd oE0YrV3Uch4rVYJ/9+j+n7bJ0s9xOE3G7mX32OctGLqrL60XDSsKZfp1gG9QVt62AfCi zfePykFpXv8g2sa7rEyaGTDujGXr+OzEk9t4SPXPmR1DBzLmzH4n+H1wg1UBlygulBVh 9e6WWdrrVAneFdYkuRGEw6Hmh//SAPtpdu0Lxk1ZcFX7tNK5qsCGqESwqHdmWGTnsINn +sONUaPkkrGvcruiQ48sm5XZAjtxGMwcLkCQt1YYi9ptdpcN7QjchCSYOYrUxlcrUpS3 vlww== X-Gm-Message-State: ANhLgQ1STfqbFdxyQFYKsP8tNgqUuv3/e1buWJ32LYNp2UeefJ+KTvvd 1mKXi7t6ZPB0aIB8QoQjcJhXGM6PymSkkNFNUxCi25hlQ4PAqjfXJoHPaiJjpQhyXCm6XRkyaSr GMAyIxiSDonF52gQ= X-Received: by 2002:a17:907:20ae:: with SMTP id pw14mr5158861ejb.347.1583412376855; Thu, 05 Mar 2020 04:46:16 -0800 (PST) X-Google-Smtp-Source: ADFU+vsXzhx6R4H7sx/neIO4/kU2XBgcI7lnVex83myb4LLHWpAvKquZR8H+zNUYUqKhe7Q024X6Zw== X-Received: by 2002:a17:907:20ae:: with SMTP id pw14mr5158849ejb.347.1583412376669; Thu, 05 Mar 2020 04:46:16 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-trivial@nongnu.org, qemu-devel@nongnu.org Subject: [PATCH v2 9/9] virtfs-proxy-helper: Make the helper_opts[] array const Date: Thu, 5 Mar 2020 13:45:25 +0100 Message-Id: <20200305124525.14555-10-philmd@redhat.com> X-Mailer: git-send-email 2.21.1 In-Reply-To: <20200305124525.14555-1-philmd@redhat.com> References: <20200305124525.14555-1-philmd@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 207.211.31.120 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Dmitry Fleytman , Jason Wang , Christian Schoenebeck , Greg Kurz , Gerd Hoffmann , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Stefano Garzarella Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8"; text/plain; charset="utf-8" Reduce a bit the memory footprint by making the helper_opts[] array const. Reviewed-by: Stefano Garzarella Acked-by: Greg Kurz Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- fsdev/virtfs-proxy-helper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fsdev/virtfs-proxy-helper.c b/fsdev/virtfs-proxy-helper.c index aa1ab2590d..de061a8a0e 100644 --- a/fsdev/virtfs-proxy-helper.c +++ b/fsdev/virtfs-proxy-helper.c @@ -43,7 +43,7 @@ #define BTRFS_SUPER_MAGIC 0x9123683E #endif =20 -static struct option helper_opts[] =3D { +static const struct option helper_opts[] =3D { {"fd", required_argument, NULL, 'f'}, {"path", required_argument, NULL, 'p'}, {"nodaemon", no_argument, NULL, 'n'}, --=20 2.21.1