Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1622553

Re: [PATCH v2 2/3] net: macb: Remove CONFIG_OF around DT match table

From Rob Herring <robh+dt@kernel.org>
Newsgroups linux.kernel
Subject Re: [PATCH v2 2/3] net: macb: Remove CONFIG_OF around DT match table
Date 2017-04-12 23:00 +0200
Message-ID <tvxwS-15r-23@gated-at.bofh.it> (permalink)
References <tvio9-8sz-5@gated-at.bofh.it> <tvioa-8sz-9@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Tue, Apr 11, 2017 at 11:41 PM, Florian Fainelli <f.fainelli@gmail.com> 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 <f.fainelli@gmail.com>
> ---
>  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

Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v2 0/3] of: Make of_match_node() an inline stub for CONFIG_OF=n Florian Fainelli <f.fainelli@gmail.com> - 2017-04-12 06:50 +0200
  [PATCH v2 2/3] net: macb: Remove CONFIG_OF around DT match table Florian Fainelli <f.fainelli@gmail.com> - 2017-04-12 06:50 +0200
    Re: [PATCH v2 2/3] net: macb: Remove CONFIG_OF around DT match table Rob Herring <robh+dt@kernel.org> - 2017-04-12 23:00 +0200
  [PATCH v2 3/3] of: Make of_match_node() an inline stub for CONFIG_OF=n Florian Fainelli <f.fainelli@gmail.com> - 2017-04-12 06:50 +0200
    Re: [PATCH v2 3/3] of: Make of_match_node() an inline stub for  CONFIG_OF=n kbuild test robot <lkp@intel.com> - 2017-04-12 21:00 +0200
  Re: [PATCH v2 0/3] of: Make of_match_node() an inline stub for  CONFIG_OF=n David Miller <davem@davemloft.net> - 2017-04-12 16:30 +0200
  Re: [PATCH v2 0/3] of: Make of_match_node() an inline stub for  CONFIG_OF=n Frank Rowand <frowand.list@gmail.com> - 2017-04-13 05:50 +0200

csiph-web