Thread (7 messages) 7 messages, 3 authors, 2013-10-11

Re: [v1] powerpc/mpc512x: silence build warning upon disabled DIU

From: Brian Norris <computersforpeace@gmail.com>
Date: 2013-10-10 18:23:58

Hello,

On Thu, Oct 10, 2013 at 9:09 AM, Anatolij Gustschin [off-list ref] wrote:
On Wed, 9 Oct 2013 12:29:31 -0700
Brian Norris [off-list ref] wrote:
...
quoted
quoted
+#else
+void __init mpc512x_setup_diu(void) { /* EMPTY */ }
+void __init mpc512x_init_diu(void) { /* EMPTY */ }
 #endif

 void __init mpc512x_init_IRQ(void)
I see an alternative solution:

Can't almost all of the code in mpc512x_shared.c be declared 'static'?
making mpc512x_setup_diu(), mpc512x_release_bootmem(),
mpc512x_valid_monitor_port() and void mpc512x_set_pixel_clock()
should be okay.
And mpc512x_init_diu()?
quoted
Then, you can get the real benefit of IS_ENABLED() by removing the

    #if IS_ENABLED(CONFIG_FB_FSL_DIU)

from around all the DIU code, and it will automatically be removed by
the compiler when it is not used.

I think the current patch is necessary for immediate use, and it can be
sent to stable. But I might suggest a follow-up patch or 2 that makes
the functions static and kills the #ifdef entirely.
Yes, we also have to remove CONFIG_FB_FSL_DIU ifdef in
arch/powerpc/sysdev/fsl_soc.h and building should work then.
Still want it around this line, probably, so we'll get compiler errors
and not linker errors if someone tries to use it?

    extern struct platform_diu_data_ops diu_ops;

But otherwise that looks OK to me. Shall I send a patch?

Brian
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help