diff options
author | Geert Uytterhoeven <geert+renesas@glider.be> | 2014-08-20 09:26:35 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-09-24 02:32:50 -0400 |
commit | bef59c5024be687ef4f228915af9961307a779ab (patch) | |
tree | 9ca8c7108389038f9f2a8369673371d360b3b315 /include/linux/device.h | |
parent | 54270354b518952da934ee1c7e13ed1c9654fd22 (diff) |
devres: Improve devm_kasprintf()/kvasprintf() support
- Add devm_kasprintf()/kvasprintf(), introduced by commit
75f2a4ead5d5890ada9c2663a70fb58613c0d9f2 ("devres: Add
devm_kasprintf and devm_kvasprintf API"), to
Documentation/driver-model/devres.txt,
- Improve kernel doc: the string is not an existing formatted string,
but is formatted into the newly-allocated buffer,
- Add a __printf() annotation to devm_kasprintf(), so the compiler
will verify the format string argument types.
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/linux/device.h')
-rw-r--r-- | include/linux/device.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/include/linux/device.h b/include/linux/device.h index 43d183aeb25b..a608e237f0a8 100644 --- a/include/linux/device.h +++ b/include/linux/device.h | |||
@@ -607,8 +607,8 @@ extern int devres_release_group(struct device *dev, void *id); | |||
607 | extern void *devm_kmalloc(struct device *dev, size_t size, gfp_t gfp); | 607 | extern void *devm_kmalloc(struct device *dev, size_t size, gfp_t gfp); |
608 | extern char *devm_kvasprintf(struct device *dev, gfp_t gfp, const char *fmt, | 608 | extern char *devm_kvasprintf(struct device *dev, gfp_t gfp, const char *fmt, |
609 | va_list ap); | 609 | va_list ap); |
610 | extern char *devm_kasprintf(struct device *dev, gfp_t gfp, | 610 | extern __printf(3, 4) |
611 | const char *fmt, ...); | 611 | char *devm_kasprintf(struct device *dev, gfp_t gfp, const char *fmt, ...); |
612 | static inline void *devm_kzalloc(struct device *dev, size_t size, gfp_t gfp) | 612 | static inline void *devm_kzalloc(struct device *dev, size_t size, gfp_t gfp) |
613 | { | 613 | { |
614 | return devm_kmalloc(dev, size, gfp | __GFP_ZERO); | 614 | return devm_kmalloc(dev, size, gfp | __GFP_ZERO); |