[PATCH] net: trace : fix error directive in argument list

From: Hariprasad Kelam
Date: Tue Mar 26 2019 - 14:50:21 EST


This patch fixes below spare errors.

Sparse error:
make C=2 CF=-D__CHECK_ENDIAN__ M=net/core

./include/trace/events/sock.h:177:1: error: directive in argument list
./include/trace/events/sock.h:184:1: error: directive in argument list
./include/trace/events/sock.h:177:1: error: directive in argument list
./include/trace/events/sock.h:184:1: error: directive in argument list

Changed below two lines to signle line to avoid sparse error
-#if IS_ENABLED(CONFIG_IPV6)
- if (sk->sk_family == AF_INET6) {
to
if (IS_ENABLED(CONFIG_IPV6) && sk->sk_family == AF_INET6) {

Moved address assigning of pin6 struct outside the loop.

Signed-off-by: Hariprasad Kelam <hariprasad.kelam@xxxxxxxxx>
---
include/trace/events/sock.h | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/include/trace/events/sock.h b/include/trace/events/sock.h
index a0c4b8a..22bee26 100644
--- a/include/trace/events/sock.h
+++ b/include/trace/events/sock.h
@@ -174,16 +174,14 @@ TRACE_EVENT(inet_sock_set_state,
p32 = (__be32 *) __entry->daddr;
*p32 = inet->inet_daddr;

-#if IS_ENABLED(CONFIG_IPV6)
- if (sk->sk_family == AF_INET6) {
- pin6 = (struct in6_addr *)__entry->saddr_v6;
+ pin6 = (struct in6_addr *)__entry->saddr_v6;
+
+ if (IS_ENABLED(CONFIG_IPV6) && sk->sk_family == AF_INET6) {
*pin6 = sk->sk_v6_rcv_saddr;
pin6 = (struct in6_addr *)__entry->daddr_v6;
*pin6 = sk->sk_v6_daddr;
} else
-#endif
{
- pin6 = (struct in6_addr *)__entry->saddr_v6;
ipv6_addr_set_v4mapped(inet->inet_saddr, pin6);
pin6 = (struct in6_addr *)__entry->daddr_v6;
ipv6_addr_set_v4mapped(inet->inet_daddr, pin6);
--
2.7.4