Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp859689pxb; Sat, 16 Jan 2021 09:25:51 -0800 (PST) X-Google-Smtp-Source: ABdhPJwZLnzX+uKqb3gTCO8vNJO9micwy6xpkvRpaREje1XURmODkLBenjxZpw/eK5yCeAdwZTHF X-Received: by 2002:a17:906:dfd3:: with SMTP id jt19mr12466814ejc.64.1610817950906; Sat, 16 Jan 2021 09:25:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610817950; cv=none; d=google.com; s=arc-20160816; b=H6Cuo/2p4A0KXkZyngNlIhIG+6Gy5Qvjd04earkE4byOK7eYV6bp6rd1PwtKAR4NL0 J9uKKMWAzm04nAKlsNS+hAkTDvEQHeyIZorDnw6BYU/JdxB/wGIfsWSgBjO/W9XanYk7 peYeFx0g/gDRLkF9JwgICFweyZHrk6NhtGijqn6wTz7HgiGpa2fijTZgXOe2NwasUwbi D1zaW+0351GD27OjEeFPUPgW3EjzS43HPbuEyjyGctXPiOmNoWLSgs4EGXFGb3s1rRb4 vLAg5oWfeYtEgphIvtMVK48Cpmv9zRgmNNHXgmFFOnyjMuDZXxrbD5O0r3yxPRn6sfRz Ef6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:subject:reply-to:cc:from:to:dkim-signature:date; bh=ewLrxUjradkPA1ru1Wz2k9bHtjXJsODmOn92IB7cjQE=; b=Rnl6gJtsgUR23g1VSN1NfJT4QpRyeY8rUEe1VYFENJnvujSwa5yfsy/366l9u55IB1 ls9im+m5CUy/rWzcrLs3MDnkJr3b+I3W8kc7Lu+9nNsvt4S/XnxVPnVngXGU8mfalo4p nEOJNL63W0X4lJYHJoAzKtfgkY2WDSW9tsn6VT2VuXwwjDON833+TnKGSFizh7iH5A7L RF97z6IW3/GkR+DAqcoR2UKsTVKc2p55nmLYUZ62DKjsULbiszZ9tfTfCTU0JZ3fNycI 3tjU8HY53z9AUaEnRK7se+uTuESv3G/occLPt1Xz046l8swXjoWJwHK7EQYHyMWKaSls XRvg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@pm.me header.s=protonmail header.b=GY1ol3C9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=pm.me Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id oq12si4529962ejb.335.2021.01.16.09.25.27; Sat, 16 Jan 2021 09:25:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@pm.me header.s=protonmail header.b=GY1ol3C9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=pm.me Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726917AbhAPRYr (ORCPT + 99 others); Sat, 16 Jan 2021 12:24:47 -0500 Received: from mail-41104.protonmail.ch ([185.70.41.104]:26806 "EHLO mail-41104.protonmail.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726395AbhAPRYq (ORCPT ); Sat, 16 Jan 2021 12:24:46 -0500 Received: from mail-02.mail-europe.com (mail-02.mail-europe.com [51.89.119.103]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by mail-41104.protonmail.ch (Postfix) with ESMTPS id 4E6F3200576A for ; Sat, 16 Jan 2021 15:29:02 +0000 (UTC) Authentication-Results: mail-41104.protonmail.ch; dkim=pass (2048-bit key) header.d=pm.me header.i=@pm.me header.b="GY1ol3C9" Date: Sat, 16 Jan 2021 15:27:33 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pm.me; s=protonmail; t=1610810857; bh=ewLrxUjradkPA1ru1Wz2k9bHtjXJsODmOn92IB7cjQE=; h=Date:To:From:Cc:Reply-To:Subject:From; b=GY1ol3C9eZiVNw2YFAP0h7hmKMQ5WULAQN33gm4LWs4zvT7US/paN1oaHFkxGnne8 RyalSLdFtHfXvgwY/6DFnEf7C1Dsv8YIEfc74JTA07/fcwBLPBJPOUdSizKaqlw4rV TVXFVwEWLfhmbDatVyZUgv3VDsjSPpcQtRx5O0CBzJonzTdL0WMmfoNNJbQnZHtH3N YScFQwe2vKKdZuYgO70Ae7JKMkmWJi3QWTEftsx+Hg2FjhM/U3EsUMVAXJYceTKLJE ZC0p8FkkbKECoGfAMjihEByW6n0dDeV/3I4t6YEcjxQ48jiUv3/Dfnf8TZVz+jST82 ZCJM7weNrwaWg== To: Lorenzo Pieralisi , Bjorn Helgaas From: Alexander Lobakin Cc: Jingoo Han , Gustavo Pimentel , Rob Herring , Alexander Lobakin , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org Reply-To: Alexander Lobakin Subject: [PATCH pci-next] PCI: dwc: put struct dw_pcie::{ep,pp} into a union to reduce its size Message-ID: <20210116152711.23411-1-alobakin@pm.me> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.2 required=10.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF shortcircuit=no autolearn=disabled version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on mailout.protonmail.ch Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org A single dw_pcie entity can't be a root complex and an endpoint at the same time. We can use this to reduce the size of dw_pcie by 80, from 280 to 200 bytes (on x32, guess more on x64), by putting the related embedded structures (struct pcie_port and struct dw_pcie_ep) into a union. Signed-off-by: Alexander Lobakin --- drivers/pci/controller/dwc/pcie-designware.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/pci/controller/dwc/pcie-designware.h b/drivers/pci/con= troller/dwc/pcie-designware.h index 5d979953800d..924ebeaa3885 100644 --- a/drivers/pci/controller/dwc/pcie-designware.h +++ b/drivers/pci/controller/dwc/pcie-designware.h @@ -265,8 +265,10 @@ struct dw_pcie { =09size_t=09=09=09atu_size; =09u32=09=09=09num_ib_windows; =09u32=09=09=09num_ob_windows; -=09struct pcie_port=09pp; -=09struct dw_pcie_ep=09ep; +=09union { +=09=09struct pcie_port=09pp; +=09=09struct dw_pcie_ep=09ep; +=09}; =09const struct dw_pcie_ops *ops; =09unsigned int=09=09version; =09int=09=09=09num_lanes; --=20 2.30.0