Re: [PATCH v2 0/4] clk: hisilicon: Migrate devm APIs

From: Stephen Boyd
Date: Wed Apr 05 2023 - 15:41:08 EST


Quoting David Yang (2023-03-29 00:50:49)
> Migrate devm APIs for HiSilicon clock drivers and remove redundant codes.
>
> This series is a partial improvement of [1]
>

Run checkpatch.pl

WARNING: Macros with flow control statements should be avoided
#591: FILE: drivers/clk/hisilicon/clk.c:146:
+#define hisi_clk_register_fn(fn, type, stmt) \
+int fn(struct device *dev, const struct type *clks, \
+ int num, struct hisi_clock_data *data) \
+{ \
+ void __iomem *base = data->base; \
+ int i; \
+\
+ for (i = 0; i < num; i++) { \
+ const struct type *p_clk = &clks[i]; \
+ struct clk_hw *clk = stmt; \
+\
+ if (IS_ERR(clk)) { \
+ pr_err("%s: failed to register clock %s\n", \
+ __func__, p_clk->name); \
+ return PTR_ERR(clk); \
+ } \
+\
+ if (p_clk->alias) \
+ clk_hw_register_clkdev(clk, p_clk->alias, NULL); \
+\
+ data->clk_data->hws[p_clk->id] = clk; \
+ } \
+\
+ return 0; \
+} \
+EXPORT_SYMBOL_GPL(fn);

WARNING: macros should not use a trailing semicolon
#591: FILE: drivers/clk/hisilicon/clk.c:146:
+#define hisi_clk_register_fn(fn, type, stmt) \
+int fn(struct device *dev, const struct type *clks, \
+ int num, struct hisi_clock_data *data) \
+{ \
+ void __iomem *base = data->base; \
+ int i; \
+\
+ for (i = 0; i < num; i++) { \
+ const struct type *p_clk = &clks[i]; \
+ struct clk_hw *clk = stmt; \
+\
+ if (IS_ERR(clk)) { \
+ pr_err("%s: failed to register clock %s\n", \
+ __func__, p_clk->name); \
+ return PTR_ERR(clk); \
+ } \
+\
+ if (p_clk->alias) \
+ clk_hw_register_clkdev(clk, p_clk->alias, NULL); \
+\
+ data->clk_data->hws[p_clk->id] = clk; \
+ } \
+\
+ return 0; \
+} \
+EXPORT_SYMBOL_GPL(fn);

total: 0 errors, 2 warnings, 1019 lines checked
in patch 'clk: hisilicon: Migrate devm APIs' (8d960cbef61a)
WARNING: Prefer "GPL" over "GPL v2" - see commit bf7fbeeae6db ("module: Cure the MODULE_LICENSE "GPL" vs. "GPL v2" bogosity")
#627: FILE: drivers/clk/hisilicon/clk-hi6220.c:291:
+MODULE_LICENSE("GPL v2");

WARNING: DT compatible string "hisilicon,hip04-clock" appears un-documented -- check ./Documentation/devicetree/bindings/
#661: FILE: drivers/clk/hisilicon/clk-hip04.c:33:
+ { .compatible = "hisilicon,hip04-clock",

WARNING: Prefer "GPL" over "GPL v2" - see commit bf7fbeeae6db ("module: Cure the MODULE_LICENSE "GPL" vs. "GPL v2" bogosity")
#842: FILE: drivers/clk/hisilicon/clk-hix5hd2.c:337:
+MODULE_LICENSE("GPL v2");

total: 0 errors, 3 warnings, 779 lines checked
in patch 'clk: hisilicon: Convert to platform driver' (2681347c2636)
WARNING: Prefer "GPL" over "GPL v2" - see commit bf7fbeeae6db ("module: Cure the MODULE_LICENSE "GPL" vs. "GPL v2" bogosity")
#1044: FILE: drivers/clk/hisilicon/clk-hi3670.c:935:
+MODULE_LICENSE("GPL v2");

total: 0 errors, 1 warnings, 1481 lines checked