netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] (2/6) ipvs -- get rid of register in declarations
@ 2003-09-16 21:17 Stephen Hemminger
  2003-09-17 16:09 ` Wensong Zhang
  0 siblings, 1 reply; 3+ messages in thread
From: Stephen Hemminger @ 2003-09-16 21:17 UTC (permalink / raw)
  To: Wensong Zhang; +Cc: lvs-users, netdev

GCC doesn't need register in declarations (and probably ignores them).

diff -Nru a/net/ipv4/ipvs/ip_vs_ctl.c b/net/ipv4/ipvs/ip_vs_ctl.c
--- a/net/ipv4/ipvs/ip_vs_ctl.c	Tue Sep 16 14:08:25 2003
+++ b/net/ipv4/ipvs/ip_vs_ctl.c	Tue Sep 16 14:08:25 2003
@@ -279,7 +279,7 @@
 static __inline__ unsigned
 ip_vs_svc_hashkey(unsigned proto, __u32 addr, __u16 port)
 {
-	register unsigned porth = ntohs(port);
+	unsigned porth = ntohs(port);
 
 	return (proto^ntohl(addr)^(porth>>IP_VS_SVC_TAB_BITS)^porth)
 		& IP_VS_SVC_TAB_MASK;
@@ -482,7 +482,7 @@
  */
 static __inline__ unsigned ip_vs_rs_hashkey(__u32 addr, __u16 port)
 {
-	register unsigned porth = ntohs(port);
+	unsigned porth = ntohs(port);
 
 	return (ntohl(addr)^(porth>>IP_VS_RTAB_BITS)^porth)
 		& IP_VS_RTAB_MASK;
diff -Nru a/net/ipv4/ipvs/ip_vs_lblcr.c b/net/ipv4/ipvs/ip_vs_lblcr.c
--- a/net/ipv4/ipvs/ip_vs_lblcr.c	Tue Sep 16 14:08:25 2003
+++ b/net/ipv4/ipvs/ip_vs_lblcr.c	Tue Sep 16 14:08:25 2003
@@ -171,7 +171,7 @@
 /* get weighted least-connection node in the destination set */
 static inline struct ip_vs_dest *ip_vs_dest_set_min(struct ip_vs_dest_set *set)
 {
-	register struct ip_vs_dest_list *e;
+	struct ip_vs_dest_list *e;
 	struct ip_vs_dest *dest, *least;
 	int loh, doh;
 
@@ -226,7 +226,7 @@
 /* get weighted most-connection node in the destination set */
 static inline struct ip_vs_dest *ip_vs_dest_set_max(struct ip_vs_dest_set *set)
 {
-	register struct ip_vs_dest_list *e;
+	struct ip_vs_dest_list *e;
 	struct ip_vs_dest *dest, *most;
 	int moh, doh;
 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] (2/6) ipvs -- get rid of register in declarations
  2003-09-16 21:17 [PATCH] (2/6) ipvs -- get rid of register in declarations Stephen Hemminger
@ 2003-09-17 16:09 ` Wensong Zhang
  2003-09-20  8:01   ` David S. Miller
  0 siblings, 1 reply; 3+ messages in thread
From: Wensong Zhang @ 2003-09-17 16:09 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: lvs-users, netdev



Hi,

If we are gonna to remove register in declarations, it is good to remove 
all of them, for example in the ip_vs_rr.c, ip_vs_wrr.c, ip_vs_wlc.c,
ip_vs_nq.c and ip_vs_sed.c.

Thanks,

Wensong

On Tue, 16 Sep 2003, Stephen Hemminger wrote:

> GCC doesn't need register in declarations (and probably ignores them).
> 
> diff -Nru a/net/ipv4/ipvs/ip_vs_ctl.c b/net/ipv4/ipvs/ip_vs_ctl.c
> --- a/net/ipv4/ipvs/ip_vs_ctl.c	Tue Sep 16 14:08:25 2003
> +++ b/net/ipv4/ipvs/ip_vs_ctl.c	Tue Sep 16 14:08:25 2003
> @@ -279,7 +279,7 @@
>  static __inline__ unsigned
>  ip_vs_svc_hashkey(unsigned proto, __u32 addr, __u16 port)
>  {
> -	register unsigned porth = ntohs(port);
> +	unsigned porth = ntohs(port);
>  
>  	return (proto^ntohl(addr)^(porth>>IP_VS_SVC_TAB_BITS)^porth)
>  		& IP_VS_SVC_TAB_MASK;
> @@ -482,7 +482,7 @@
>   */
>  static __inline__ unsigned ip_vs_rs_hashkey(__u32 addr, __u16 port)
>  {
> -	register unsigned porth = ntohs(port);
> +	unsigned porth = ntohs(port);
>  
>  	return (ntohl(addr)^(porth>>IP_VS_RTAB_BITS)^porth)
>  		& IP_VS_RTAB_MASK;
> diff -Nru a/net/ipv4/ipvs/ip_vs_lblcr.c b/net/ipv4/ipvs/ip_vs_lblcr.c
> --- a/net/ipv4/ipvs/ip_vs_lblcr.c	Tue Sep 16 14:08:25 2003
> +++ b/net/ipv4/ipvs/ip_vs_lblcr.c	Tue Sep 16 14:08:25 2003
> @@ -171,7 +171,7 @@
>  /* get weighted least-connection node in the destination set */
>  static inline struct ip_vs_dest *ip_vs_dest_set_min(struct ip_vs_dest_set *set)
>  {
> -	register struct ip_vs_dest_list *e;
> +	struct ip_vs_dest_list *e;
>  	struct ip_vs_dest *dest, *least;
>  	int loh, doh;
>  
> @@ -226,7 +226,7 @@
>  /* get weighted most-connection node in the destination set */
>  static inline struct ip_vs_dest *ip_vs_dest_set_max(struct ip_vs_dest_set *set)
>  {
> -	register struct ip_vs_dest_list *e;
> +	struct ip_vs_dest_list *e;
>  	struct ip_vs_dest *dest, *most;
>  	int moh, doh;
>  
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] (2/6) ipvs -- get rid of register in declarations
  2003-09-17 16:09 ` Wensong Zhang
@ 2003-09-20  8:01   ` David S. Miller
  0 siblings, 0 replies; 3+ messages in thread
From: David S. Miller @ 2003-09-20  8:01 UTC (permalink / raw)
  To: Wensong Zhang; +Cc: shemminger, lvs-users, netdev

On Thu, 18 Sep 2003 00:09:52 +0800 (CST)
Wensong Zhang <wensong@linux-vs.org> wrote:

> If we are gonna to remove register in declarations, it is good to remove 
> all of them, for example in the ip_vs_rr.c, ip_vs_wrr.c, ip_vs_wlc.c,
> ip_vs_nq.c and ip_vs_sed.c.

For now I've applied Stephen's patch, someone can send me
another patch for the rest of them.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2003-09-20  8:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-09-16 21:17 [PATCH] (2/6) ipvs -- get rid of register in declarations Stephen Hemminger
2003-09-17 16:09 ` Wensong Zhang
2003-09-20  8:01   ` David S. Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).