Hello,

tb@ hinted to me that sys/net* can benefit from more __func__ 
springkling and I these are the potentially useful places that
I found.

ok?

Index: net/if_pppx.c
===================================================================
RCS file: /home/nayden/cvsync/src/sys/net/if_pppx.c,v
retrieving revision 1.65
diff -u -p -r1.65 if_pppx.c
--- net/if_pppx.c       15 Jun 2018 12:39:38 -0000      1.65
+++ net/if_pppx.c       11 Jul 2018 18:22:55 -0000
@@ -839,7 +839,7 @@ pppx_add_session(struct pppx_dev *pxd, s
        }
 
        if (RBT_INSERT(pppx_ifs, &pppx_ifs, pxi) != NULL)
-               panic("pppx_ifs modified while lock was held");
+               panic("%s: pppx_ifs modified while lock was held", __func__);
        LIST_INSERT_HEAD(&pxd->pxd_pxis, pxi, pxi_list);
        rw_exit_write(&pppx_ifs_lk);
 
@@ -991,7 +991,7 @@ pppx_if_destroy(struct pppx_dev *pxd, st
 
        rw_enter_write(&pppx_ifs_lk);
        if (RBT_REMOVE(pppx_ifs, &pppx_ifs, pxi) == NULL)
-               panic("pppx_ifs modified while lock was held");
+               panic("%s: pppx_ifs modified while lock was held", __func__);
        LIST_REMOVE(pxi, pxi_list);
        rw_exit_write(&pppx_ifs_lk);
 
Index: net/pf_if.c
===================================================================
RCS file: /home/nayden/cvsync/src/sys/net/pf_if.c,v
retrieving revision 1.94
diff -u -p -r1.94 pf_if.c
--- net/pf_if.c 11 Jul 2018 09:05:51 -0000      1.94
+++ net/pf_if.c 11 Jul 2018 18:23:56 -0000
@@ -227,7 +227,7 @@ pfi_attach_ifnet(struct ifnet *ifp)
        pfi_initialize();
        pfi_update++;
        if ((kif = pfi_kif_get(ifp->if_xname)) == NULL)
-               panic("pfi_kif_get failed");
+               panic("%s: pfi_kif_get failed", __func__);
 
        kif->pfik_ifp = ifp;
        ifp->if_pf_kif = (caddr_t)kif;
@@ -265,7 +265,7 @@ pfi_attach_ifgroup(struct ifg_group *ifg
        pfi_initialize();
        pfi_update++;
        if ((kif = pfi_kif_get(ifg->ifg_group)) == NULL)
-               panic("pfi_kif_get failed");
+               panic("%s: pfi_kif_get failed", __func__);
 
        kif->pfik_group = ifg;
        ifg->ifg_pf_kif = (caddr_t)kif;
@@ -293,7 +293,7 @@ pfi_group_change(const char *group)
 
        pfi_update++;
        if ((kif = pfi_kif_get(group)) == NULL)
-               panic("pfi_kif_get failed");
+               panic("%s: pfi_kif_get failed", __func__);
 
        pfi_kif_update(kif);
 }
@@ -305,7 +305,7 @@ pfi_group_addmember(const char *group, s
 
        if ((gkif = pfi_kif_get(group)) == NULL ||
            (ikif = pfi_kif_get(ifp->if_xname)) == NULL)
-               panic("pfi_kif_get failed");
+               panic("%s: pfi_kif_get failed", __func__);
        ikif->pfik_flags |= gkif->pfik_flags;
 
        pfi_group_change(group);        
Index: net80211/ieee80211.c
===================================================================
RCS file: /home/nayden/cvsync/src/sys/net80211/ieee80211.c,v
retrieving revision 1.68
diff -u -p -r1.68 ieee80211.c
--- net80211/ieee80211.c        28 Apr 2018 14:49:07 -0000      1.68
+++ net80211/ieee80211.c        11 Jul 2018 18:43:15 -0000
@@ -823,7 +823,7 @@ ieee80211_setmode(struct ieee80211com *i
         * channel list before committing to the new mode.
         */
        if (mode >= nitems(chanflags))
-               panic("unexpected mode %u", mode);
+               panic("%s: unexpected mode %u", __func__, mode);
        modeflags = chanflags[mode];
        for (i = 0; i <= IEEE80211_CHAN_MAX; i++) {
                c = &ic->ic_channels[i];
@@ -969,7 +969,7 @@ ieee80211_mcs2media(struct ieee80211com 
        case IEEE80211_MODE_11B:
        case IEEE80211_MODE_11G:
                /* these modes use rates, not MCS */
-               panic("unexpected mode %d", mode);
+               panic("%s: unexpected mode %d", __func__, mode);
                break;
        case IEEE80211_MODE_AUTO:
        case IEEE80211_MODE_11N:
@@ -1062,7 +1062,7 @@ ieee80211_rate2media(struct ieee80211com
                break;
        case IEEE80211_MODE_11N:
                /* 11n uses MCS, not rates. */
-               panic("unexpected mode %d", mode);
+               panic("%s: unexpected mode %d", __func__, mode);
                break;
        }
        for (i = 0; i < nitems(rates); i++)
@@ -1135,7 +1135,7 @@ ieee80211_rate2plcp(u_int8_t rate, enum 
                case 108:       return 0x0c;
                }
         } else
-               panic("unexpected mode %u", mode);
+               panic("%s: unexpected mode %u", __func__, mode);
 
        DPRINTF(("unsupported rate %u\n", rate));
 
@@ -1168,7 +1168,7 @@ ieee80211_plcp2rate(u_int8_t plcp, enum 
                case 0x0c:      return 108;
                }
        } else
-               panic("unexpected mode %u", mode);
+               panic("%s: unexpected mode %u", __func__, mode);
 
        DPRINTF(("unsupported plcp %u\n", plcp));
 
Index: net80211/ieee80211_mira.c
===================================================================
RCS file: /home/nayden/cvsync/src/sys/net80211/ieee80211_mira.c,v
retrieving revision 1.11
diff -u -p -r1.11 ieee80211_mira.c
--- net80211/ieee80211_mira.c   23 Apr 2017 21:04:55 -0000      1.11
+++ net80211/ieee80211_mira.c   11 Jul 2018 18:40:25 -0000
@@ -614,7 +614,7 @@ ieee80211_mira_next_rateset(struct ieee8
                else                            /* MCS 0-7 */
                        return NULL;
        } else
-               panic("invalid probing mode %d", mn->probing);
+               panic("%s: invalid probing mode %d", __func__, mn->probing);
 
        rsnext = &ieee80211_mira_ratesets[next];
        if ((rsnext->mcs_mask & mn->valid_rates) == 0)
@@ -695,7 +695,7 @@ ieee80211_mira_probe_next_rateset(struct
                    (1 << ieee80211_mira_next_lower_intra_rate(mn, ni));
 #endif
        } else
-               panic("invalid probing mode %d", mn->probing);
+               panic("%s: invalid probing mode %d", __func__, mn->probing);
 }
 
 int
@@ -709,7 +709,7 @@ ieee80211_mira_next_mcs(struct ieee80211
        else if (mn->probing & IEEE80211_MIRA_PROBING_UP)
                next = ieee80211_mira_next_intra_rate(mn, ni);
        else
-               panic("invalid probing mode %d", mn->probing);
+               panic("%s: invalid probing mode %d", __func__, mn->probing);
 
        return next;
 }
@@ -725,7 +725,7 @@ ieee80211_mira_prev_mcs(struct ieee80211
        else if (mn->probing & IEEE80211_MIRA_PROBING_UP)
                next = ieee80211_mira_next_lower_intra_rate(mn, ni);
        else
-               panic("invalid probing mode %d", mn->probing);
+               panic("%s: invalid probing mode %d", __func__, mn->probing);
 
        return next;
 }
Index: netinet/in.c
===================================================================
RCS file: /home/nayden/cvsync/src/sys/netinet/in.c,v
retrieving revision 1.159
diff -u -p -r1.159 in.c
--- netinet/in.c        3 Jun 2018 18:35:48 -0000       1.159
+++ netinet/in.c        11 Jul 2018 18:29:10 -0000
@@ -324,7 +324,7 @@ in_ioctl_sifaddr(u_long cmd, caddr_t dat
        int newifaddr;
 
        if (cmd != SIOCSIFADDR)
-               panic("invalid ioctl %lu", cmd);
+               panic("%s: invalid ioctl %lu", __func__, cmd);
 
        if (!privileged)
                return (EPERM);
@@ -477,7 +477,7 @@ in_ioctl_change_ifaddr(u_long cmd, caddr
                break;
 
        default:
-               panic("invalid ioctl %lu", cmd);
+               panic("%s: invalid ioctl %lu", __func__, cmd);
        }
 
        NET_UNLOCK();
@@ -542,7 +542,7 @@ in_ioctl_get(u_long cmd, caddr_t data, s
                break;
 
        default:
-               panic("invalid ioctl %lu", cmd);
+               panic("%s: invalid ioctl %lu", __func__, cmd);
        }
 
 err:
Index: netinet6/nd6.c
===================================================================
RCS file: /home/nayden/cvsync/src/sys/netinet6/nd6.c,v
retrieving revision 1.224
diff -u -p -r1.224 nd6.c
--- netinet6/nd6.c      2 May 2018 07:19:45 -0000       1.224
+++ netinet6/nd6.c      11 Jul 2018 18:36:03 -0000
@@ -179,7 +179,7 @@ nd6_option(union nd_opts *ndopts)
        if (!ndopts)
                panic("ndopts == NULL in nd6_option");
        if (!ndopts->nd_opts_last)
-               panic("uninitialized ndopts in nd6_option");
+               panic("%s: uninitialized ndopts", __func__);
        if (!ndopts->nd_opts_search)
                return NULL;
        if (ndopts->nd_opts_done)
@@ -230,7 +230,7 @@ nd6_options(union nd_opts *ndopts)
        if (!ndopts)
                panic("ndopts == NULL in nd6_options");
        if (!ndopts->nd_opts_last)
-               panic("uninitialized ndopts in nd6_options");
+               panic("%s: uninitialized ndopts", __func__);
        if (!ndopts->nd_opts_search)
                return 0;
 

Reply via email to