]> xenbits.xensource.com Git - people/julieng/freebsd.git/commitdiff
Use __func__ instead of __FUNCTION__.
authortuexen <tuexen@FreeBSD.org>
Mon, 19 Oct 2015 11:17:54 +0000 (11:17 +0000)
committertuexen <tuexen@FreeBSD.org>
Mon, 19 Oct 2015 11:17:54 +0000 (11:17 +0000)
This allows to compile the userland stack without errors using gcc5.
Thanks to saghul for makeing me aware and providing the patch.

MFC after: 1 week

sys/netinet/sctp_auth.c
sys/netinet/sctp_input.c
sys/netinet/sctp_output.c
sys/netinet/sctp_pcb.c
sys/netinet/sctp_usrreq.c
sys/netinet/sctputil.c

index 13454df92f15959079d8f4cca286bf49d06ce914..07dbf8ba440db598229c7147476fa20505973c4f 100644 (file)
@@ -558,7 +558,7 @@ sctp_auth_key_acquire(struct sctp_tcb *stcb, uint16_t key_id)
                atomic_add_int(&skey->refcount, 1);
                SCTPDBG(SCTP_DEBUG_AUTH2,
                    "%s: stcb %p key %u refcount acquire to %d\n",
-                   __FUNCTION__, (void *)stcb, key_id, skey->refcount);
+                   __func__, (void *)stcb, key_id, skey->refcount);
        }
 }
 
@@ -578,7 +578,7 @@ sctp_auth_key_release(struct sctp_tcb *stcb, uint16_t key_id, int so_locked
        if (skey) {
                SCTPDBG(SCTP_DEBUG_AUTH2,
                    "%s: stcb %p key %u refcount release to %d\n",
-                   __FUNCTION__, (void *)stcb, key_id, skey->refcount);
+                   __func__, (void *)stcb, key_id, skey->refcount);
 
                /* see if a notification should be generated */
                if ((skey->refcount <= 2) && (skey->deactivated)) {
@@ -587,7 +587,7 @@ sctp_auth_key_release(struct sctp_tcb *stcb, uint16_t key_id, int so_locked
                            key_id, 0, so_locked);
                        SCTPDBG(SCTP_DEBUG_AUTH2,
                            "%s: stcb %p key %u no longer used, %d\n",
-                           __FUNCTION__, (void *)stcb, key_id, skey->refcount);
+                           __func__, (void *)stcb, key_id, skey->refcount);
                }
                sctp_free_sharedkey(skey);
        }
index 37d9e6051ea563357fa94176f81cc0202c988452..8ed155104a5981fa3630a7437c34d3a895318d4a 100644 (file)
@@ -4625,7 +4625,7 @@ __attribute__((noinline))
                        }
                }
                if (stcb == NULL) {
-                       snprintf(msg, sizeof(msg), "OOTB, %s:%d at %s", __FILE__, __LINE__, __FUNCTION__);
+                       snprintf(msg, sizeof(msg), "OOTB, %s:%d at %s", __FILE__, __LINE__, __func__);
                        op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code),
                            msg);
                        /* no association, so it's out of the blue... */
@@ -4669,7 +4669,7 @@ __attribute__((noinline))
                                if (locked_tcb) {
                                        SCTP_TCB_UNLOCK(locked_tcb);
                                }
