All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] fix rte_memcpy() macro: avoid unused value warning
@ 2014-12-15 16:55 Michal Jastrzebski
  2014-12-16  1:57 ` Qiu, Michael
  0 siblings, 1 reply; 3+ messages in thread
From: Michal Jastrzebski @ 2014-12-15 16:55 UTC (permalink / raw)
  To: dev-VfR2kkLFssw

From: Pawel Wodkowski <pawelx.wodkowski-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>

This change use statements in expressions C extension provided by gcc to avoid
'value computed is not used' warning/error when size is not known at compile
time.

Comments on possible side effects are welcome an tests are welcome.

Reported-by: Qiu, Michael <michael.qiu-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
---
 .../common/include/arch/x86/rte_memcpy.h           |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/librte_eal/common/include/arch/x86/rte_memcpy.h b/lib/librte_eal/common/include/arch/x86/rte_memcpy.h
index 290c5cd..c3e8b81 100644
--- a/lib/librte_eal/common/include/arch/x86/rte_memcpy.h
+++ b/lib/librte_eal/common/include/arch/x86/rte_memcpy.h
@@ -169,9 +169,9 @@ rte_mov256(uint8_t *dst, const uint8_t *src)
 }
 
 #define rte_memcpy(dst, src, n)              \
-	((__builtin_constant_p(n)) ?          \
+	({ (__builtin_constant_p(n)) ?          \
 	memcpy((dst), (src), (n)) :          \
-	rte_memcpy_func((dst), (src), (n)))
+	rte_memcpy_func((dst), (src), (n)); })
 
 static inline void *
 rte_memcpy_func(void *dst, const void *src, size_t n)
-- 
1.7.9.5

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

* Re: [PATCH] fix rte_memcpy() macro: avoid unused value warning
  2014-12-15 16:55 [PATCH] fix rte_memcpy() macro: avoid unused value warning Michal Jastrzebski
@ 2014-12-16  1:57 ` Qiu, Michael
       [not found]   ` <533710CFB86FA344BFBF2D6802E60286CA0168-0J0gbvR4kThpB2pF5aRoyrfspsVTdybXVpNB7YpNyf8@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Qiu, Michael @ 2014-12-16  1:57 UTC (permalink / raw)
  To: Jastrzebski, MichalX K, dev-VfR2kkLFssw

On 12/16/2014 12:55 AM, Michal Jastrzebski wrote:
> From: Pawel Wodkowski <pawelx.wodkowski-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
>
> This change use statements in expressions C extension provided by gcc to avoid
> 'value computed is not used' warning/error when size is not known at compile
> time.
>
> Comments on possible side effects are welcome an tests are welcome.
>
> Reported-by: Qiu, Michael <michael.qiu-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
> Signed-off-by: Pawel Wodkowski <pawelx.wodkowski-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
> ---
>  .../common/include/arch/x86/rte_memcpy.h           |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/lib/librte_eal/common/include/arch/x86/rte_memcpy.h b/lib/librte_eal/common/include/arch/x86/rte_memcpy.h
> index 290c5cd..c3e8b81 100644
> --- a/lib/librte_eal/common/include/arch/x86/rte_memcpy.h
> +++ b/lib/librte_eal/common/include/arch/x86/rte_memcpy.h
> @@ -169,9 +169,9 @@ rte_mov256(uint8_t *dst, const uint8_t *src)
>  }
>  
>  #define rte_memcpy(dst, src, n)              \
> -	((__builtin_constant_p(n)) ?          \
> +	({ (__builtin_constant_p(n)) ?          \
>  	memcpy((dst), (src), (n)) :          \
> -	rte_memcpy_func((dst), (src), (n)))
> +	rte_memcpy_func((dst), (src), (n)); })
>  
>  static inline void *
>  rte_memcpy_func(void *dst, const void *src, size_t n)

Acked-by: Qiu, Michael <michael.qiu-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>


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

* Re: [PATCH] fix rte_memcpy() macro: avoid unused value warning
       [not found]   ` <533710CFB86FA344BFBF2D6802E60286CA0168-0J0gbvR4kThpB2pF5aRoyrfspsVTdybXVpNB7YpNyf8@public.gmane.org>
@ 2014-12-16 23:50     ` Thomas Monjalon
  0 siblings, 0 replies; 3+ messages in thread
From: Thomas Monjalon @ 2014-12-16 23:50 UTC (permalink / raw)
  To: Pawel Wodkowski; +Cc: dev-VfR2kkLFssw

2014-12-16 01:57, Qiu, Michael:
> On 12/16/2014 12:55 AM, Michal Jastrzebski wrote:
> > From: Pawel Wodkowski <pawelx.wodkowski-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
> >
> > This change use statements in expressions C extension provided by gcc to avoid
> > 'value computed is not used' warning/error when size is not known at compile
> > time.
> >
> > Comments on possible side effects are welcome an tests are welcome.
> >
> > Reported-by: Qiu, Michael <michael.qiu-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
> > Signed-off-by: Pawel Wodkowski <pawelx.wodkowski-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
> 
> Acked-by: Qiu, Michael <michael.qiu-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>

Acked-by: Thomas Monjalon <thomas.monjalon-pdR9zngts4EAvxtiuMwx3w@public.gmane.org>

Applied with a PPC equivalent.

Thanks
-- 
Thomas

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

end of thread, other threads:[~2014-12-16 23:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-12-15 16:55 [PATCH] fix rte_memcpy() macro: avoid unused value warning Michal Jastrzebski
2014-12-16  1:57 ` Qiu, Michael
     [not found]   ` <533710CFB86FA344BFBF2D6802E60286CA0168-0J0gbvR4kThpB2pF5aRoyrfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2014-12-16 23:50     ` Thomas Monjalon

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.