diff options
author | Brian Norris <computersforpeace@gmail.com> | 2013-10-11 13:37:38 -0400 |
---|---|---|
committer | Anatolij Gustschin <agust@denx.de> | 2013-10-30 17:56:10 -0400 |
commit | 7e198197ec878c720af4dc35c49c0c6a99b83f9f (patch) | |
tree | 06b48adb9577990574936d07c6a0f94333fbfd82 | |
parent | 2bf75084f6d9f9a91ba6e30a501ff070d8a1acf6 (diff) |
powerpc/mpc512x: remove unnecessary #if
Several functions are only ever referenced locally, so make them static.
Of those functions, many of them are protected by an #if. However, the
code which can compile fine in either case.
Now that (1) the unneeded code is marked 'static' and (2) the code is
only used under a C 'if (IS_ENABLED(CONFIG_FB_FSL_DIU))', the compiler
can automatically remove the unneeded code, and we don't need the #if or
the empty stub functions.
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Signed-off-by: Anatolij Gustschin <agust@denx.de>
-rw-r--r-- | arch/powerpc/platforms/512x/mpc512x_shared.c | 21 | ||||
-rw-r--r-- | arch/powerpc/sysdev/fsl_soc.h | 3 |
2 files changed, 7 insertions, 17 deletions
diff --git a/arch/powerpc/platforms/512x/mpc512x_shared.c b/arch/powerpc/platforms/512x/mpc512x_shared.c index 1a7b1d0f41df..36b5652aada2 100644 --- a/arch/powerpc/platforms/512x/mpc512x_shared.c +++ b/arch/powerpc/platforms/512x/mpc512x_shared.c | |||
@@ -60,8 +60,6 @@ void mpc512x_restart(char *cmd) | |||
60 | ; | 60 | ; |
61 | } | 61 | } |
62 | 62 | ||
63 | #if IS_ENABLED(CONFIG_FB_FSL_DIU) | ||
64 | |||
65 | struct fsl_diu_shared_fb { | 63 | struct fsl_diu_shared_fb { |
66 | u8 gamma[0x300]; /* 32-bit aligned! */ | 64 | u8 gamma[0x300]; /* 32-bit aligned! */ |
67 | struct diu_ad ad0; /* 32-bit aligned! */ | 65 | struct diu_ad ad0; /* 32-bit aligned! */ |
@@ -71,7 +69,7 @@ struct fsl_diu_shared_fb { | |||
71 | }; | 69 | }; |
72 | 70 | ||
73 | #define DIU_DIV_MASK 0x000000ff | 71 | #define DIU_DIV_MASK 0x000000ff |
74 | void mpc512x_set_pixel_clock(unsigned int pixclock) | 72 | static void mpc512x_set_pixel_clock(unsigned int pixclock) |
75 | { | 73 | { |
76 | unsigned long bestval, bestfreq, speed, busfreq; | 74 | unsigned long bestval, bestfreq, speed, busfreq; |
77 | unsigned long minpixclock, maxpixclock, pixval; | 75 | unsigned long minpixclock, maxpixclock, pixval; |
@@ -164,7 +162,7 @@ void mpc512x_set_pixel_clock(unsigned int pixclock) | |||
164 | iounmap(ccm); | 162 | iounmap(ccm); |
165 | } | 163 | } |
166 | 164 | ||
167 | enum fsl_diu_monitor_port | 165 | static enum fsl_diu_monitor_port |
168 | mpc512x_valid_monitor_port(enum fsl_diu_monitor_port port) | 166 | mpc512x_valid_monitor_port(enum fsl_diu_monitor_port port) |
169 | { | 167 | { |
170 | return FSL_DIU_PORT_DVI; | 168 | return FSL_DIU_PORT_DVI; |
@@ -179,7 +177,7 @@ static inline void mpc512x_free_bootmem(struct page *page) | |||
179 | free_reserved_page(page); | 177 | free_reserved_page(page); |
180 | } | 178 | } |
181 | 179 | ||
182 | void mpc512x_release_bootmem(void) | 180 | static void mpc512x_release_bootmem(void) |
183 | { | 181 | { |
184 | unsigned long addr = diu_shared_fb.fb_phys & PAGE_MASK; | 182 | unsigned long addr = diu_shared_fb.fb_phys & PAGE_MASK; |
185 | unsigned long size = diu_shared_fb.fb_len; | 183 | unsigned long size = diu_shared_fb.fb_len; |
@@ -205,7 +203,7 @@ void mpc512x_release_bootmem(void) | |||
205 | * address range will be reserved in setup_arch() after bootmem | 203 | * address range will be reserved in setup_arch() after bootmem |
206 | * allocator is up. | 204 | * allocator is up. |
207 | */ | 205 | */ |
208 | void __init mpc512x_init_diu(void) | 206 | static void __init mpc512x_init_diu(void) |
209 | { | 207 | { |
210 | struct device_node *np; | 208 | struct device_node *np; |
211 | struct diu __iomem *diu_reg; | 209 | struct diu __iomem *diu_reg; |
@@ -274,7 +272,7 @@ out: | |||
274 | iounmap(diu_reg); | 272 | iounmap(diu_reg); |
275 | } | 273 | } |
276 | 274 | ||
277 | void __init mpc512x_setup_diu(void) | 275 | static void __init mpc512x_setup_diu(void) |
278 | { | 276 | { |
279 | int ret; | 277 | int ret; |
280 | 278 | ||
@@ -303,11 +301,6 @@ void __init mpc512x_setup_diu(void) | |||
303 | diu_ops.release_bootmem = mpc512x_release_bootmem; | 301 | diu_ops.release_bootmem = mpc512x_release_bootmem; |
304 | } | 302 | } |
305 | 303 | ||
306 | #else | ||
307 | void __init mpc512x_setup_diu(void) { /* EMPTY */ } | ||
308 | void __init mpc512x_init_diu(void) { /* EMPTY */ } | ||
309 | #endif | ||
310 | |||
311 | void __init mpc512x_init_IRQ(void) | 304 | void __init mpc512x_init_IRQ(void) |
312 | { | 305 | { |
313 | struct device_node *np; | 306 | struct device_node *np; |
@@ -340,7 +333,7 @@ static struct of_device_id __initdata of_bus_ids[] = { | |||
340 | {}, | 333 | {}, |
341 | }; | 334 | }; |
342 | 335 | ||
343 | void __init mpc512x_declare_of_platform_devices(void) | 336 | static void __init mpc512x_declare_of_platform_devices(void) |
344 | { | 337 | { |
345 | if (of_platform_bus_probe(NULL, of_bus_ids, NULL)) | 338 | if (of_platform_bus_probe(NULL, of_bus_ids, NULL)) |
346 | printk(KERN_ERR __FILE__ ": " | 339 | printk(KERN_ERR __FILE__ ": " |
@@ -390,7 +383,7 @@ static unsigned int __init get_fifo_size(struct device_node *np, | |||
390 | ((u32)(_base) + sizeof(struct mpc52xx_psc))) | 383 | ((u32)(_base) + sizeof(struct mpc52xx_psc))) |
391 | 384 | ||
392 | /* Init PSC FIFO space for TX and RX slices */ | 385 | /* Init PSC FIFO space for TX and RX slices */ |
393 | void __init mpc512x_psc_fifo_init(void) | 386 | static void __init mpc512x_psc_fifo_init(void) |
394 | { | 387 | { |
395 | struct device_node *np; | 388 | struct device_node *np; |
396 | void __iomem *psc; | 389 | void __iomem *psc; |
diff --git a/arch/powerpc/sysdev/fsl_soc.h b/arch/powerpc/sysdev/fsl_soc.h index c6d00736f07f..4c5a19ef4f0b 100644 --- a/arch/powerpc/sysdev/fsl_soc.h +++ b/arch/powerpc/sysdev/fsl_soc.h | |||
@@ -21,8 +21,6 @@ struct device_node; | |||
21 | 21 | ||
22 | extern void fsl_rstcr_restart(char *cmd); | 22 | extern void fsl_rstcr_restart(char *cmd); |
23 | 23 | ||
24 | #if defined(CONFIG_FB_FSL_DIU) || defined(CONFIG_FB_FSL_DIU_MODULE) | ||
25 | |||
26 | /* The different ports that the DIU can be connected to */ | 24 | /* The different ports that the DIU can be connected to */ |
27 | enum fsl_diu_monitor_port { | 25 | enum fsl_diu_monitor_port { |
28 | FSL_DIU_PORT_DVI, /* DVI */ | 26 | FSL_DIU_PORT_DVI, /* DVI */ |
@@ -43,7 +41,6 @@ struct platform_diu_data_ops { | |||
43 | }; | 41 | }; |
44 | 42 | ||
45 | extern struct platform_diu_data_ops diu_ops; | 43 | extern struct platform_diu_data_ops diu_ops; |
46 | #endif | ||
47 | 44 | ||
48 | void fsl_hv_restart(char *cmd); | 45 | void fsl_hv_restart(char *cmd); |
49 | void fsl_hv_halt(void); | 46 | void fsl_hv_halt(void); |