[v2,5/6] examples/performance-thread: replace restrict with wrapper
diff mbox series

Message ID 20200706074930.54299-6-joyce.kong@arm.com
State Superseded
Delegated to: David Marchand
Headers show
Series
  • Restrict pointer aliasing with a common wrapper
Related show

Checks

Context Check Description
ci/Intel-compilation fail Compilation issues
ci/checkpatch success coding style OK

Commit Message

Joyce Kong July 6, 2020, 7:49 a.m. UTC
'__rte_restrict' is a common wrapper for restricted pointers which
can be supported by all compilers. Use '__rte_restrict' instead of
'__restrict' for code consistency.

Signed-off-by: Joyce Kong <joyce.kong@arm.com>
---
 .../performance-thread/pthread_shim/pthread_shim.c   | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

Comments

Phil Yang July 7, 2020, 2:27 a.m. UTC | #1
> -----Original Message-----
> From: Joyce Kong <joyce.kong@arm.com>
> Sent: Monday, July 6, 2020 3:49 PM
> To: maxime.coquelin@redhat.com; jerinj@marvell.com;
> zhihong.wang@intel.com; xiaolong.ye@intel.com; beilei.xing@intel.com;
> jia.guo@intel.com; john.mcnamara@intel.com; matan@mellanox.com;
> shahafs@mellanox.com; viacheslavo@mellanox.com; Honnappa Nagarahalli
> <Honnappa.Nagarahalli@arm.com>; Phil Yang <Phil.Yang@arm.com>;
> Ruifeng Wang <Ruifeng.Wang@arm.com>
> Cc: dev@dpdk.org; nd <nd@arm.com>
> Subject: [PATCH v2 5/6] examples/performance-thread: replace restrict with
> wrapper
> 
> '__rte_restrict' is a common wrapper for restricted pointers which
> can be supported by all compilers. Use '__rte_restrict' instead of
> '__restrict' for code consistency.
> 
> Signed-off-by: Joyce Kong <joyce.kong@arm.com>


Reviewed-by: Phil Yang <phil.yang@arm.com>
 