-                               snprintf(msg, sizeof(msg), "OOTB, %s:%d at %s", __FILE__, __LINE__, __FUNCTION__);
+                               snprintf(msg, sizeof(msg), "OOTB, %s:%d at %s", __FILE__, __LINE__, __func__);
                                op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code),
                                    msg);
                                sctp_handle_ootb(m, iphlen, *offset, src, dst,
@@ -5821,7 +5821,7 @@ sctp_common_input_processing(struct mbuf **mm, int iphlen, int offset, int lengt
                         */
                        SCTP_TCB_UNLOCK(stcb);
                        stcb = NULL;
-                       snprintf(msg, sizeof(msg), "OOTB, %s:%d at %s", __FILE__, __LINE__, __FUNCTION__);
+                       snprintf(msg, sizeof(msg), "OOTB, %s:%d at %s", __FILE__, __LINE__, __func__);
                        op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code),
                            msg);
                        sctp_handle_ootb(m, iphlen, offset, src, dst, sh, inp, op_err,
@@ -5873,7 +5873,7 @@ sctp_common_input_processing(struct mbuf **mm, int iphlen, int offset, int lengt
                }
                if (stcb == NULL) {
                        /* out of the blue DATA chunk */
-                       snprintf(msg, sizeof(msg), "OOTB, %s:%d at %s", __FILE__, __LINE__, __FUNCTION__);
+                       snprintf(msg, sizeof(msg), "OOTB, %s:%d at %s", __FILE__, __LINE__, __func__);
                        op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code),
                            msg);
                        sctp_handle_ootb(m, iphlen, offset, src, dst, sh, inp, op_err,
@@ -5945,7 +5945,7 @@ sctp_common_input_processing(struct mbuf **mm, int iphlen, int offset, int lengt
                        /*
                         * We consider OOTB any data sent during asoc setup.
                         */
-                       snprintf(msg, sizeof(msg), "OOTB, %s:%d at %s", __FILE__, __LINE__, __FUNCTION__);
+                       snprintf(msg, sizeof(msg), "OOTB, %s:%d at %s", __FILE__, __LINE__, __func__);
                        op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code),
                            msg);
                        sctp_handle_ootb(m, iphlen, offset, src, dst, sh, inp, op_err,
index f515d6a6cd2ba6afa729f0c00f2ffd6cd867f3a1..7d13aa22e952c975bb2b6cd613ca606a702b3e93 100644 (file)
@@ -2417,7 +2417,7 @@ sctp_is_addr_restricted(struct sctp_tcb *stcb, struct sctp_ifa *ifa)
        LIST_FOREACH(laddr, &stcb->asoc.sctp_restricted_addrs, sctp_nxt_addr) {
                if (laddr->ifa == NULL) {
                        SCTPDBG(SCTP_DEBUG_OUTPUT1, "%s: NULL ifa\n",
-                           __FUNCTION__);
+                           __func__);
                        continue;
                }
                if (laddr->ifa == ifa) {
@@ -2439,7 +2439,7 @@ sctp_is_addr_in_ep(struct sctp_inpcb *inp, struct sctp_ifa *ifa)
        LIST_FOREACH(laddr, &inp->sctp_addr_list, sctp_nxt_addr) {
                if (laddr->ifa == NULL) {
                        SCTPDBG(SCTP_DEBUG_OUTPUT1, "%s: NULL ifa\n",
-                           __FUNCTION__);
+                           __func__);
                        continue;
                }
                if ((laddr->ifa == ifa) && laddr->action == 0)
@@ -5524,7 +5524,7 @@ do_a_abort:
                if (op_err == NULL) {
                        char msg[SCTP_DIAG_INFO_LEN];
 
-                       snprintf(msg, sizeof(msg), "%s:%d at %s", __FILE__, __LINE__, __FUNCTION__);
+                       snprintf(msg, sizeof(msg), "%s:%d at %s", __FILE__, __LINE__, __func__);
                        op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code),
                            msg);
                }
@@ -6687,7 +6687,7 @@ sctp_sendall_iterator(struct sctp_inpcb *inp, struct sctp_tcb *stcb, void *ptr,
 
                                abort_anyway:
                                                snprintf(msg, sizeof(msg),
-                                                   "%s:%d at %s", __FILE__, __LINE__, __FUNCTION__);
+                                                   "%s:%d at %s", __FILE__, __LINE__, __func__);
                                                op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code),
                                                    msg);
                                                atomic_add_int(&stcb->asoc.refcnt, 1);
