From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755419AbdDLUwB (ORCPT ); Wed, 12 Apr 2017 16:52:01 -0400 Received: from mail.kernel.org ([198.145.29.136]:35300 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751131AbdDLUv7 (ORCPT ); Wed, 12 Apr 2017 16:51:59 -0400 MIME-Version: 1.0 In-Reply-To: <20170412044156.17351-3-f.fainelli@gmail.com> References: <20170412044156.17351-1-f.fainelli@gmail.com> <20170412044156.17351-3-f.fainelli@gmail.com> From: Rob Herring Date: Wed, 12 Apr 2017 15:51:34 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 2/3] net: macb: Remove CONFIG_OF around DT match table To: Florian Fainelli Cc: "linux-kernel@vger.kernel.org" , Andrew Lunn , Vivien Didelot , Lee Jones , Nicolas Ferre , Frank Rowand , "open list:NETWORKING DRIVERS" , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE" Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 11, 2017 at 11:41 PM, Florian Fainelli wrote: > A subsequent patch is going to make of_match_node() an inline stub when > CONFIG_OF is disabled, which will let the compiler eliminate unused variables. > In order not to clutter the code more, remove the CONFIG_OF #ifdef such that > macb_dt_ids and what it references are always defined. > > Signed-off-by: Florian Fainelli > --- > drivers/net/ethernet/cadence/macb.c | 2 -- > 1 file changed, 2 deletions(-) > > diff --git a/drivers/net/ethernet/cadence/macb.c b/drivers/net/ethernet/cadence/macb.c > index 30606b11b128..01016e9525ee 100644 > --- a/drivers/net/ethernet/cadence/macb.c > +++ b/drivers/net/ethernet/cadence/macb.c > @@ -2811,7 +2811,6 @@ static int macb_init(struct platform_device *pdev) > return 0; > } > > -#if defined(CONFIG_OF) > /* 1518 rounded up */ > #define AT91ETHER_MAX_RBUFF_SZ 0x600 > /* max number of receive buffers */ > @@ -3215,7 +3214,6 @@ static const struct of_device_id macb_dt_ids[] = { > { /* sentinel */ } > }; > MODULE_DEVICE_TABLE(of, macb_dt_ids); Did you actually check that the compiler can eliminate things when modules are enabled? Because it's not going to be able to eliminate MODULE_DEVICE_TABLE entry AFAICT. Rob From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rob Herring Subject: Re: [PATCH v2 2/3] net: macb: Remove CONFIG_OF around DT match table Date: Wed, 12 Apr 2017 15:51:34 -0500 Message-ID: References: <20170412044156.17351-1-f.fainelli@gmail.com> <20170412044156.17351-3-f.fainelli@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Cc: "linux-kernel@vger.kernel.org" , Andrew Lunn , Vivien Didelot , Lee Jones , Nicolas Ferre , Frank Rowand , "open list:NETWORKING DRIVERS" , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE" To: Florian Fainelli Return-path: Received: from mail.kernel.org ([198.145.29.136]:35300 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751131AbdDLUv7 (ORCPT ); Wed, 12 Apr 2017 16:51:59 -0400 In-Reply-To: <20170412044156.17351-3-f.fainelli@gmail.com> Sender: netdev-owner@vger.kernel.org List-ID: On Tue, Apr 11, 2017 at 11:41 PM, Florian Fainelli wrote: > A subsequent patch is going to make of_match_node() an inline stub when > CONFIG_OF is disabled, which will let the compiler eliminate unused variables. > In order not to clutter the code more, remove the CONFIG_OF #ifdef such that > macb_dt_ids and what it references are always defined. > > Signed-off-by: Florian Fainelli > --- > drivers/net/ethernet/cadence/macb.c | 2 -- > 1 file changed, 2 deletions(-) > > diff --git a/drivers/net/ethernet/cadence/macb.c b/drivers/net/ethernet/cadence/macb.c > index 30606b11b128..01016e9525ee 100644 > --- a/drivers/net/ethernet/cadence/macb.c > +++ b/drivers/net/ethernet/cadence/macb.c > @@ -2811,7 +2811,6 @@ static int macb_init(struct platform_device *pdev) > return 0; > } > > -#if defined(CONFIG_OF) > /* 1518 rounded up */ > #define AT91ETHER_MAX_RBUFF_SZ 0x600 > /* max number of receive buffers */ > @@ -3215,7 +3214,6 @@ static const struct of_device_id macb_dt_ids[] = { > { /* sentinel */ } > }; > MODULE_DEVICE_TABLE(of, macb_dt_ids); Did you actually check that the compiler can eliminate things when modules are enabled? Because it's not going to be able to eliminate MODULE_DEVICE_TABLE entry AFAICT. Rob