[dpdk-dev,1/4] l3fwd: some functions are unused in l3fwd-acl

Message ID 1405914461-19335-2-git-send-email-mhall@mhcomputing.net (mailing list archive)
State Rejected, archived
Headers

Commit Message

Matthew Hall July 21, 2014, 3:47 a.m. UTC
  Signed-off-by: Matthew Hall <mhall@mhcomputing.net>
---
 examples/l3fwd/Makefile | 1 +
 1 file changed, 1 insertion(+)
  

Comments

Thomas Monjalon July 21, 2014, 1:44 p.m. UTC | #1
Hi,

2014-07-20 20:47, Matthew Hall:
> +CFLAGS += -Wno-unused-function

I think it's better to fix the code instead of removing a warning.
If there is a very good reason to not do it, it would appear in the log.

Thanks
  
Matthew Hall July 21, 2014, 4:53 p.m. UTC | #2
The same code is used in l3fwd and l3fwd-acl. When it is reused in l3fwd-acl a packet processing function from original l3fwd is not used any more.
  
Bruce Richardson July 21, 2014, 5:37 p.m. UTC | #3
> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Matthew Hall
> Sent: Sunday, July 20, 2014 8:48 PM
> To: dev@dpdk.org
> Subject: [dpdk-dev] [PATCH 1/4] l3fwd: some functions are unused in l3fwd-acl
> 
> Signed-off-by: Matthew Hall <mhall@mhcomputing.net>
> ---
>  examples/l3fwd/Makefile | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/examples/l3fwd/Makefile b/examples/l3fwd/Makefile
> index 68de8fc..5cd7396 100644
> --- a/examples/l3fwd/Makefile
> +++ b/examples/l3fwd/Makefile
> @@ -46,6 +46,7 @@ SRCS-y := main.c
> 
>  CFLAGS += -O3 $(USER_FLAGS)
>  CFLAGS += $(WERROR_FLAGS)
> +CFLAGS += -Wno-unused-function
> 

Rather than disabling the warnings, would it not be better to remove the functions entirely from the compile? I would assume that these are functions for one leg of the l3fwd code (e.g. hash lookup vs lpm lookup) that are not used in the other leg of the code, in which case the proper fix should be to add some more #ifdefs, right?

/Bruce
  

Patch

diff --git a/examples/l3fwd/Makefile b/examples/l3fwd/Makefile
index 68de8fc..5cd7396 100644
--- a/examples/l3fwd/Makefile
+++ b/examples/l3fwd/Makefile
@@ -46,6 +46,7 @@  SRCS-y := main.c
 
 CFLAGS += -O3 $(USER_FLAGS)
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -Wno-unused-function
 
 # workaround for a gcc bug with noreturn attribute
 # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603