linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] trace: events: fix  error directive in argument list
@ 2019-03-25 19:53 Hariprasad Kelam
  2019-03-25 20:11 ` Steven Rostedt
                   ` (3 more replies)
  0 siblings, 4 replies; 11+ messages in thread
From: Hariprasad Kelam @ 2019-03-25 19:53 UTC (permalink / raw)
  To: rostedt, mingo, roopa, davem, linux-kernel

This patch fixes below spare errors.

Sparse error:
make C=2 CF=-D__CHECK_ENDIAN__ M=net/core
./include/trace/events/neigh.h:73:1: error: directive in argument list
./include/trace/events/neigh.h:78:1: error: directive in argument list
./include/trace/events/neigh.h:150:1: error: directive in argument list
./include/trace/events/neigh.h:155:1: error: directive in argument list

Changes below two lines to signle line to avoid sparse error
 #if IS_ENABLED(CONFIG_IPV6)
               if (n->tbl->family == AF_INET6) {
to if (IS_ENABLED(CONFIG_IPV6) && n->tbl->family == AF_INET6)

and removes reassigning pin6 pointer when IPV6 is enabled

Signed-off-by: Hariprasad Kelam <hariprasad.kelam@gmail.com>
---
 include/trace/events/neigh.h | 19 +++++--------------
 1 file changed, 5 insertions(+), 14 deletions(-)

diff --git a/include/trace/events/neigh.h b/include/trace/events/neigh.h
index 0bdb085..6e310ea 100644
--- a/include/trace/events/neigh.h
+++ b/include/trace/events/neigh.h
@@ -70,15 +70,11 @@ TRACE_EVENT(neigh_update,
 		else
 			*p32 = 0;
 
-#if IS_ENABLED(CONFIG_IPV6)
-		if (n->tbl->family == AF_INET6) {
-			pin6 = (struct in6_addr *)__entry->primary_key6;
+		if (IS_ENABLED(CONFIG_IPV6) && n->tbl->family == AF_INET6)
 			*pin6 = *(struct in6_addr *)n->primary_key;
-		} else
-#endif
-		{
+		else
 			ipv6_addr_set_v4mapped(*p32, pin6);
-		}
+
 		__entry->confirmed = n->confirmed;
 		__entry->updated = n->updated;
 		__entry->used = n->used;
@@ -147,15 +143,10 @@ DECLARE_EVENT_CLASS(neigh__update,
 		else
 			*p32 = 0;
 
-#if IS_ENABLED(CONFIG_IPV6)
-		if (n->tbl->family == AF_INET6) {
-			pin6 = (struct in6_addr *)__entry->primary_key6;
+		if (IS_ENABLED(CONFIG_IPV6) && n->tbl->family == AF_INET6)
 			*pin6 = *(struct in6_addr *)n->primary_key;
-		} else
-#endif
-		{
+		else
 			ipv6_addr_set_v4mapped(*p32, pin6);
-		}
 
 		__entry->confirmed = n->confirmed;
 		__entry->updated = n->updated;
-- 
2.7.4


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

end of thread, other threads:[~2019-03-30 13:50 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-25 19:53 [PATCH] trace: events: fix error directive in argument list Hariprasad Kelam
2019-03-25 20:11 ` Steven Rostedt
2019-03-27  0:20   ` Roopa Prabhu
2019-03-27  0:19 ` Roopa Prabhu
2019-03-27 15:53 ` Steven Rostedt
2019-03-29 23:12   ` Luc Van Oostenryck
2019-03-29 23:22 ` Luc Van Oostenryck
2019-03-30 11:07   ` Hariprasad Kelam
2019-03-30 12:01     ` Luc Van Oostenryck
2019-03-30 12:40       ` Steven Rostedt
2019-03-30 13:50         ` Roopa Prabhu

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).