From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752827AbdKCORp (ORCPT ); Fri, 3 Nov 2017 10:17:45 -0400 Received: from bastet.se.axis.com ([195.60.68.11]:55108 "EHLO bastet.se.axis.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751736AbdKCORn (ORCPT ); Fri, 3 Nov 2017 10:17:43 -0400 Subject: Re: [PATCH v3 14/17] PCI: dwc: artpec6: Add support for endpoint mode To: Arnd Bergmann CC: Bjorn Helgaas , Jesper Nilsson , Kishon Vijay Abraham I , Jingoo Han , Shawn Guo , Peter Robinson , Xiaowei Song , linux-pci , Linux Kernel Mailing List , References: <20171031223936.27549-1-niklas.cassel@axis.com> <20171031223936.27549-15-niklas.cassel@axis.com> <5a8c7aaf-552c-7170-2a36-13b50168a9cc@axis.com> From: Niklas Cassel Message-ID: Date: Fri, 3 Nov 2017 15:16:20 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.0.5.60] X-ClientProxiedBy: XBOX02.axis.com (10.0.5.16) To XBOX02.axis.com (10.0.5.16) X-TM-AS-GCONF: 00 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/03/2017 11:23 AM, Arnd Bergmann wrote: > On Fri, Nov 3, 2017 at 10:56 AM, Niklas Cassel wrote: >> On 11/02/2017 10:13 AM, Arnd Bergmann wrote: > What I meant is that you can remove the #ifdef entirely if you add > > if (!IS_ENABLED(CONFIG_PCIE_ARTPEC6_HOST)) > return -ENODEV; > > to artpec6_pcie_probe(). Anything after that statement will get > silently dropped by the compiler, including static functions and > structures that are referenced indirectly from there. Wow, this actually helps gcc with dead code elimination. It was even possible to add those !IS_ENABLED the two different case labels in the switch statement. I get no unwanted symbols when looking at the vmlinux in gdb. Great suggestion Arnd :) Regards, Niklas