Skip to contentSkip to conversation

driver core: add __printf verification to device_create_groups_vargs

PATCH New Mathieu Malaterre 1 participant 1 message May 5, 2018 Driver core

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 driver core: add __printf verification to device_create_groups_vargs

__printf is useful to verify format and arguments. Remove the following warning (with W=1):

drivers/base/core.c:2435:2: warning: function might be possible candidate for ‘gnu_printf’ format attribute [-Wsuggest-attribute=format]

---
 drivers/base/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/base/core.c +1 -1
index b610816eb887..357e774ba13b 100644
@@ -2406,7 +2406,7 @@ static void device_create_release(struct device *dev)
 	kfree(dev);
 }
 
-static struct device *
+static __printf(6, 0) struct device *
 device_create_groups_vargs(struct class *class, struct device *parent,
 			   dev_t devt, void *drvdata,
 			   const struct attribute_group **groups,
Signature · 1 line
2.11.0