@@ -13387,7 +13387,7 @@ dataless_eof:
                                                free_cnt_applied = 0;
                                        }
                                        snprintf(msg, sizeof(msg),
-                                           "%s:%d at %s", __FILE__, __LINE__, __FUNCTION__);
+                                           "%s:%d at %s", __FILE__, __LINE__, __func__);
                                        op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code),
                                            msg);
                                        sctp_abort_an_association(stcb->sctp_ep, stcb,
index 07119f15d9ff6f664c608472bc2fffab5b12461c..92a84d6a29999e0b890ce23c0e403983d192720d 100644 (file)
@@ -1115,7 +1115,7 @@ sctp_tcb_special_locate(struct sctp_inpcb **inp_p, struct sockaddr *from,
                        LIST_FOREACH(laddr, &inp->sctp_addr_list, sctp_nxt_addr) {
 
                                if (laddr->ifa == NULL) {
-                                       SCTPDBG(SCTP_DEBUG_PCB1, "%s: NULL ifa\n", __FUNCTION__);
+                                       SCTPDBG(SCTP_DEBUG_PCB1, "%s: NULL ifa\n", __func__);
                                        continue;
                                }
                                if (laddr->ifa->localifa_flags & SCTP_BEING_DELETED) {
@@ -1773,7 +1773,7 @@ sctp_endpoint_probe(struct sockaddr *nam, struct sctppcbhead *head,
                LIST_FOREACH(laddr, &inp->sctp_addr_list, sctp_nxt_addr) {
                        if (laddr->ifa == NULL) {
                                SCTPDBG(SCTP_DEBUG_PCB1, "%s: NULL ifa\n",
-                                   __FUNCTION__);
+                                   __func__);
                                continue;
                        }
                        SCTPDBG(SCTP_DEBUG_PCB1, "Ok laddr->ifa:%p is possible, ",
@@ -2343,7 +2343,7 @@ sctp_findassociation_ep_asconf(struct mbuf *m, int offset,
            &parm_buf, sizeof(struct sctp_paramhdr));
        if (phdr == NULL) {
                SCTPDBG(SCTP_DEBUG_INPUT3, "%s: failed to get asconf lookup addr\n",
-                   __FUNCTION__);
+                   __func__);
                return NULL;
        }
        ptype = (int)((uint32_t) ntohs(phdr->param_type));
@@ -2363,7 +2363,7 @@ sctp_findassociation_ep_asconf(struct mbuf *m, int offset,
                            &p6_buf.ph, sizeof(*p6));
                        if (p6 == NULL) {
                                SCTPDBG(SCTP_DEBUG_INPUT3, "%s: failed to get asconf v6 lookup addr\n",
-                                   __FUNCTION__);
+                                   __func__);
                                return (NULL);
                        }
                        sin6 = &remote_store.sin6;
@@ -2390,7 +2390,7 @@ sctp_findassociation_ep_asconf(struct mbuf *m, int offset,
                            &p4_buf.ph, sizeof(*p4));
                        if (p4 == NULL) {
                                SCTPDBG(SCTP_DEBUG_INPUT3, "%s: failed to get asconf v4 lookup addr\n",
-                                   __FUNCTION__);
+                                   __func__);
                                return (NULL);
                        }
                        sin = &remote_store.sin;
@@ -5300,7 +5300,7 @@ sctp_update_ep_vflag(struct sctp_inpcb *inp)
        LIST_FOREACH(laddr, &inp->sctp_addr_list, sctp_nxt_addr) {
                if (laddr->ifa == NULL) {
                        SCTPDBG(SCTP_DEBUG_PCB1, "%s: NULL ifa\n",
-                           __FUNCTION__);
+                           __func__);
                        continue;
                }
                if (laddr->ifa->localifa_flags & SCTP_BEING_DELETED) {
@@ -6258,7 +6258,7 @@ sctp_load_addresses_from_init(struct sctp_tcb *stcb, struct mbuf *m,
                                                         * abort this guy
                                                         */
                                                        snprintf(msg, sizeof(msg),
-                                                           "%s:%d at %s", __FILE__, __LINE__, __FUNCTION__);
+                                                           "%s:%d at %s", __FILE__, __LINE__, __func__);
                                                        op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code),
                                                            msg);
                                                        sctp_abort_an_association(stcb_tmp->sctp_ep,
@@ -6357,7 +6357,7 @@ sctp_load_addresses_from_init(struct sctp_tcb *stcb, struct mbuf *m,
                                                         * abort this guy
                                                         */
                                                        snprintf(msg, sizeof(msg),
-                                                           "%s:%d at %s", __FILE__, __LINE__, __FUNCTION__);
+                                                           "%s:%d at %s", __FILE__, __LINE__, __func__);
                                                        op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code),
                                                            msg);
                                                        sctp_abort_an_association(stcb_tmp->sctp_ep,
index 78f4508c5015951796f09365d6157a6c8aca484e..266861ecb9c6278c4ac1f67995a6cb9de8f25814 100644 (file)
@@ -5815,7 +5815,7 @@ sctp_setopt(struct socket *so, int optname, void *optval, size_t optsize,
                                        LIST_FOREACH(laddr, &inp->sctp_addr_list, sctp_nxt_addr) {
                                                if (laddr->ifa == NULL) {
                                                        SCTPDBG(SCTP_DEBUG_OUTPUT1, "%s: NULL ifa\n",
-                                                           __FUNCTION__);
+                                                           __func__);
                                                        continue;
                                                }
                                                if (laddr->ifa == ifa) {
index 8a4a65e48b58e223ca60b1ab588e6c221b59cdc2..e451cb18d3825dc4ba3293fa229018de1d3aff98 100644 (file)
@@ -2183,13 +2183,13 @@ sctp_timer_start(int t_type, struct sctp_inpcb *inp, struct sctp_tcb *stcb,
                break;
        default:
                SCTPDBG(SCTP_DEBUG_TIMER1, "%s: Unknown timer type %d\n",
-                   __FUNCTION__, t_type);
+                   __func__, t_type);
                return;
                break;
        }
        if ((to_ticks <= 0) || (tmr == NULL)) {
                SCTPDBG(SCTP_DEBUG_TIMER1, "%s: %d:software error to_ticks:%d tmr:%p not set ??\n",
-                   __FUNCTION__, t_type, to_ticks, (void *)tmr);
+                   __func__, t_type, to_ticks, (void *)tmr);
                return;
        }
        if (SCTP_OS_TIMER_PENDING(&tmr->timer)) {
@@ -2345,7 +2345,7 @@ sctp_timer_stop(int t_type, struct sctp_inpcb *inp, struct sctp_tcb *stcb,
                break;
        default:
                SCTPDBG(SCTP_DEBUG_TIMER1, "%s: Unknown timer type %d\n",
-                   __FUNCTION__, t_type);
+                   __func__, t_type);
                break;
        }
        if (tmr == NULL) {
@@ -3777,7 +3777,7 @@ sctp_ulp_notify(uint32_t notification, struct sctp_tcb *stcb,
                break;
        default:
                SCTPDBG(SCTP_DEBUG_UTIL1, "%s: unknown notification %xh (%u)\n",
-                   __FUNCTION__, notification, notification);
+                   __func__, notification, notification);
                break;
        }                       /* end switch */
 }