Skip to contentSkip to conversation

drm/komeda: Clean warning 'komeda_component_add' might be a candidate for 'gnu_printf'

PATCH In review james qian wang (Arm Technology China) 2 participants 2 messages Aug 13, 2019 – Aug 22, 2019

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/komeda: Clean warning 'komeda_component_add' might be a candidate for 'gnu_printf'

komeda/komeda_pipeline.c: In function 'komeda_component_add':
komeda/komeda_pipeline.c:212:3: warning: function 'komeda_component_add' might be a candidate for 'gnu_printf' format attribute [-Wsuggest-attribute=format]
vsnprintf(c->name, sizeof(c->name), name_fmt, args);
^~~~~~~~~

---
 drivers/gpu/drm/arm/display/komeda/komeda_pipeline.h | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/arm/display/komeda/komeda_pipeline.h +1 -0
index a90bcbb3cb23..14b683164544 100644
@@ -480,6 +480,7 @@ void komeda_pipeline_dump_register(struct komeda_pipeline *pipe,
 				   struct seq_file *sf);
 
 /* component APIs */
+extern __printf(10, 11)
 struct komeda_component *
 komeda_component_add(struct komeda_pipeline *pipe,
 		     size_t comp_sz, u32 id, u32 hw_id,
Signature · 1 line
2.20.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 15 lines · james qian wang (Arm Technology China)

komeda/komeda_pipeline.c: In function 'komeda_component_add':
komeda/komeda_pipeline.c:212:3: warning: function 'komeda_component_add' might be a candidate for 'gnu_printf' format attribute [-Wsuggest-attribute=format]

   vsnprintf(c->name, sizeof(c->name), name_fmt, args);
   ^~~~~~~~~
---
 drivers/gpu/drm/arm/display/komeda/komeda_pipeline.h | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/arm/display/komeda/komeda_pipeline.h +0 -0
index a90bcbb3cb23..14b683164544 100644

drivers/gpu/drm/arm/display/komeda/komeda_pipeline.h void komeda_pipeline_dump_register(struct komeda_pipeline *pipe, · line 483

Quoted 4 lines
drivers/gpu/drm/arm/display/komeda/komeda_pipeline.h +1 -0
@@ -480,6 +480,7 @@ void komeda_pipeline_dump_register(struct komeda_pipeline *pipe,
 				   struct seq_file *sf);
 
 /* component APIs */
+extern __printf(10, 11)

Took me a while to understand this and found this link very helpful :) :-
https://www.avrfreaks.net/forum/gnuprintf-format-attribute

Quoted 5 lines
drivers/gpu/drm/arm/display/komeda/komeda_pipeline.h +0 -0
 struct komeda_component *
 komeda_component_add(struct komeda_pipeline *pipe,
 		     size_t comp_sz, u32 id, u32 hw_id,
Signature · 1 line
2.20.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel