Patchwork iproute2: clean up genl/genl.c::usage()

login
register
mail settings
Submitter Amerigo Wang
Date Dec. 14, 2012, 6:10 a.m.
Message ID <1355465438-20586-1-git-send-email-amwang@redhat.com>
Download mbox | patch
Permalink /patch/206299/
State Rejected
Delegated to: stephen hemminger
Headers show

Comments

Amerigo Wang - Dec. 14, 2012, 6:10 a.m.
gcc attribute can be used in definition, no need to
redeclare it.

Cc: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: Cong Wang <amwang@redhat.com>

---
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
stephen hemminger - Dec. 14, 2012, 5:15 p.m.
On Fri, 14 Dec 2012 14:10:38 +0800
Cong Wang <amwang@redhat.com> wrote:

> gcc attribute can be used in definition, no need to
> redeclare it.
> 
> Cc: Stephen Hemminger <shemminger@vyatta.com>
> Signed-off-by: Cong Wang <amwang@redhat.com>
> 
> ---
> diff --git a/genl/genl.c b/genl/genl.c
> index 49b6596..a1e55e0 100644
> --- a/genl/genl.c
> +++ b/genl/genl.c
> @@ -97,9 +97,7 @@ noexist:
>  	return f;
>  }
>  
> -static void usage(void) __attribute__((noreturn));
> -
> -static void usage(void)
> +static void __attribute__((noreturn)) usage(void)
>  {
>  	fprintf(stderr, "Usage: genl [ OPTIONS ] OBJECT | help }\n"
>  	                "where  OBJECT := { ctrl etc }\n"
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

Why bother, all the other older code uses the prototype version,
besides the optimizing of usage() function is ridiculous anyway.
I am just going to remove all the 
  static void usage(void) __attribute__((noreturn));
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/genl/genl.c b/genl/genl.c
index 49b6596..a1e55e0 100644
--- a/genl/genl.c
+++ b/genl/genl.c
@@ -97,9 +97,7 @@  noexist:
 	return f;
 }
 
-static void usage(void) __attribute__((noreturn));
-
-static void usage(void)
+static void __attribute__((noreturn)) usage(void)
 {
 	fprintf(stderr, "Usage: genl [ OPTIONS ] OBJECT | help }\n"
 	                "where  OBJECT := { ctrl etc }\n"