From patchwork Mon Feb 13 10:10:46 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: 653195 Delivered-To: patch@linaro.org Received: by 2002:adf:f90f:0:0:0:0:0 with SMTP id b15csp2326077wrr; Mon, 13 Feb 2023 02:12:41 -0800 (PST) X-Google-Smtp-Source: AK7set9RHNa82UygmLdDLU2roCVQ7HMOKYs+aFW7HZIJHXaYsQNSoRnrZLq8/EWJQpZKHUzY29zQ X-Received: by 2002:a05:6214:c8a:b0:537:632d:11d1 with SMTP id r10-20020a0562140c8a00b00537632d11d1mr26695694qvr.25.1676283161729; Mon, 13 Feb 2023 02:12:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676283161; cv=none; d=google.com; s=arc-20160816; b=bqZV2bOGzqgJ7rLXO4ZRtAgRrqepTO7fv9wYIK1Ku4gjrM/rwKIQDimQPsZoAp3jOx TQ2ebRD76Vj3DpD+lJlTa4rZl/tyS+UAIWmCy/b1v9RHfpobWO69asKcXf4GAFo2EPwi YRjiAS6uIynG9TzH8SVOyVT7Hc8D+UdcU11jtD/PdMyI3f7xG7xMEq6AxoiB3aPy5h4E i7224onz/mH2hpp1CoUYafwBbAEg62yNjN4JWDmxtPFXBhYb+MgOsOxCa3eB6f3m+N5w QLSDQDX8GSoVTq2EfIPFoXjlGmHFfcp7o8iJ9GcrSYfvV58aeEgaWv9FhnGHkB3w8gpj HmHw== 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=OEDmvV7dprZjnBDzVsTadk4Q695IfZynhRqx282ioKQ=; b=PxNcpFLcpsJMTcf9rz++kaSfLJi7xx32Hr0anhJofk4Vj9TJZN6sQmhZAwB6kb1h4Z HHpeNJKNgPkjpOhEl8iN+5A5q8nhDCt4LYJptR7TM4PXq0a9SLPmSt5iAXUl9qZ7Z0uI V7+Gff74EPL7Kp9aMvaRdp0vEMlfj2uOC9PZYt6Z3K7CIXL/ckguhiiIwXloRNbHMoNA lg/xgoQMlVsK4zN/a/i/sZHhuqouE6UGUJhpLCw3KqjwpgCkyW5XlzDTRpATFegUBI8d HlTBRMuMyAlQdzktSi/XqNvjrVvo449Ap6V+XZz/GeiEVP2TAEYD65Euibqn7lOILlIG b+bw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=bA1SEdkA; 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 b3-20020a0cf043000000b0056ea2d1633csi3736324qvl.513.2023.02.13.02.12.41 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 13 Feb 2023 02:12:41 -0800 (PST) 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=bA1SEdkA; 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 1pRVnx-0005er-DJ; Mon, 13 Feb 2023 05:11:25 -0500 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 1pRVnu-0005dP-K8 for qemu-devel@nongnu.org; Mon, 13 Feb 2023 05:11:22 -0500 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pRVnq-0003W3-IL for qemu-devel@nongnu.org; Mon, 13 Feb 2023 05:11:20 -0500 Received: by mail-wm1-x334.google.com with SMTP id n33so2296609wms.0 for ; Mon, 13 Feb 2023 02:11:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; 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=OEDmvV7dprZjnBDzVsTadk4Q695IfZynhRqx282ioKQ=; b=bA1SEdkAHr2a/FzF5KBg9EU55JU492UcPPUxDTOWBjnDa/fwmXQPy7eLNmOrDx93Tl XHHZnv3dUNkTgjEDXU2wfI/KzOif6Bb4A1BQgKI1kfAYQqgDfJLbLn2tGeorG192W4sE aUGUN/RAfDWfgGfAIqScoE8nNpq/HkVLwCE7exqnIhX3ZlgPPOJCvQAYkCZWKsApWGWk s51xxOSIxEWQyWN2VCf6Z0y7HUHgh2v5i3l2V1EPK7Sm5RbKGQuDyAX3OBUE59DDreND dctDupndlXzxcGPq9nEOETpU8fbhRWetNxxMbqvhEwMCVmxeXqOVgO0tV43USRF2xrY3 xS1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=OEDmvV7dprZjnBDzVsTadk4Q695IfZynhRqx282ioKQ=; b=vqat6jxHKf2JdTnpNdaN3Rkc7DC/dEWR3Gw0dwO3oDpzU7DXky6UTC8tqebYPaOAZb 6cRZafAEEmdi4CPUfXF1GehGnjPpkBYeCx9xmPCDHbxULKAgly98T4cIOv+ZKJXCLcFS 7NeqlTPOnpl8qSTlLHYqOhHeLeRqfjKHaah3O0CCUnmf20uY0g4GQrB95htv0TF2c0tU YW7qWB5Iew4JZh4za28M53INW+ASAU9aDG2B3H2FvYq5IUyLLaJtLWVlFQM5NVlzt4CS D9MvFJBvoERBuMtMyrs8ME0AtrK5nVnBHZ+yMXQTxnhoH1cLGzBTPe/FocUcQVz325rR Gnow== X-Gm-Message-State: AO0yUKVodChu0qHLPWldYpDjvMQXYcskkuS12UGbPQHTjegF0ciMRt1b 1gphp7O72CrGpjAJaaFp3YRLH+WsILa5mxAr X-Received: by 2002:a05:600c:181d:b0:3e0:c0d:75d8 with SMTP id n29-20020a05600c181d00b003e00c0d75d8mr20716066wmp.23.1676283075044; Mon, 13 Feb 2023 02:11:15 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id p14-20020a1c544e000000b003db06493ee7sm17381648wmi.47.2023.02.13.02.11.14 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 13 Feb 2023 02:11:14 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Eduardo Habkost Cc: Jason Wang , Thomas Huth , Igor Mammedov , Stefan Weil , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH v2 5/7] hw/net/eepro100: Remove instance EEPRO100State::has_extended_tcb_support Date: Mon, 13 Feb 2023 11:10:46 +0100 Message-Id: <20230213101048.94519-6-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230213101048.94519-1-philmd@linaro.org> References: <20230213101048.94519-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::334; envelope-from=philmd@linaro.org; helo=mail-wm1-x334.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org 'has_extended_tcb_support' is accessed read-only and is present in the class definition. No need to duplicate it in the instance state. Directly access the class field. Signed-off-by: Philippe Mathieu-Daudé --- hw/net/eepro100.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/net/eepro100.c b/hw/net/eepro100.c index ab20558a18..d7757907c3 100644 --- a/hw/net/eepro100.c +++ b/hw/net/eepro100.c @@ -292,7 +292,6 @@ struct EEPRO100State { /* Quasi static device properties (no need to save them). */ uint16_t stats_size; - bool has_extended_tcb_support; }; /* Word indices in EEPROM. */ @@ -511,7 +510,6 @@ static void e100_pci_reset(DeviceState *dev) pci_set_byte(pci_conf + PCI_MAX_LAT, 0x18); s->stats_size = info->stats_size; - s->has_extended_tcb_support = info->has_extended_tcb_support; switch (device) { case i82550: @@ -746,6 +744,8 @@ static void read_cb(EEPRO100State *s) static void tx_command(EEPRO100State *s) { + EEPRO100Class *ek = EEPRO100_GET_CLASS(s); + const E100PCIDeviceInfo *info = ek->info; const MemTxAttrs attrs = MEMTXATTRS_UNSPECIFIED; uint32_t tbd_array = s->tx.tbd_array_addr; uint16_t tcb_bytes = s->tx.tcb_bytes & 0x3fff; @@ -782,7 +782,7 @@ static void tx_command(EEPRO100State *s) uint16_t tx_buffer_size; uint16_t tx_buffer_el; - if (s->has_extended_tcb_support && !(s->configuration[6] & BIT(4))) { + if (info->has_extended_tcb_support && !(s->configuration[6] & BIT(4))) { /* Extended Flexible TCB. */ for (; tbd_count < 2; tbd_count++) { ldl_le_pci_dma(&s->dev, tbd_address, &tx_buffer_address, attrs);