Thread (4 messages) 4 messages, 2 authors, 2016-01-14

Re: [PATCH] of: drop symbols declared by _OF_DECLARE() from modules

flat view

From: Masahiro Yamada <hidden>
Date: 2016-01-14 10:21:28
Also in: linux-arm-kernel, lkml

Hi Arnd,

2016-01-14 19:14 GMT+09:00 Arnd Bergmann [off-list ref]:
On Thursday 14 January 2016 13:33:06 Masahiro Yamada wrote:
quoted

-#ifdef CONFIG_OF
+#if defined(CONFIG_OF) && !defined(MODULE)
 #define _OF_DECLARE(table, name, compat, fn, fn_type)                  \
        static const struct of_device_id __of_table_##name              \
                __used __section(__##table##_of_table)                  \
--
Doesn't this lead to "unused function" warnings? Maybe we can change the "__used"
into "__unused" when MODULE is set,
Yes, this is my intention.

I think this patch does so,
unless I am missing something...


  #if defined(CONFIG_OF) && !defined(MODULE)
          __used
  #else
          __unused
  #endif


so the compiler will automatically
drop all code that is only referenced from the entry.

-- 
Best Regards
Masahiro Yamada
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help