linux/drivers/clk/ti
Behan Webster e8627a9ec3 clk: ti: LLVMLinux: Move __init outside of type definition
As written, the __init for ti_clk_get_div_table is in the middle of the return
type.

The gcc documentation indicates that section attributes should be added to the
end of the function declaration:

  extern void foobar (void) __attribute__ ((section ("bar")));

However gcc seems to be very permissive with where attributes can be placed.
clang on the other hand isn't so permissive, and fails if you put the section
definition in the middle of the return type:

drivers/clk/ti/divider.c:298:28: error: expected ';' after struct
static struct clk_div_table
                           ^
                           ;
drivers/clk/ti/divider.c:298:1: warning: 'static' ignored on this
      declaration [-Wmissing-declarations]
static struct clk_div_table
^
drivers/clk/ti/divider.c:299:9: error: type specifier missing,
      defaults to 'int' [-Werror,-Wimplicit-int]
__init *ti_clk_get_div_table(struct device_node *node)
~~~~~~  ^
drivers/clk/ti/divider.c:345:9: warning: incompatible pointer types
      returning 'struct clk_div_table *' from a function with result type 'int *' [-Wincompatible-pointer-types]
        return table;
               ^~~~~
drivers/clk/ti/divider.c:419:9: warning: incompatible pointer types
      assigning to 'const struct clk_div_table *' from 'int *' [-Wincompatible-pointer-types]
        *table = ti_clk_get_div_table(node);
               ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~
3 warnings and 2 errors generated.

By convention, most of the kernel code puts section attributes between the
return type and function name. In the case where the return type is a pointer,
it's important to place the '*' on left of the __init.

This updated code works for both gcc and clang.

Signed-off-by: Behan Webster <behanw@converseincode.com>
Reviewed-by: Mark Charlebois <charlebm@gmail.com>
Reviewed-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Tero Kristo <t-kristo@ti.com>
2014-09-29 11:51:14 +03:00
..
apll.c clk: ti: dra7: return error code in failure case 2014-06-19 14:52:31 +03:00
autoidle.c CLK: TI: add autoidle support 2014-01-17 12:34:59 -08:00
clk-2xxx.c ARM: OMAP2: clock: add DT boot support for cpufreq_ck 2014-05-28 13:05:57 +03:00
clk-3xxx.c mfd: omap-usb-host: Get clocks based on hardware revision 2014-03-13 22:23:51 +00:00
clk-7xx.c The clock framework changes for 3.17 are mostly additions of new clock 2014-08-04 11:44:20 -07:00
clk-33xx.c clk: ti: am335x: remove unecessary cpu0 clk node 2014-02-24 22:56:38 -08:00
clk-43xx.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2014-06-12 14:27:40 -07:00
clk-44xx.c CLK: TI: OMAP4/5/DRA7: Remove gpmc_fck from dummy clocks 2014-03-13 13:41:50 -07:00
clk-54xx.c CLK: TI: clk-54xx: Set the rate for dpll_abe_m2x2_ck 2014-06-06 20:33:34 +03:00
clk-dra7-atl.c clk: ti: dra7-atl-clock: fix a memory leak 2014-09-29 11:51:13 +03:00
clk.c clk: ti: change clock init to use generic of_clk_init 2014-09-29 11:51:13 +03:00
clockdomain.c clk: ti: consider the fact that of_clk_get() might return an error 2014-09-29 11:51:13 +03:00
composite.c clk: ti: add support for basic mux clock 2014-01-17 12:35:17 -08:00
divider.c clk: ti: LLVMLinux: Move __init outside of type definition 2014-09-29 11:51:14 +03:00
dpll.c clk: ti: am43x: Fix boot with CONFIG_SOC_AM33XX disabled 2014-06-19 14:52:31 +03:00
fixed-factor.c clk: ti: add support for TI fixed factor clock 2014-01-17 12:35:07 -08:00
gate.c Merge branch 'for-v3.16/ti-clk-drv' of github.com:t-kristo/linux-pm into clk-next 2014-06-10 16:53:25 -07:00
interface.c CLK: TI: interface: add support for omap2430 specific interface clock 2014-05-28 12:30:12 +03:00
Makefile CLK: TI: Driver for DRA7 ATL (Audio Tracking Logic) 2014-05-28 13:06:54 +03:00
mux.c clk: ti: set CLK_SET_RATE_NO_REPARENT for ti,mux-clock 2014-06-19 14:52:32 +03:00