> ---
>  .../performance-thread/pthread_shim/pthread_shim.c   | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/examples/performance-thread/pthread_shim/pthread_shim.c
> b/examples/performance-thread/pthread_shim/pthread_shim.c
> index 93e8dca3f..bbc076584 100644
> --- a/examples/performance-thread/pthread_shim/pthread_shim.c
> +++ b/examples/performance-thread/pthread_shim/pthread_shim.c
> @@ -341,9 +341,9 @@ int pthread_cond_signal(pthread_cond_t *cond)
>  }
> 
>  int
> -pthread_cond_timedwait(pthread_cond_t *__restrict cond,
> -		       pthread_mutex_t *__restrict mutex,
> -		       const struct timespec *__restrict time)
> +pthread_cond_timedwait(pthread_cond_t *__rte_restrict cond,
> +		       pthread_mutex_t *__rte_restrict mutex,
> +		       const struct timespec *__rte_restrict time)
>  {
>  	NOT_IMPLEMENTED;
>  	return _sys_pthread_funcs.f_pthread_cond_timedwait(cond,
> mutex, time);
> @@ -362,10 +362,10 @@ int pthread_cond_wait(pthread_cond_t *cond,
> pthread_mutex_t *mutex)
>  }
> 
>  int
> -pthread_create(pthread_t *__restrict tid,
> -		const pthread_attr_t *__restrict attr,
> +pthread_create(pthread_t *__rte_restrict tid,
> +		const pthread_attr_t *__rte_restrict attr,
>  		lthread_func_t func,
> -	       void *__restrict arg)
> +	       void *__rte_restrict arg)
>  {
>  	if (override) {
>  		int lcore = -1;
> --
> 2.27.0
Ruifeng Wang July 7, 2020, 2:45 a.m. UTC | #2
> -----Original Message-----
> From: Joyce Kong <joyce.kong@arm.com>
> Sent: Monday, July 6, 2020 3:49 PM
> To: maxime.coquelin@redhat.com; jerinj@marvell.com;
> zhihong.wang@intel.com; xiaolong.ye@intel.com; beilei.xing@intel.com;
> jia.guo@intel.com; john.mcnamara@intel.com; matan@mellanox.com;
> shahafs@mellanox.com; viacheslavo@mellanox.com; Honnappa Nagarahalli
> <Honnappa.Nagarahalli@arm.com>; Phil Yang <Phil.Yang@arm.com>;
> Ruifeng Wang <Ruifeng.Wang@arm.com>
> Cc: dev@dpdk.org; nd <nd@arm.com>
> Subject: [PATCH v2 5/6] examples/performance-thread: replace restrict with
> wrapper
> 
> '__rte_restrict' is a common wrapper for restricted pointers which can be
> supported by all compilers. Use '__rte_restrict' instead of '__restrict' for
> code consistency.
> 
> Signed-off-by: Joyce Kong <joyce.kong@arm.com>
> ---
>  .../performance-thread/pthread_shim/pthread_shim.c   | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/examples/performance-thread/pthread_shim/pthread_shim.c
> b/examples/performance-thread/pthread_shim/pthread_shim.c
> index 93e8dca3f..bbc076584 100644
> --- a/examples/performance-thread/pthread_shim/pthread_shim.c
> +++ b/examples/performance-thread/pthread_shim/pthread_shim.c
> @@ -341,9 +341,9 @@ int pthread_cond_signal(pthread_cond_t *cond)  }
> 
>  int
> -pthread_cond_timedwait(pthread_cond_t *__restrict cond,
> -		       pthread_mutex_t *__restrict mutex,
> -		       const struct timespec *__restrict time)
> +pthread_cond_timedwait(pthread_cond_t *__rte_restrict cond,
> +		       pthread_mutex_t *__rte_restrict mutex,
> +		       const struct timespec *__rte_restrict time)
>  {
>  	NOT_IMPLEMENTED;
>  	return _sys_pthread_funcs.f_pthread_cond_timedwait(cond,
> mutex, time); @@ -362,10 +362,10 @@ int
> pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex)  }
> 
>  int
> -pthread_create(pthread_t *__restrict tid,
> -		const pthread_attr_t *__restrict attr,
> +pthread_create(pthread_t *__rte_restrict tid,
> +		const pthread_attr_t *__rte_restrict attr,
>  		lthread_func_t func,
> -	       void *__restrict arg)
> +	       void *__rte_restrict arg)
>  {
>  	if (override) {
>  		int lcore = -1;
> --
> 2.27.0
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>

Patch
diff mbox series

diff --git a/examples/performance-thread/pthread_shim/pthread_shim.c b/examples/performance-thread/pthread_shim/pthread_shim.c
index 93e8dca3f..bbc076584 100644
--- a/examples/performance-thread/pthread_shim/pthread_shim.c
+++ b/examples/performance-thread/pthread_shim/pthread_shim.c
@@ -341,9 +341,9 @@  int pthread_cond_signal(pthread_cond_t *cond)
 }
 
 int
-pthread_cond_timedwait(pthread_cond_t *__restrict cond,
-		       pthread_mutex_t *__restrict mutex,
-		       const struct timespec *__restrict time)
+pthread_cond_timedwait(pthread_cond_t *__rte_restrict cond,
+		       pthread_mutex_t *__rte_restrict mutex,
+		       const struct timespec *__rte_restrict time)
 {
 	NOT_IMPLEMENTED;
 	return _sys_pthread_funcs.f_pthread_cond_timedwait(cond, mutex, time);
@@ -362,10 +362,10 @@  int pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex)
 }
 
 int
-pthread_create(pthread_t *__restrict tid,
-		const pthread_attr_t *__restrict attr,
+pthread_create(pthread_t *__rte_restrict tid,
+		const pthread_attr_t *__rte_restrict attr,
 		lthread_func_t func,
-	       void *__restrict arg)
+	       void *__rte_restrict arg)
 {
 	if (override) {
 		int lcore = -1;