• Arnd Bergmann's avatar
    clk: define to_clk_regmap() as inline function · 8d8c3131
    Arnd Bergmann authored
    Nesting container_of() causes warnings with W=2, which is
    annoying if it happens in headers and fills the build log
    like:
    
    In file included from drivers/clk/qcom/clk-alpha-pll.c:6:
    drivers/clk/qcom/clk-alpha-pll.c: In function 'clk_alpha_pll_hwfsm_enable':
    include/linux/kernel.h:852:8: warning: declaration of '__mptr' shadows a previous local [-Wshadow]
      852 |  void *__mptr = (void *)(ptr);     \
          |        ^~~~~~
    drivers/clk/qcom/clk-alpha-pll.c:155:31: note: in expansion of macro 'container_of'
      155 | #define to_clk_alpha_pll(_hw) container_of(to_clk_regmap(_hw), \
          |                               ^~~~~~~~~~~~
    drivers/clk/qcom/clk-regmap.h:27:28: note: in expansion of macro 'container_of'
       27 | #define to_clk_regmap(_hw) container_of(_hw, struct clk_regmap, hw)
          |                            ^~~~~~~~~~~~
    drivers/clk/qcom/clk-alpha-pll.c:155:44: note: in expansion of macro 'to_clk_regmap'
      155 | #define to_clk_alpha_pll(_hw) container_of(to...
    8d8c3131
clk-regmap.h 3.61 KB