]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
UPnP: Minor coding style cleanup
authorJouni Malinen <jouni.malinen@atheros.com>
Tue, 3 Feb 2009 11:25:49 +0000 (13:25 +0200)
committerJouni Malinen <j@w1.fi>
Tue, 3 Feb 2009 11:25:49 +0000 (13:25 +0200)
src/wps/wps_upnp.c
src/wps/wps_upnp_event.c
src/wps/wps_upnp_ssdp.c
src/wps/wps_upnp_web.c

index bebecc2a794efdfc3d37f4e23a7ee237cb302bd1..5fdd27dfa7f1157e7b32e9a46959f6aef42474dd 100644 (file)
@@ -567,9 +567,8 @@ void subscription_unlink(struct subscription *s)
                /* only one? */
                sm->subscriptions = NULL;
        } else  {
-               if (sm->subscriptions == s) {
+               if (sm->subscriptions == s)
                        sm->subscriptions = s->next;
-               }
                s->next->prev = s->prev;
                s->prev->next = s->next;
        }
@@ -856,7 +855,8 @@ static int get_netif_info(const char *net_if, unsigned *ip_addr,
        if (*ip_addr_text == NULL || *mac_addr_text == NULL)
                goto fail;
 
-       if ((sock = socket(AF_INET, SOCK_DGRAM, 0)) < 0)
+       sock = socket(AF_INET, SOCK_DGRAM, 0);
+       if (sock < 0)
                goto fail;
 
        os_strncpy(req.ifr_name, net_if, sizeof(req.ifr_name));
index 7e7ce88e9d1ff2210909dd780ed6f6f027a8e1dc..12e16f44bb2156b76e5a4848ee0b339eeadb854d 100644 (file)
@@ -400,8 +400,7 @@ static int event_send_start(struct subscription *s)
         */
        if (connect(e->sd, (struct sockaddr *) &e->addr->saddr,
                    sizeof(e->addr->saddr))) {
-               if (errno == EINPROGRESS) {
-               } else {
+               if (errno != EINPROGRESS) {
                        event_retry(e, 1);
                        return -1;
                }
@@ -432,7 +431,8 @@ void event_send_all_later_handler(void *eloop_data, void *user_ctx)
        int nerrors = 0;
 
        sm->event_send_all_queued = 0;
-       if ((s = sm->subscriptions) == NULL)
+       s = sm->subscriptions;
+       if (s == NULL)
                return;
        do {
                if (s->addr_list == NULL) {
index 71dcc9645c379a0b85411d8964e8a4348150d162..6a94c592e34acf25e62eda269f46d099377e6467 100644 (file)
@@ -51,7 +51,7 @@ static int token_eq(const char *s1, const char *s2)
                if (end1 || end2 || c1 != c2)
                        break;
        }
-       return (end1 && end2);  /* reached end of both words? */
+       return end1 && end2; /* reached end of both words? */
 }
 
 
@@ -359,10 +359,9 @@ void msearchreply_state_machine_stop(struct advertisement_state_machine *a)
        wpa_printf(MSG_DEBUG, "WPS UPnP: M-SEARCH stop");
        if (a->next == a) {
                sm->msearch_replies = NULL;
-       } else  {
-               if (sm->msearch_replies == a) {
+       } else {
+               if (sm->msearch_replies == a)
                        sm->msearch_replies = a->next;
-               }
                a->next->prev = a->prev;
                a->prev->next = a->next;
        }
index 2e0f29691e4db83c85217b67446ee388224f91a6..c2043a5841103fe2f3cccea60f754848ead29638 100644 (file)
@@ -253,7 +253,7 @@ upnp_get_first_document_item(char *doc, const char *item, char **value)
                if (!os_strncasecmp(tagname, match, match_len) &&
                    *tag != '/' &&
                    (tagname[match_len] == '>' ||
-                    !isgraph(tagname[match_len]) )) {
+                    !isgraph(tagname[match_len]))) {
                        break;
                }
        }