linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net: trace : fix  error directive in argument list
@ 2019-03-26 19:38 Hariprasad Kelam
  0 siblings, 0 replies; 2+ messages in thread
From: Hariprasad Kelam @ 2019-03-26 19:38 UTC (permalink / raw)
  To: Steven Rostedt, Ingo Molnar, David S. Miller, Edward Cree,
	gbastien, linux-kernel

This patch fixes below spare errors.

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

./include/trace/events/net.h:171:1: error: directive in argument list
./include/trace/events/net.h:173:1: error: directive in argument list
./include/trace/events/net.h:175:1: error: directive in argument list
./include/trace/events/net.h:171:1: error: directive in argument list
./include/trace/events/net.h:173:1: error: directive in argument list
./include/trace/events/net.h:175:1: error: directive in argument list

To avoid sparse error changed
to
if (IS_ENABLED(CONFIG_NET_RX_BUSY_POLL))

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

diff --git a/include/trace/events/net.h b/include/trace/events/net.h
index 1efd7d9..49e6003 100644
--- a/include/trace/events/net.h
+++ b/include/trace/events/net.h
@@ -168,11 +168,12 @@ DECLARE_EVENT_CLASS(net_dev_rx_verbose_template,

	TP_fast_assign(
		__assign_str(name, skb->dev->name);
-#ifdef CONFIG_NET_RX_BUSY_POLL
-		__entry->napi_id = skb->napi_id;
-#else
-		__entry->napi_id = 0;
-#endif
+
+		if (IS_ENABLED(CONFIG_NET_RX_BUSY_POLL))
+			__entry->napi_id = skb->napi_id;
+		else
+			__entry->napi_id = 0;
+
 		__entry->queue_mapping = skb->queue_mapping;
 		__entry->skbaddr = skb;
 		__entry->vlan_tagged = skb_vlan_tag_present(skb);
-- 
2.7.4


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

* [PATCH] net: trace : fix  error directive in argument list
@ 2019-03-26 18:50 Hariprasad Kelam
  0 siblings, 0 replies; 2+ messages in thread
From: Hariprasad Kelam @ 2019-03-26 18:50 UTC (permalink / raw)
  To: rostedt, mingo, laoar.shao, davem, linux-kernel

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@gmail.com>
---
 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


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

end of thread, other threads:[~2019-03-26 19:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-26 19:38 [PATCH] net: trace : fix error directive in argument list Hariprasad Kelam
  -- strict thread matches above, loose matches on Subject: below --
2019-03-26 18:50 Hariprasad Kelam

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