linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] trace: events: fix error directive in argument list
@ 2019-03-30 18:18 Hariprasad Kelam
  2019-03-30 18:39 ` Mukesh Ojha
  2019-03-30 19:47 ` Luc Van Oostenryck
  0 siblings, 2 replies; 3+ messages in thread
From: Hariprasad Kelam @ 2019-03-30 18:18 UTC (permalink / raw)
  To: luc.vanoostenryck, 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 (n->tbl->family == AF_INET6) {
to if (IS_ENABLED(CONFIG_IPV6) && n->tbl->family == AF_INET6)

Signed-off-by: Hariprasad Kelam <hariprasad.kelam@gmail.com>
---
Changes in V2:
                -Divide patch to only address spare error
---
 include/trace/events/neigh.h | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/include/trace/events/neigh.h b/include/trace/events/neigh.h
index 0bdb085..2ca0180 100644
--- a/include/trace/events/neigh.h
+++ b/include/trace/events/neigh.h
@@ -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);
 		}
-- 
2.7.4


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

* Re: [PATCH v2] trace: events: fix error directive in argument list
  2019-03-30 18:18 [PATCH v2] trace: events: fix error directive in argument list Hariprasad Kelam
@ 2019-03-30 18:39 ` Mukesh Ojha
  2019-03-30 19:47 ` Luc Van Oostenryck
  1 sibling, 0 replies; 3+ messages in thread
From: Mukesh Ojha @ 2019-03-30 18:39 UTC (permalink / raw)
  To: Hariprasad Kelam, luc.vanoostenryck, rostedt, mingo, roopa,
	davem, linux-kernel


On 3/30/2019 11:48 PM, Hariprasad Kelam wrote:
> 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)
>
> Signed-off-by: Hariprasad Kelam <hariprasad.kelam@gmail.com>


Reviewed-by: Mukesh Ojha <mojha@codeaurora.org>

Cheers,
-Mukesh


> ---
> Changes in V2:
>                  -Divide patch to only address spare error
> ---
>   include/trace/events/neigh.h | 8 ++------
>   1 file changed, 2 insertions(+), 6 deletions(-)
>
> diff --git a/include/trace/events/neigh.h b/include/trace/events/neigh.h
> index 0bdb085..2ca0180 100644
> --- a/include/trace/events/neigh.h
> +++ b/include/trace/events/neigh.h
> @@ -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);
>   		}

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

* Re: [PATCH v2] trace: events: fix error directive in argument list
  2019-03-30 18:18 [PATCH v2] trace: events: fix error directive in argument list Hariprasad Kelam
  2019-03-30 18:39 ` Mukesh Ojha
@ 2019-03-30 19:47 ` Luc Van Oostenryck
  1 sibling, 0 replies; 3+ messages in thread
From: Luc Van Oostenryck @ 2019-03-30 19:47 UTC (permalink / raw)
  To: Hariprasad Kelam; +Cc: rostedt, mingo, roopa, davem, linux-kernel

On Sat, Mar 30, 2019 at 11:48:23PM +0530, Hariprasad Kelam wrote:
> 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)
> 
> Signed-off-by: Hariprasad Kelam <hariprasad.kelam@gmail.com>

Thanks,

Reviewed-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>

-- Luc

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

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

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-30 18:18 [PATCH v2] trace: events: fix error directive in argument list Hariprasad Kelam
2019-03-30 18:39 ` Mukesh Ojha
2019-03-30 19:47 ` Luc Van Oostenryck

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