public inbox for b.a.t.m.a.n@lists.open-mesh.org
 help / color / mirror / Atom feed
From: Sven Eckelmann <sven@narfation.org>
To: b.a.t.m.a.n@lists.open-mesh.org
Subject: [B.A.T.M.A.N.] [PATCH] batman-adv: Avoid gcc inline problems with vararg functions
Date: Sat, 19 May 2012 09:37:55 +0200	[thread overview]
Message-ID: <1337413075-8853-1-git-send-email-sven@narfation.org> (raw)

gcc doesn't support the inlining of functions using vararg. Sparse fails to
build the source when having such functions marked using the keyword "inline".

This problem was introduced in 3b896e321c49e3cbbfd540f537c007db883c3900

Signed-off-by: Sven Eckelmann <sven@narfation.org>
---
 main.h |   20 +++++++++++++-------
 1 file changed, 13 insertions(+), 7 deletions(-)

diff --git a/main.h b/main.h
index 977de45..4721c86 100644
--- a/main.h
+++ b/main.h
@@ -196,6 +196,17 @@ static inline void batadv_vdbg(int type, struct bat_priv *bat_priv,
 		batadv_debug_log(bat_priv, fmt, args);
 }
 
+__printf(3, 4)
+static inline void batadv_dbg(int type, struct bat_priv *bat_priv,
+			       const char *fmt, ...)
+{
+	va_list args;
+
+	va_start(args, fmt);
+	batadv_vdbg(type, bat_priv, fmt, args);
+	va_end(args);
+}
+
 #else /* !CONFIG_BATMAN_ADV_DEBUG */
 
 static inline void batadv_vdbg(int type __always_unused,
@@ -205,19 +216,14 @@ static inline void batadv_vdbg(int type __always_unused,
 {
 }
 
-#endif
-
 __printf(3, 4)
 static inline void batadv_dbg(int type, struct bat_priv *bat_priv,
 			       const char *fmt, ...)
 {
-	va_list args;
-
-	va_start(args, fmt);
-	batadv_vdbg(type, bat_priv, fmt, args);
-	va_end(args);
 }
 
+#endif
+
 #define batadv_info(net_dev, fmt, arg...)				\
 	do {								\
 		struct net_device *_netdev = (net_dev);                 \
-- 
1.7.10


             reply	other threads:[~2012-05-19  7:37 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-19  7:37 Sven Eckelmann [this message]
2012-05-20  8:55 ` [B.A.T.M.A.N.] [PATCHv2] batman-adv: Remove batadv_ vararg inline functions Sven Eckelmann
2012-05-22  4:43   ` Marek Lindner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1337413075-8853-1-git-send-email-sven@narfation.org \
    --to=sven@narfation.org \
    --cc=b.a.t.m.a.n@lists.open-mesh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox