[v2,4/5] eal: mark unused function in 32-bit builds

Message ID 20190528110748.10772-5-bruce.richardson@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers
Series fix 32-bit meson builds |

Checks

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

Commit Message

Bruce Richardson May 28, 2019, 11:07 a.m. UTC
  The get_socket_mem_size() function is only used in 64-bit builds,
causing clang to warn about it for 32-bit builds. Add the __rte_unused
attribute to the function to silence the warning.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 lib/librte_eal/linux/eal/eal_memory.c | 1 +
 1 file changed, 1 insertion(+)
  

Comments

Luca Boccassi May 28, 2019, 11:46 a.m. UTC | #1
On Tue, 2019-05-28 at 12:07 +0100, Bruce Richardson wrote:
> The get_socket_mem_size() function is only used in 64-bit builds,
> causing clang to warn about it for 32-bit builds. Add the
> __rte_unused
> attribute to the function to silence the warning.
> 
> Signed-off-by: Bruce Richardson <
> bruce.richardson@intel.com
> >
> ---
>  lib/librte_eal/linux/eal/eal_memory.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/lib/librte_eal/linux/eal/eal_memory.c
> b/lib/librte_eal/linux/eal/eal_memory.c
> index 40a0f68..1853ace 100644
> --- a/lib/librte_eal/linux/eal/eal_memory.c
> +++ b/lib/librte_eal/linux/eal/eal_memory.c
> @@ -1088,6 +1088,7 @@ remap_needed_hugepages(struct hugepage_file
> *hugepages, int n_pages)
>  	return 0;
>  }
>  
> +__rte_unused /* function is unused on 32-bit builds */
>  static inline uint64_t
>  get_socket_mem_size(int socket)
>  {

Acked-by: Luca Boccassi <bluca@debian.org>
  

Patch

diff --git a/lib/librte_eal/linux/eal/eal_memory.c b/lib/librte_eal/linux/eal/eal_memory.c
index 40a0f68..1853ace 100644
--- a/lib/librte_eal/linux/eal/eal_memory.c
+++ b/lib/librte_eal/linux/eal/eal_memory.c
@@ -1088,6 +1088,7 @@  remap_needed_hugepages(struct hugepage_file *hugepages, int n_pages)
 	return 0;
 }
 
+__rte_unused /* function is unused on 32-bit builds */
 static inline uint64_t
 get_socket_mem_size(int socket)
 {