]> www.infradead.org Git - nvme.git/commitdiff
ARM: 9445/1: clkdev: Mark some functions with __printf() attribute
authorAndy Shevchenko <andy.shevchenko@gmail.com>
Mon, 24 Mar 2025 19:46:51 +0000 (20:46 +0100)
committerRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
Wed, 26 Mar 2025 13:31:49 +0000 (13:31 +0000)
Some of the functions are using printf() type of format, and
compiler is not happy about them as is:

clkdev.c:185:17: error: function ‘vclkdev_alloc’ might be a candidate for  gnu_printf’ format attribute [-Werror=suggest-attribute=format]
clkdev.c:224:9: error: function ‘vclkdev_create’ might be a candidate for  gnu_printf’ format attribute [-Werror=suggest-attribute=format]
clkdev.c:314:9: error: function ‘__clk_register_clkdev’ might be a candidate for ‘gnu_printf’ format attribute [-Werror=suggest-attribute=format]

Fix the compilation errors by adding __printf() attributes.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
drivers/clk/clkdev.c

index 2f83fb97c6fbe8aac766fc19865b0fe3ba1ca9c6..e0bede6350e1183caf53692cb6f32a7e8c6085d7 100644 (file)
@@ -153,7 +153,7 @@ struct clk_lookup_alloc {
        char    con_id[MAX_CON_ID];
 };
 
-static struct clk_lookup * __ref
+static __printf(3, 0) struct clk_lookup * __ref
 vclkdev_alloc(struct clk_hw *hw, const char *con_id, const char *dev_fmt,
        va_list ap)
 {
@@ -215,7 +215,7 @@ fail:
        return &cla->cl;
 }
 
-static struct clk_lookup *
+static __printf(3, 0) struct clk_lookup *
 vclkdev_create(struct clk_hw *hw, const char *con_id, const char *dev_fmt,
        va_list ap)
 {
@@ -303,9 +303,8 @@ void clkdev_drop(struct clk_lookup *cl)
 }
 EXPORT_SYMBOL(clkdev_drop);
 
-static struct clk_lookup *__clk_register_clkdev(struct clk_hw *hw,
-                                               const char *con_id,
-                                               const char *dev_id, ...)
+static __printf(3, 4) struct clk_lookup *
+__clk_register_clkdev(struct clk_hw *hw, const char *con_id, const char *dev_id, ...)
 {
        struct clk_lookup *cl;
        va_list ap;