Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp1265550pxf; Fri, 12 Mar 2021 06:05:54 -0800 (PST) X-Google-Smtp-Source: ABdhPJySFzp1yhMGjMe/c6cS1rnTmmlSxQ96m4a4tbj7D6LaW4AIq8RFncds3oiV3v8e6HJDzFwG X-Received: by 2002:a5d:56d0:: with SMTP id m16mr14093698wrw.355.1615557954504; Fri, 12 Mar 2021 06:05:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615557954; cv=none; d=google.com; s=arc-20160816; b=pfMFq/R0L0vdba5Vei1u1+Shaf+AlCEl2yBt1fXYs4o2diNun6nN8r21wLF7hHgTlT qIKEb6uFNGD6b7I4ZZUZLtEVokMhjJuNS1ug9mhjOarVvmwAoC635mYLa0v8HncbAmCe ELJu7VVfzunDznIMASnLWAfkTSFTbP33F33V4B6oGo9piu6epn+4Bbg/V6vbJsjCrH5r Q+Gms/SH2p4Ua8eSWhmdhhJJ6BJTX1KGz0y+EakkjgRJqK0LFnLUH9h6RF6Ah2pUnzum oY5gQaK1s4GGXNyoEFybi7zjqxp7KB17Rvo/Ovcxln9lWaXgj33QQCYE+PGnANbe4pFe 1O1A== 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=6bdcrp8jEQRIYpIYmeR6zTGfcMfNI/RUbuD60AYfiWU=; b=hKv3BKWxuDefJ54lmIjpXXIBztyCZAxOLWToJDDv54TN4BzVAvJ9TOEm40+DXM7r2+ WjF8o93Q5Wotp97w5/wCE/guxeExwgb39GWivdVSq0MH3dwaSN2jNiNcxfrlLnLGth9s Er3SoGIgiurz+uYBjH8qGfHlRUyMV9d8PmTNP16keBAkq0IBs2sZNeop2raXWz8UgbLy eSWum7HYyYX+ehy+8+P81zdTH5C3JxOnRo7EjWGQoS7Zp2AsCrWglWBcK1iCFuu+vHAd kGGTePkLfLnBBcwPduSVm1bvUl+noNGUvoq0SzbIIKBt9z28Yfd4BVDY6HkxOkQsl+gz qiBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@pm.me header.s=protonmail header.b=MsapHekv; 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 e24si4016300ejc.739.2021.03.12.06.05.24; Fri, 12 Mar 2021 06:05:54 -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=MsapHekv; 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 S231657AbhCLOBk (ORCPT + 99 others); Fri, 12 Mar 2021 09:01:40 -0500 Received: from mail-40133.protonmail.ch ([185.70.40.133]:35580 "EHLO mail-40133.protonmail.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231216AbhCLOBh (ORCPT ); Fri, 12 Mar 2021 09:01:37 -0500 Date: Fri, 12 Mar 2021 14:01:28 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pm.me; s=protonmail; t=1615557695; bh=6bdcrp8jEQRIYpIYmeR6zTGfcMfNI/RUbuD60AYfiWU=; h=Date:To:From:Cc:Reply-To:Subject:From; b=MsapHekvCsRYuYBJmOk0iwNl5ykMCr2ngPWgHMCw+ClwXi15eoC9qRhNc81DB+jzN t1v4kQN2APxDYeMOVvoJ3N/FkLrU6hOWpuGP8Z40aIQFMGnabkQE3BIk5XBfStkJQI 58UtGs5qFMUdThykappT814MTpbx/ixnchSn0ww7+WeM/0lIVfXXKdRo3JCN7R42v8 wBezVcudDB4LbyH0spoU5IOs+6PyJ3pj32035WoAAWsvK9d5qOer+631oz+UlGV5kK bpUTU13gDnlHqE7aEQ0p+0WserW6QUaiLbu/zuwbwz2eWyx7LCgKhoViFzu02qZmuN RfFMywdj4k9Ig== 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 RESEND] PCI: dwc: put struct dw_pcie::{ep,pp} into a union to reduce its size Message-ID: <20210312140116.9453-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 7247c8b01f04..ca8aeba548ab 100644 --- a/drivers/pci/controller/dwc/pcie-designware.h +++ b/drivers/pci/controller/dwc/pcie-designware.h @@ -266,8 +266,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; -- 2.30.2