diff mbox

slirp: Remove unused zero_ethaddr[] variable

Message ID 1401361215-25752-1-git-send-email-peter.maydell@linaro.org
State New
Headers show

Commit Message

Peter Maydell May 29, 2014, 11 a.m. UTC
The zero_ethaddr[] array is never used; delete it.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
clang 3.4 warns about unused const variables like this and
also about unused functions; we have over 400 such warnings
currently, of which some are simple "forgot to clean up
redundant code" like this one, some are deliberate in some
sense (usually the function/var is used in one config but not
another), and some are outright bugs. Anybody feel like wading
through them? :-)

 slirp/slirp.c | 2 --
 1 file changed, 2 deletions(-)

Comments

Stefan Weil May 29, 2014, 12:52 p.m. UTC | #1
Am 29.05.2014 13:00, schrieb Peter Maydell:
> The zero_ethaddr[] array is never used; delete it.
> 
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
> clang 3.4 warns about unused const variables like this and
> also about unused functions; we have over 400 such warnings
> currently, of which some are simple "forgot to clean up
> redundant code" like this one, some are deliberate in some
> sense (usually the function/var is used in one config but not
> another), and some are outright bugs. Anybody feel like wading
> through them? :-)

I can add some more:

* Missing 'static' attributes for local variables and functions

* Use of 0 instead of NULL for pointers (do we want to fix those?)

> 
>  slirp/slirp.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/slirp/slirp.c b/slirp/slirp.c
> index 3fb48a4..b7f3726 100644
> --- a/slirp/slirp.c
> +++ b/slirp/slirp.c
> @@ -37,8 +37,6 @@ static const uint8_t special_ethaddr[ETH_ALEN] = {
>      0x52, 0x55, 0x00, 0x00, 0x00, 0x00
>  };
>  
> -static const uint8_t zero_ethaddr[ETH_ALEN] = { 0, 0, 0, 0, 0, 0 };
> -
>  u_int curtime;
>  
>  static QTAILQ_HEAD(slirp_instances, Slirp) slirp_instances =
> 

Reviewed-by: Stefan Weil <sw@weilnetz.de>
Peter Maydell May 29, 2014, 1:01 p.m. UTC | #2
On 29 May 2014 13:52, Stefan Weil <sw@weilnetz.de> wrote:
> I can add some more:
>
> * Missing 'static' attributes for local variables and functions

Those seem worth fixing.

> * Use of 0 instead of NULL for pointers (do we want to fix those?)

I wouldn't bother personally.

There's also still a tail of coverity issues.

thanks
-- PMM
diff mbox

Patch

diff --git a/slirp/slirp.c b/slirp/slirp.c
index 3fb48a4..b7f3726 100644
--- a/slirp/slirp.c
+++ b/slirp/slirp.c
@@ -37,8 +37,6 @@  static const uint8_t special_ethaddr[ETH_ALEN] = {
     0x52, 0x55, 0x00, 0x00, 0x00, 0x00
 };
 
-static const uint8_t zero_ethaddr[ETH_ALEN] = { 0, 0, 0, 0, 0, 0 };
-
 u_int curtime;
 
 static QTAILQ_HEAD(slirp_instances, Slirp) slirp_instances =