Skip to contentSkip to conversation

trace: events: fix error directive in argument list

PATCH In review Hariprasad Kelam 3 participants 3 messages Mar 30, 2019 Tracing

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 trace: events: fix error directive in argument list

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 (n->tbl->family == AF_INET6) {

to if (IS_ENABLED(CONFIG_IPV6) && n->tbl->family == AF_INET6)

---
Changes in V2:
-Divide patch to only address spare error

---
 include/trace/events/neigh.h | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)
include/trace/events/neigh.h +2 -6
index 0bdb085..2ca0180 100644
@@ -70,12 +70,10 @@ TRACE_EVENT(neigh_update,
 		else
 			*p32 = 0;
 
-#if IS_ENABLED(CONFIG_IPV6)
-		if (n->tbl->family == AF_INET6) {
+		if (IS_ENABLED(CONFIG_IPV6) && n->tbl->family == AF_INET6) {
 			pin6 = (struct in6_addr *)__entry->primary_key6;
 			*pin6 = *(struct in6_addr *)n->primary_key;
 		} else
-#endif
 		{
 			ipv6_addr_set_v4mapped(*p32, pin6);
 		}
@@ -147,12 +145,10 @@ DECLARE_EVENT_CLASS(neigh__update,
 		else
 			*p32 = 0;
 
-#if IS_ENABLED(CONFIG_IPV6)
-		if (n->tbl->family == AF_INET6) {
+		if (IS_ENABLED(CONFIG_IPV6) && n->tbl->family == AF_INET6) {
 			pin6 = (struct in6_addr *)__entry->primary_key6;
 			*pin6 = *(struct in6_addr *)n->primary_key;
 		} else
-#endif
 		{
 			ipv6_addr_set_v4mapped(*p32, pin6);
 		}
Signature · 1 line
2.7.4
Reviewed-by on v2 1/1
#1 lore raw
Quoted 9 lines · Hariprasad Kelam

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

Quoted 5 lines

Changes below two lines to signle line to avoid sparse error

                if (n->tbl->family == AF_INET6) {

to if (IS_ENABLED(CONFIG_IPV6) && n->tbl->family == AF_INET6)

Cheers,
-Mukesh

Quoted 39 lines

---
Changes in V2:
-Divide patch to only address spare error

---
  include/trace/events/neigh.h | 8 ++------
  1 file changed, 2 insertions(+), 6 deletions(-)
include/trace/events/neigh.h +2 -6
index 0bdb085..2ca0180 100644
@@ -70,12 +70,10 @@ TRACE_EVENT(neigh_update,
  		else
  			*p32 = 0;
 
-#if IS_ENABLED(CONFIG_IPV6)
-		if (n->tbl->family == AF_INET6) {
+		if (IS_ENABLED(CONFIG_IPV6) && n->tbl->family == AF_INET6) {
  			pin6 = (struct in6_addr *)__entry->primary_key6;
  			*pin6 = *(struct in6_addr *)n->primary_key;
  		} else
-#endif
  		{
  			ipv6_addr_set_v4mapped(*p32, pin6);
  		}
@@ -147,12 +145,10 @@ DECLARE_EVENT_CLASS(neigh__update,
  		else
  			*p32 = 0;
 
-#if IS_ENABLED(CONFIG_IPV6)
-		if (n->tbl->family == AF_INET6) {
+		if (IS_ENABLED(CONFIG_IPV6) && n->tbl->family == AF_INET6) {
  			pin6 = (struct in6_addr *)__entry->primary_key6;
  			*pin6 = *(struct in6_addr *)n->primary_key;
  		} else
-#endif
  		{
  			ipv6_addr_set_v4mapped(*p32, pin6);
  		}
Reviewed-by on v2 1/1
#2 lore raw
In reply to Hariprasad Kelam
Quoted 9 lines · Hariprasad Kelam

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

Quoted 5 lines

Changes below two lines to signle line to avoid sparse error

               if (n->tbl->family == AF_INET6) {

to if (IS_ENABLED(CONFIG_IPV6) && n->tbl->family == AF_INET6)

Thanks,

-- Luc