]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - net/sctp/endpointola.c
MIPS: Avoid overoptimization by GCC.
[karo-tx-linux.git] / net / sctp / endpointola.c
index 1a9c5fb77310a22f609d07918ed5629c0d7cc7d7..12ed45dbe75d6b779fd0dcf4d38f6126e23c03fb 100644 (file)
@@ -151,13 +151,11 @@ static struct sctp_endpoint *sctp_endpoint_init(struct sctp_endpoint *ep,
        ep->rcvbuf_policy = net->sctp.rcvbuf_policy;
 
        /* Initialize the secret key used with cookie. */
-       get_random_bytes(&ep->secret_key[0], SCTP_SECRET_SIZE);
-       ep->last_key = ep->current_key = 0;
-       ep->key_changed_at = jiffies;
+       get_random_bytes(ep->secret_key, sizeof(ep->secret_key));
 
        /* SCTP-AUTH extensions*/
        INIT_LIST_HEAD(&ep->endpoint_shared_keys);
-       null_key = sctp_auth_shkey_create(0, GFP_KERNEL);
+       null_key = sctp_auth_shkey_create(0, gfp);
        if (!null_key)
                goto nomem;
 
@@ -249,8 +247,6 @@ void sctp_endpoint_free(struct sctp_endpoint *ep)
 /* Final destructor for endpoint.  */
 static void sctp_endpoint_destroy(struct sctp_endpoint *ep)
 {
-       int i;
-
        SCTP_ASSERT(ep->base.dead, "Endpoint is not dead", return);
 
        /* Free up the HMAC transform. */
@@ -273,8 +269,7 @@ static void sctp_endpoint_destroy(struct sctp_endpoint *ep)
        sctp_inq_free(&ep->base.inqueue);
        sctp_bind_addr_free(&ep->base.bind_addr);
 
-       for (i = 0; i < SCTP_HOW_MANY_SECRETS; ++i)
-               memset(&ep->secret_key[i], 0, SCTP_SECRET_SIZE);
+       memset(ep->secret_key, 0, sizeof(ep->secret_key));
 
        /* Remove and free the port */
        if (sctp_sk(ep->base.sk)->bind_hash)
@@ -337,7 +332,6 @@ static struct sctp_association *__sctp_endpoint_lookup_assoc(
        struct sctp_transport *t = NULL;
        struct sctp_hashbucket *head;
        struct sctp_ep_common *epb;
-       struct hlist_node *node;
        int hash;
        int rport;
 
@@ -355,7 +349,7 @@ static struct sctp_association *__sctp_endpoint_lookup_assoc(
                                 rport);
        head = &sctp_assoc_hashtable[hash];
        read_lock(&head->lock);
-       sctp_for_each_hentry(epb, node, &head->chain) {
+       sctp_for_each_hentry(epb, &head->chain) {
                tmp = sctp_assoc(epb);
                if (tmp->ep != ep || rport != tmp->peer.port)
                        continue;