linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mac80211: use __printf attribute in debugfs
@ 2012-09-30 15:16 Johannes Berg
  2012-09-30 15:52 ` Joe Perches
  2012-10-15 12:54 ` Johannes Berg
  0 siblings, 2 replies; 4+ messages in thread
From: Johannes Berg @ 2012-09-30 15:16 UTC (permalink / raw)
  To: linux-wireless; +Cc: Johannes Berg

From: Johannes Berg <johannes.berg@intel.com>

The internal function mac80211_format_buffer() has a
printf-style argument list, so add the attribute to
have gcc verify that list.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 net/mac80211/debugfs.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/mac80211/debugfs.c b/net/mac80211/debugfs.c
index 466f4b4..b189ae2 100644
--- a/net/mac80211/debugfs.c
+++ b/net/mac80211/debugfs.c
@@ -17,8 +17,8 @@
 
 #define DEBUGFS_FORMAT_BUFFER_SIZE 100
 
-int mac80211_format_buffer(char __user *userbuf, size_t count,
-				  loff_t *ppos, char *fmt, ...)
+int __printf(4, 5) mac80211_format_buffer(char __user *userbuf, size_t count,
+					  loff_t *ppos, char *fmt, ...)
 {
 	va_list args;
 	char buf[DEBUGFS_FORMAT_BUFFER_SIZE];
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] mac80211: use __printf attribute in debugfs
  2012-09-30 15:16 [PATCH] mac80211: use __printf attribute in debugfs Johannes Berg
@ 2012-09-30 15:52 ` Joe Perches
  2012-10-01  7:21   ` Johannes Berg
  2012-10-15 12:54 ` Johannes Berg
  1 sibling, 1 reply; 4+ messages in thread
From: Joe Perches @ 2012-09-30 15:52 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linux-wireless, Johannes Berg

On Sun, 2012-09-30 at 17:16 +0200, Johannes Berg wrote:
> The internal function mac80211_format_buffer() has a
> printf-style argument list, so add the attribute to
> have gcc verify that list.
[]
> diff --git a/net/mac80211/debugfs.c b/net/mac80211/debugfs.c
[]
> @@ -17,8 +17,8 @@
[]
> -int mac80211_format_buffer(char __user *userbuf, size_t count,
> -				  loff_t *ppos, char *fmt, ...)
> +int __printf(4, 5) mac80211_format_buffer(char __user *userbuf, size_t count,
> +					  loff_t *ppos, char *fmt, ...)
>  {
>  	va_list args;
>  	char buf[DEBUGFS_FORMAT_BUFFER_SIZE];

Good idea, but this needs to be added to the prototype
in debugfs.h not on the function itself.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] mac80211: use __printf attribute in debugfs
  2012-09-30 15:52 ` Joe Perches
@ 2012-10-01  7:21   ` Johannes Berg
  0 siblings, 0 replies; 4+ messages in thread
From: Johannes Berg @ 2012-10-01  7:21 UTC (permalink / raw)
  To: Joe Perches; +Cc: linux-wireless

On Sun, 2012-09-30 at 08:52 -0700, Joe Perches wrote:
> On Sun, 2012-09-30 at 17:16 +0200, Johannes Berg wrote:
> > The internal function mac80211_format_buffer() has a
> > printf-style argument list, so add the attribute to
> > have gcc verify that list.
> []
> > diff --git a/net/mac80211/debugfs.c b/net/mac80211/debugfs.c
> []
> > @@ -17,8 +17,8 @@
> []
> > -int mac80211_format_buffer(char __user *userbuf, size_t count,
> > -				  loff_t *ppos, char *fmt, ...)
> > +int __printf(4, 5) mac80211_format_buffer(char __user *userbuf, size_t count,
> > +					  loff_t *ppos, char *fmt, ...)
> >  {
> >  	va_list args;
> >  	char buf[DEBUGFS_FORMAT_BUFFER_SIZE];
> 
> Good idea, but this needs to be added to the prototype
> in debugfs.h not on the function itself.

Oops, good catch, will fix that.

johannes


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] mac80211: use __printf attribute in debugfs
  2012-09-30 15:16 [PATCH] mac80211: use __printf attribute in debugfs Johannes Berg
  2012-09-30 15:52 ` Joe Perches
@ 2012-10-15 12:54 ` Johannes Berg
  1 sibling, 0 replies; 4+ messages in thread
From: Johannes Berg @ 2012-10-15 12:54 UTC (permalink / raw)
  To: linux-wireless

On Sun, 2012-09-30 at 17:16 +0200, Johannes Berg wrote:
> From: Johannes Berg <johannes.berg@intel.com>
> 
> The internal function mac80211_format_buffer() has a
> printf-style argument list, so add the attribute to
> have gcc verify that list.

Applied the fixed version.

johannes


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-10-15 12:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-30 15:16 [PATCH] mac80211: use __printf attribute in debugfs Johannes Berg
2012-09-30 15:52 ` Joe Perches
2012-10-01  7:21   ` Johannes Berg
2012-10-15 12:54 ` Johannes Berg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).