LVS
lvs-users
Google
 
Web LinuxVirtualServer.org

Re: [PATCH] (3/6) ipvs -- use list_for_each_entry macro's

To: "LinuxVirtualServer.org users mailing list." <lvs-users@xxxxxxxxxxxxxxxxxxxxxx>
Subject: Re: [PATCH] (3/6) ipvs -- use list_for_each_entry macro's
Cc: jcoby@xxxxxxxxxxxxxxx
From: Stephen Hemminger <shemminger@xxxxxxxx>
Date: Wed, 17 Sep 2003 11:28:56 -0700
On Wed, 17 Sep 2003 13:07:10 -0400
"Jacob Coby" <jcoby@xxxxxxxxxxxxxxx> wrote:

> >   /* decrease the module use count */
> > @@ -239,13 +235,11 @@
> >   */
> >  struct ip_vs_app *ip_vs_app_get_by_name(char *appname)
> >  {
> > - struct list_head *p;
> >   struct ip_vs_app *app, *a = NULL;
> >
> >   down(&__ip_vs_app_mutex);
> >
> > - list_for_each (p, &ip_vs_app_list) {
> > - app = list_entry(p, struct ip_vs_app, a_list);
> > + list_for_each_entry(ent, &ip_vs_app_list, a_list) {
> >   if (strcmp(app->name, appname))
> >   continue;
> 
> Am I missing something here, or has 'ent' not been defined?  I think it is
> supposed to be:
> 
> + list_for_each_entry(app, &ip_vs_app_list, a_list) {
> 
> -Jacob
> Listingbook.com

Good catch, it is dead code.. but this should fix.
diff -Nru a/net/ipv4/ipvs/ip_vs_app.c b/net/ipv4/ipvs/ip_vs_app.c
--- a/net/ipv4/ipvs/ip_vs_app.c Wed Sep 17 11:07:05 2003
+++ b/net/ipv4/ipvs/ip_vs_app.c Wed Sep 17 11:07:05 2003
@@ -233,13 +233,13 @@
 /*
  *     Get reference to app by name (called from user context)
  */
-struct ip_vs_app *ip_vs_app_get_by_name(char *appname)
+struct ip_vs_app *ip_vs_app_get_by_name(const char *appname)
 {
        struct ip_vs_app *app, *a = NULL;
 
        down(&__ip_vs_app_mutex);
 
-       list_for_each_entry(ent, &ip_vs_app_list, a_list) {
+       list_for_each_entry(app, &ip_vs_app_list, a_list) {
                if (strcmp(app->name, appname))
                        continue;
 
<Prev in Thread] Current Thread [Next in Thread>