From 5e2195bf0c456a6958ef530a6926283b6e619356 Mon Sep 17 00:00:00 2001 From: Joerg Sonnenberger Date: Thu, 17 Feb 2005 14:00:10 +0000 Subject: [PATCH] GCC supports two pseudo variables to get the function name, __FUNCTION__ and __func__. The latter is C99, prefer that. --- gnu/usr.bin/binutils/libbfd/alpha/bfd.h | 6 +- gnu/usr.bin/binutils/libbfd/i386/bfd.h | 6 +- gnu/usr.bin/gdb/libbfd/bfd.h | 6 +- lib/libc/locale/collate.c | 8 +- lib/libcr/locale/collate.c | 8 +- lib/libncp/ncpl_subr.c | 12 +- lib/libnetgraph/sock.c | 4 +- lib/libpam/libpam/security/pam_mod_misc.h | 8 +- lib/libstand/stand.h | 6 +- share/examples/drivers/make_device_driver.sh | 6 +- share/examples/drivers/make_pseudo_driver.sh | 6 +- sys/bus/firewire/firewire.c | 12 +- sys/bus/firewire/fwmem.c | 10 +- sys/bus/iicbus/i386/pcf.c | 4 +- sys/bus/iicbus/iic.c | 6 +- sys/bus/iicbus/iicbus.c | 6 +- sys/bus/iicbus/iicsmb.c | 8 +- sys/bus/ppbus/ppb_1284.c | 8 +- sys/bus/ppbus/ppb_msq.c | 16 +- sys/dev/agp/agp_intel.c | 10 +- sys/dev/disk/sbp/sbp.c | 26 ++-- sys/dev/disk/vpo/vpoio.c | 6 +- sys/dev/drm/drm_dma.h | 6 +- sys/dev/drm/drm_os_freebsd.h | 4 +- sys/dev/drm/drm_scatter.h | 4 +- sys/dev/drm/mga/mga_dma.c | 4 +- sys/dev/drm/mga/mga_drv.h | 12 +- sys/dev/drm/mga/mga_state.c | 8 +- sys/dev/drm/r128/r128_cce.c | 6 +- sys/dev/drm/r128/r128_drv.h | 4 +- sys/dev/drm/r128/r128_state.c | 38 ++--- sys/dev/drm/radeon/radeon_cp.c | 10 +- sys/dev/drm/radeon/radeon_drv.h | 4 +- sys/dev/drm/radeon/radeon_irq.c | 8 +- sys/dev/drm/radeon/radeon_mem.c | 8 +- sys/dev/drm/radeon/radeon_state.c | 18 +-- sys/dev/misc/ppc/ppc.c | 24 +-- sys/dev/netif/em/Makefile | 13 +- sys/dev/netif/ic/if_ic.c | 4 +- sys/dev/netif/ray/if_raydbg.h | 12 +- sys/dev/powermng/i386/alpm/alpm.c | 5 +- sys/dev/powermng/i386/amdpm/amdpm.c | 4 +- sys/dev/powermng/i386/viapm/viapm.c | 5 +- sys/dev/powermng/ichsmb/ichsmb.c | 26 ++-- sys/dev/raid/aac/aacvar.h | 8 +- sys/dev/raid/mlx/mlx.c | 4 +- sys/dev/raid/mlx/mlxvar.h | 6 +- sys/dev/raid/mly/mlyvar.h | 6 +- sys/emulation/ibcs2/coff/imgact_coff.c | 4 +- sys/emulation/linux/linux_ioctl.c | 8 +- sys/kern/libmchain/subr_mchain.c | 6 +- sys/kern/subr_bus.c | 4 +- sys/kern/subr_sbuf.c | 14 +- sys/kern/uipc_mbuf.c | 6 +- sys/net/ef/if_ef.c | 6 +- sys/net/i4b/include/i386/i4b_debug.h | 10 +- sys/net/if_arcsubr.c | 4 +- sys/net/if_ethersubr.c | 4 +- sys/net/ip6fw/ip6_fw.c | 4 +- sys/net/pf/pf_norm.c | 28 ++-- sys/netgraph/UI/ng_UI.c | 6 +- sys/netgraph/async/ng_async.c | 8 +- sys/netgraph/bpf/ng_bpf.c | 4 +- sys/netgraph/bridge/ng_bridge.c | 22 +-- sys/netgraph/ether/ng_ether.c | 14 +- sys/netgraph/fec/ng_fec.c | 8 +- sys/netgraph/frame_relay/ng_frame_relay.c | 4 +- sys/netgraph/iface/ng_iface.c | 18 +-- sys/netgraph/ksocket/ng_ksocket.c | 6 +- sys/netgraph/l2tp/ng_l2tp.c | 10 +- sys/netgraph/mppc/ng_mppc.c | 18 +-- sys/netgraph/netgraph/ng_base.c | 14 +- sys/netgraph/one2many/ng_one2many.c | 14 +- sys/netgraph/ppp/ng_ppp.c | 24 +-- sys/netgraph/pppoe/ng_pppoe.c | 4 +- sys/netgraph/pptpgre/ng_pptpgre.c | 18 +-- sys/netgraph/rfc1490/ng_rfc1490.c | 6 +- sys/netgraph/socket/ng_socket.c | 4 +- sys/netgraph/tee/ng_tee.c | 6 +- sys/netgraph/tty/ng_tty.c | 10 +- sys/netgraph/vjc/ng_vjc.c | 8 +- sys/netinet/ip_divert.c | 6 +- sys/netproto/ncp/ncp_login.c | 4 +- sys/netproto/ncp/ncp_ncp.c | 8 +- sys/netproto/ncp/ncp_subr.c | 4 +- sys/netproto/ncp/ncp_subr.h | 12 +- sys/netproto/smb/smb_smb.c | 8 +- sys/netproto/smb/smb_subr.h | 10 +- sys/netproto/smb/smb_trantcp.h | 4 +- sys/sys/ckpt.h | 11 +- sys/sys/iconv.h | 4 +- sys/sys/systm.h | 4 +- sys/vfs/coda/coda_psdev.c | 4 +- sys/vfs/coda/coda_vfsops.c | 4 +- sys/vfs/coda/coda_vnops.c | 4 +- sys/vfs/gnu/ext2fs/ext2_fs.h | 4 +- sys/vfs/nwfs/nwfs_io.c | 6 +- sys/vfs/nwfs/nwfs_subr.c | 4 +- sys/vfs/smbfs/smbfs_smb.c | 4 +- sys/vfs/smbfs/smbfs_subr.h | 6 +- sys/vfs/udf/udf_vnops.c | 6 +- usr.sbin/inetd/inetd.c | 20 +-- usr.sbin/mlxcontrol/mlxcontrol.h | 4 +- usr.sbin/rrenumd/rrenumd.c | 42 ++--- usr.sbin/rtadvd/advcap.c | 4 +- usr.sbin/rtadvd/config.c | 108 ++++++------- usr.sbin/rtadvd/dump.c | 4 +- usr.sbin/rtadvd/if.c | 22 +-- usr.sbin/rtadvd/rrenum.c | 40 ++--- usr.sbin/rtadvd/rtadvd.c | 156 +++++++++---------- usr.sbin/rtadvd/timer.c | 8 +- usr.sbin/rtsold/dump.c | 4 +- usr.sbin/rtsold/if.c | 36 ++--- usr.sbin/rtsold/probe.c | 18 +-- usr.sbin/rtsold/rtsock.c | 12 +- usr.sbin/rtsold/rtsol.c | 44 +++--- usr.sbin/rtsold/rtsold.c | 32 ++-- 117 files changed, 712 insertions(+), 722 deletions(-) diff --git a/gnu/usr.bin/binutils/libbfd/alpha/bfd.h b/gnu/usr.bin/binutils/libbfd/alpha/bfd.h index a57187723c..1bd672a09c 100644 --- a/gnu/usr.bin/binutils/libbfd/alpha/bfd.h +++ b/gnu/usr.bin/binutils/libbfd/alpha/bfd.h @@ -1,5 +1,5 @@ /* $FreeBSD: src/gnu/usr.bin/binutils/libbfd/alpha/bfd.h,v 1.3.2.4 2002/09/01 23:39:15 obrien Exp $ */ -/* $DragonFly: src/gnu/usr.bin/binutils/libbfd/alpha/Attic/bfd.h,v 1.2 2003/06/17 04:25:44 dillon Exp $ */ +/* $DragonFly: src/gnu/usr.bin/binutils/libbfd/alpha/Attic/bfd.h,v 1.3 2005/02/17 13:59:35 joerg Exp $ */ /* DO NOT EDIT! -*- buffer-read-only: t -*- This file is automatically generated from "bfd-in.h", "init.c", "opncls.c", "libbfd.c", @@ -495,10 +495,10 @@ extern int bfd_stat PARAMS ((bfd *, struct stat *)); /* Deprecated old routines. */ #if __GNUC__ #define bfd_read(BUF, ELTSIZE, NITEMS, ABFD) \ - (warn_deprecated ("bfd_read", __FILE__, __LINE__, __FUNCTION__), \ + (warn_deprecated ("bfd_read", __FILE__, __LINE__, __func__), \ bfd_bread ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) #define bfd_write(BUF, ELTSIZE, NITEMS, ABFD) \ - (warn_deprecated ("bfd_write", __FILE__, __LINE__, __FUNCTION__), \ + (warn_deprecated ("bfd_write", __FILE__, __LINE__, __func__), \ bfd_bwrite ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) #else #define bfd_read(BUF, ELTSIZE, NITEMS, ABFD) \ diff --git a/gnu/usr.bin/binutils/libbfd/i386/bfd.h b/gnu/usr.bin/binutils/libbfd/i386/bfd.h index b0316362ba..fd1ad247e6 100644 --- a/gnu/usr.bin/binutils/libbfd/i386/bfd.h +++ b/gnu/usr.bin/binutils/libbfd/i386/bfd.h @@ -1,5 +1,5 @@ /* $FreeBSD: src/gnu/usr.bin/binutils/libbfd/i386/bfd.h,v 1.2.6.4 2002/09/01 23:39:16 obrien Exp $ */ -/* $DragonFly: src/gnu/usr.bin/binutils/libbfd/i386/Attic/bfd.h,v 1.2 2003/06/17 04:25:44 dillon Exp $ */ +/* $DragonFly: src/gnu/usr.bin/binutils/libbfd/i386/Attic/bfd.h,v 1.3 2005/02/17 13:59:35 joerg Exp $ */ /* DO NOT EDIT! -*- buffer-read-only: t -*- This file is automatically generated from "bfd-in.h", "init.c", "opncls.c", "libbfd.c", @@ -495,10 +495,10 @@ extern int bfd_stat PARAMS ((bfd *, struct stat *)); /* Deprecated old routines. */ #if __GNUC__ #define bfd_read(BUF, ELTSIZE, NITEMS, ABFD) \ - (warn_deprecated ("bfd_read", __FILE__, __LINE__, __FUNCTION__), \ + (warn_deprecated ("bfd_read", __FILE__, __LINE__, __func__), \ bfd_bread ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) #define bfd_write(BUF, ELTSIZE, NITEMS, ABFD) \ - (warn_deprecated ("bfd_write", __FILE__, __LINE__, __FUNCTION__), \ + (warn_deprecated ("bfd_write", __FILE__, __LINE__, __func__), \ bfd_bwrite ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) #else #define bfd_read(BUF, ELTSIZE, NITEMS, ABFD) \ diff --git a/gnu/usr.bin/gdb/libbfd/bfd.h b/gnu/usr.bin/gdb/libbfd/bfd.h index 571a3ef6d3..b8445675b9 100644 --- a/gnu/usr.bin/gdb/libbfd/bfd.h +++ b/gnu/usr.bin/gdb/libbfd/bfd.h @@ -1,4 +1,4 @@ -/* $DragonFly: src/gnu/usr.bin/gdb/libbfd/Attic/bfd.h,v 1.1 2004/10/23 17:02:38 joerg Exp $ */ +/* $DragonFly: src/gnu/usr.bin/gdb/libbfd/Attic/bfd.h,v 1.2 2005/02/17 13:59:35 joerg Exp $ */ /* DO NOT EDIT! -*- buffer-read-only: t -*- This file is automatically generated from "bfd-in.h", "init.c", "opncls.c", "libbfd.c", "bfdio.c", "bfdwin.c", "section.c", "archures.c", "reloc.c", @@ -481,10 +481,10 @@ extern int bfd_stat (bfd *, struct stat *); /* Deprecated old routines. */ #if __GNUC__ #define bfd_read(BUF, ELTSIZE, NITEMS, ABFD) \ - (warn_deprecated ("bfd_read", __FILE__, __LINE__, __FUNCTION__), \ + (warn_deprecated ("bfd_read", __FILE__, __LINE__, __func__), \ bfd_bread ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) #define bfd_write(BUF, ELTSIZE, NITEMS, ABFD) \ - (warn_deprecated ("bfd_write", __FILE__, __LINE__, __FUNCTION__), \ + (warn_deprecated ("bfd_write", __FILE__, __LINE__, __func__), \ bfd_bwrite ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) #else #define bfd_read(BUF, ELTSIZE, NITEMS, ABFD) \ diff --git a/lib/libc/locale/collate.c b/lib/libc/locale/collate.c index 601e629fd7..4a567c78da 100644 --- a/lib/libc/locale/collate.c +++ b/lib/libc/locale/collate.c @@ -25,7 +25,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/lib/libc/locale/collate.c,v 1.21.2.4 2002/10/11 10:36:47 ache Exp $ - * $DragonFly: src/lib/libc/locale/collate.c,v 1.3 2005/01/31 22:29:31 dillon Exp $ + * $DragonFly: src/lib/libc/locale/collate.c,v 1.4 2005/02/17 13:59:35 joerg Exp $ */ #include "namespace.h" @@ -201,14 +201,14 @@ __collate_substitute(s) delta += delta / 8; dest_str = malloc(dest_len = delta); if (dest_str == NULL) - __collate_err(EX_OSERR, __FUNCTION__); + __collate_err(EX_OSERR, __func__); len = 0; while (*s) { nlen = len + strlen(__collate_substitute_table[*s]); if (dest_len <= nlen) { dest_str = reallocf(dest_str, dest_len = nlen + delta); if (dest_str == NULL) - __collate_err(EX_OSERR, __FUNCTION__); + __collate_err(EX_OSERR, __func__); } (void)strcpy(dest_str + len, __collate_substitute_table[*s++]); len = nlen; @@ -245,7 +245,7 @@ __collate_strdup(s) u_char *t = strdup(s); if (t == NULL) - __collate_err(EX_OSERR, __FUNCTION__); + __collate_err(EX_OSERR, __func__); return (t); } diff --git a/lib/libcr/locale/collate.c b/lib/libcr/locale/collate.c index 695d945e3a..f9ad1d50d9 100644 --- a/lib/libcr/locale/collate.c +++ b/lib/libcr/locale/collate.c @@ -25,7 +25,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/lib/libc/locale/collate.c,v 1.21.2.4 2002/10/11 10:36:47 ache Exp $ - * $DragonFly: src/lib/libcr/locale/Attic/collate.c,v 1.2 2003/06/17 04:26:43 dillon Exp $ + * $DragonFly: src/lib/libcr/locale/Attic/collate.c,v 1.3 2005/02/17 13:59:35 joerg Exp $ */ #include @@ -199,14 +199,14 @@ __collate_substitute(s) delta += delta / 8; dest_str = malloc(dest_len = delta); if (dest_str == NULL) - __collate_err(EX_OSERR, __FUNCTION__); + __collate_err(EX_OSERR, __func__); len = 0; while (*s) { nlen = len + strlen(__collate_substitute_table[*s]); if (dest_len <= nlen) { dest_str = reallocf(dest_str, dest_len = nlen + delta); if (dest_str == NULL) - __collate_err(EX_OSERR, __FUNCTION__); + __collate_err(EX_OSERR, __func__); } (void)strcpy(dest_str + len, __collate_substitute_table[*s++]); len = nlen; @@ -243,7 +243,7 @@ __collate_strdup(s) u_char *t = strdup(s); if (t == NULL) - __collate_err(EX_OSERR, __FUNCTION__); + __collate_err(EX_OSERR, __func__); return (t); } diff --git a/lib/libncp/ncpl_subr.c b/lib/libncp/ncpl_subr.c index 4add94dc0f..e8e97f3e08 100644 --- a/lib/libncp/ncpl_subr.c +++ b/lib/libncp/ncpl_subr.c @@ -30,7 +30,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/lib/libncp/ncpl_subr.c,v 1.3 2000/01/01 14:21:31 bp Exp $ - * $DragonFly: src/lib/libncp/ncpl_subr.c,v 1.3 2004/02/03 07:34:10 dillon Exp $ + * $DragonFly: src/lib/libncp/ncpl_subr.c,v 1.4 2005/02/17 13:59:35 joerg Exp $ */ #include @@ -221,24 +221,24 @@ ncp_initlib(void){ return 0; error = sysctlbyname("net.ncp.sysent", &sysentoffset, &len, NULL, 0); if (error) { - fprintf(stderr, "%s: can't find kernel module\n", __FUNCTION__); + fprintf(stderr, "%s: can't find kernel module\n", __func__); return error; } error = sysctlbyname("net.ncp.version", &kv, &kvlen, NULL, 0); if (error) { - fprintf(stderr, "%s: kernel module is old, please recompile it.\n", __FUNCTION__); + fprintf(stderr, "%s: kernel module is old, please recompile it.\n", __func__); return error; } if (NCP_VERSION != kv) { - fprintf(stderr, "%s: kernel module version(%d) don't match library(%d).\n", __FUNCTION__, kv, NCP_VERSION); + fprintf(stderr, "%s: kernel module version(%d) don't match library(%d).\n", __func__, kv, NCP_VERSION); return EINVAL; } if ((error = ncp_nls_setrecode(0)) != 0) { - fprintf(stderr, "%s: can't initialise recode\n", __FUNCTION__); + fprintf(stderr, "%s: can't initialise recode\n", __func__); return error; } if ((error = ncp_nls_setlocale("")) != 0) { - fprintf(stderr, "%s: can't initialise locale\n", __FUNCTION__); + fprintf(stderr, "%s: can't initialise locale\n", __func__); return error; } ncp_initialized++; diff --git a/lib/libnetgraph/sock.c b/lib/libnetgraph/sock.c index eb8a2e3892..0d067b90d4 100644 --- a/lib/libnetgraph/sock.c +++ b/lib/libnetgraph/sock.c @@ -37,7 +37,7 @@ * Author: Archie Cobbs * * $FreeBSD: src/lib/libnetgraph/sock.c,v 1.2 2000/01/28 00:48:27 archie Exp $ - * $DragonFly: src/lib/libnetgraph/sock.c,v 1.3 2003/08/08 04:18:34 dillon Exp $ + * $DragonFly: src/lib/libnetgraph/sock.c,v 1.4 2005/02/17 13:59:35 joerg Exp $ * $Whistle: sock.c,v 1.12 1999/01/20 00:57:23 archie Exp $ */ @@ -196,7 +196,7 @@ NgNameNode(int cs, const char *path, const char *fmt, ...) if (NgSendMsg(cs, path, NGM_GENERIC_COOKIE, NGM_NAME, &ngn, sizeof(ngn)) < 0) { if (_gNgDebugLevel >= 1) - NGLOGX("%s: failed", __FUNCTION__); + NGLOGX("%s: failed", __func__); return (-1); } diff --git a/lib/libpam/libpam/security/pam_mod_misc.h b/lib/libpam/libpam/security/pam_mod_misc.h index 2330891290..8648ca7004 100644 --- a/lib/libpam/libpam/security/pam_mod_misc.h +++ b/lib/libpam/libpam/security/pam_mod_misc.h @@ -24,7 +24,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/lib/libpam/libpam/security/pam_mod_misc.h,v 1.10.2.2 2002/07/03 21:45:44 des Exp $ - * $DragonFly: src/lib/libpam/libpam/security/Attic/pam_mod_misc.h,v 1.2 2003/06/17 04:26:50 dillon Exp $ + * $DragonFly: src/lib/libpam/libpam/security/Attic/pam_mod_misc.h,v 1.3 2005/02/17 13:59:35 joerg Exp $ */ #ifndef PAM_MOD_MISC_H @@ -64,16 +64,16 @@ void pam_clear_option(struct options *, enum opt); __END_DECLS #define PAM_LOG(args...) \ - _pam_log(&options, __FILE__, __FUNCTION__, ##args) + _pam_log(&options, __FILE__, __func__, ##args) #define PAM_RETURN(arg) \ do { \ - _pam_log_retval(&options, __FILE__, __FUNCTION__, arg); \ + _pam_log_retval(&options, __FILE__, __func__, arg); \ return arg; \ } while (0) #define PAM_VERBOSE_ERROR(args...) \ - _pam_verbose_error(pamh, &options, __FILE__, __FUNCTION__, ##args) + _pam_verbose_error(pamh, &options, __FILE__, __func__, ##args) #ifdef NGROUPS_MAX #define PAM_SAVED_CRED "pam_saved_cred" diff --git a/lib/libstand/stand.h b/lib/libstand/stand.h index 16ad1dc1ce..b30f8b85c5 100644 --- a/lib/libstand/stand.h +++ b/lib/libstand/stand.h @@ -24,7 +24,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/lib/libstand/stand.h,v 1.18.2.8 2002/06/17 11:22:39 sobomax Exp $ - * $DragonFly: src/lib/libstand/stand.h,v 1.4 2003/11/10 06:14:44 dillon Exp $ + * $DragonFly: src/lib/libstand/stand.h,v 1.5 2005/02/17 13:59:35 joerg Exp $ * From $NetBSD: stand.h,v 1.22 1997/06/26 19:17:40 drochner Exp $ */ @@ -72,8 +72,8 @@ #include #include -#define CHK(fmt, args...) printf("%s(%d): " fmt "\n", __FUNCTION__, __LINE__ , ##args) -#define PCHK(fmt, args...) {printf("%s(%d): " fmt "\n", __FUNCTION__, __LINE__ , ##args); getchar();} +#define CHK(fmt, args...) printf("%s(%d): " fmt "\n", __func__, __LINE__ , ##args) +#define PCHK(fmt, args...) {printf("%s(%d): " fmt "\n", __func__, __LINE__ , ##args); getchar();} #ifndef NULL #define NULL 0 diff --git a/share/examples/drivers/make_device_driver.sh b/share/examples/drivers/make_device_driver.sh index 19177cdfab..74c9d8bbbf 100644 --- a/share/examples/drivers/make_device_driver.sh +++ b/share/examples/drivers/make_device_driver.sh @@ -30,7 +30,7 @@ cat >${UPPER} <>${UPPER} @@ -202,11 +202,11 @@ ${1}attach (struct isa_device *dev) #define CHECKUNIT(RETVAL) \ do { /* the do-while is a safe way to do this grouping */ \ if (unit > N${UPPER}) { \ - printf(__FUNCTION__ ":bad unit %d\n", unit); \ + printf("%s:bad unit %d\n", __func__, unit); \ return (RETVAL); \ } \ if (scp == NULL) { \ - printf( __FUNCTION__ ": unit %d not attached\n", unit);\ + printf( "%s: unit %d not attached\n", __func__, unit);\ return (RETVAL); \ } \ } while (0) diff --git a/share/examples/drivers/make_pseudo_driver.sh b/share/examples/drivers/make_pseudo_driver.sh index 6566f1698b..22ce867249 100644 --- a/share/examples/drivers/make_pseudo_driver.sh +++ b/share/examples/drivers/make_pseudo_driver.sh @@ -22,7 +22,7 @@ cat >${UPPER} <>${UPPER} @@ -107,11 +107,11 @@ static sc_p sca[N${UPPER}]; #define CHECKUNIT(RETVAL) \ do { /* the do-while is a safe way to do this grouping */ \ if (unit > N${UPPER}) { \ - printf(__FUNCTION__ ":bad unit %d\n", unit); \ + printf("%s: bad unit %d\n", __func__, unit); \ return (RETVAL); \ } \ if (scp == NULL) { \ - printf( __FUNCTION__ ": unit %d not attached\n", unit);\ + printf("%s: unit %d not attached\n", __func__, unit);\ return (RETVAL); \ } \ } while (0) diff --git a/sys/bus/firewire/firewire.c b/sys/bus/firewire/firewire.c index 34b93bb2aa..33c9c2ff94 100644 --- a/sys/bus/firewire/firewire.c +++ b/sys/bus/firewire/firewire.c @@ -32,7 +32,7 @@ * POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/dev/firewire/firewire.c,v 1.68 2004/01/08 14:58:09 simokawa Exp $ - * $DragonFly: src/sys/bus/firewire/firewire.c,v 1.9 2004/12/20 17:44:51 dillon Exp $ + * $DragonFly: src/sys/bus/firewire/firewire.c,v 1.10 2005/02/17 13:59:35 joerg Exp $ * */ @@ -848,7 +848,7 @@ fw_bindadd(struct firewire_comm *fc, struct fw_bind *fwb) struct fw_bind *tfw, *prev = NULL; if (fwb->start > fwb->end) { - printf("%s: invalid range\n", __FUNCTION__); + printf("%s: invalid range\n", __func__); return EINVAL; } @@ -866,7 +866,7 @@ fw_bindadd(struct firewire_comm *fc, struct fw_bind *fwb) goto out; } - printf("%s: bind failed\n", __FUNCTION__); + printf("%s: bind failed\n", __func__); return (EBUSY); out: @@ -894,7 +894,7 @@ fw_bindremove(struct firewire_comm *fc, struct fw_bind *fwb) goto found; } - printf("%s: no such bind\n", __FUNCTION__); + printf("%s: no such bind\n", __func__); splx(s); return (1); found: @@ -1055,7 +1055,7 @@ void fw_xfer_free_buf( struct fw_xfer* xfer) { if (xfer == NULL) { - printf("%s: xfer == NULL\n", __FUNCTION__); + printf("%s: xfer == NULL\n", __func__); return; } fw_xfer_unload(xfer); @@ -1072,7 +1072,7 @@ void fw_xfer_free( struct fw_xfer* xfer) { if (xfer == NULL) { - printf("%s: xfer == NULL\n", __FUNCTION__); + printf("%s: xfer == NULL\n", __func__); return; } fw_xfer_unload(xfer); diff --git a/sys/bus/firewire/fwmem.c b/sys/bus/firewire/fwmem.c index 04492ee427..50894d90bd 100644 --- a/sys/bus/firewire/fwmem.c +++ b/sys/bus/firewire/fwmem.c @@ -31,7 +31,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $DragonFly: src/sys/bus/firewire/fwmem.c,v 1.5 2004/02/05 17:51:43 joerg Exp $ + * $DragonFly: src/sys/bus/firewire/fwmem.c,v 1.6 2005/02/17 13:59:35 joerg Exp $ */ #ifndef __DragonFly__ @@ -295,7 +295,7 @@ fwmem_open (dev_t dev, int flags, int fmt, fw_proc *td) fms->refcount = 1; } if (fwmem_debug) - printf("%s: refcount=%d\n", __FUNCTION__, fms->refcount); + printf("%s: refcount=%d\n", __func__, fms->refcount); return (0); } @@ -308,7 +308,7 @@ fwmem_close (dev_t dev, int flags, int fmt, fw_proc *td) fms = (struct fwmem_softc *)dev->si_drv1; fms->refcount --; if (fwmem_debug) - printf("%s: refcount=%d\n", __FUNCTION__, fms->refcount); + printf("%s: refcount=%d\n", __func__, fms->refcount); if (fms->refcount < 1) { free(dev->si_drv1, M_FW); dev->si_drv1 = NULL; @@ -328,7 +328,7 @@ fwmem_biodone(struct fw_xfer *xfer) if (bp->bio_error != 0) { if (fwmem_debug) - printf("%s: err=%d\n", __FUNCTION__, bp->bio_error); + printf("%s: err=%d\n", __func__, bp->bio_error); bp->bio_flags |= BIO_ERROR; bp->bio_resid = bp->bio_bcount; } @@ -398,7 +398,7 @@ error: splx(s); if (err != 0) { if (fwmem_debug) - printf("%s: err=%d\n", __FUNCTION__, err); + printf("%s: err=%d\n", __func__, err); bp->bio_error = err; bp->bio_flags |= BIO_ERROR; bp->bio_resid = bp->bio_bcount; diff --git a/sys/bus/iicbus/i386/pcf.c b/sys/bus/iicbus/i386/pcf.c index b7ac92dddc..416e5f506e 100644 --- a/sys/bus/iicbus/i386/pcf.c +++ b/sys/bus/iicbus/i386/pcf.c @@ -24,7 +24,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/i386/isa/pcf.c,v 1.14 2000/01/14 00:18:05 nsouch Exp $ - * $DragonFly: src/sys/bus/iicbus/i386/pcf.c,v 1.3 2003/08/07 21:16:46 dillon Exp $ + * $DragonFly: src/sys/bus/iicbus/i386/pcf.c,v 1.4 2005/02/17 13:59:35 joerg Exp $ * */ #include @@ -471,7 +471,7 @@ pcfintr(void *arg) break; default: - panic("%s: unknown slave mode (%d)!", __FUNCTION__, + panic("%s: unknown slave mode (%d)!", __func__, pcf->pcf_slave_mode); } diff --git a/sys/bus/iicbus/iic.c b/sys/bus/iicbus/iic.c index b0333ca560..1342e4438a 100644 --- a/sys/bus/iicbus/iic.c +++ b/sys/bus/iicbus/iic.c @@ -24,7 +24,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/iicbus/iic.c,v 1.18 1999/11/18 05:43:32 peter Exp $ - * $DragonFly: src/sys/bus/iicbus/iic.c,v 1.7 2004/05/19 22:52:38 dillon Exp $ + * $DragonFly: src/sys/bus/iicbus/iic.c,v 1.8 2005/02/17 13:59:35 joerg Exp $ * */ #include @@ -170,7 +170,7 @@ iicclose(dev_t dev, int flags, int fmt, struct thread *td) sc->sc_count--; if (sc->sc_count < 0) - panic("%s: iic_count < 0!", __FUNCTION__); + panic("%s: iic_count < 0!", __func__); return (0); } @@ -227,7 +227,7 @@ iicread(dev_t dev, struct uio * uio, int ioflag) return (error); if (bufsize > uio->uio_resid) - panic("%s: too much data read!", __FUNCTION__); + panic("%s: too much data read!", __func__); iicbus_release_bus(device_get_parent(iicdev), iicdev); diff --git a/sys/bus/iicbus/iicbus.c b/sys/bus/iicbus/iicbus.c index 09ad2ce2b4..05e4d5569f 100644 --- a/sys/bus/iicbus/iicbus.c +++ b/sys/bus/iicbus/iicbus.c @@ -24,7 +24,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/iicbus/iicbus.c,v 1.13 1999/12/03 08:41:02 mdodd Exp $ - * $DragonFly: src/sys/bus/iicbus/iicbus.c,v 1.3 2003/08/07 21:16:45 dillon Exp $ + * $DragonFly: src/sys/bus/iicbus/iicbus.c,v 1.4 2005/02/17 13:59:35 joerg Exp $ * */ @@ -200,7 +200,7 @@ iicbus_attach(device_t dev) break; default: - panic("%s: unknown class!", __FUNCTION__); + panic("%s: unknown class!", __func__); } if (iicdev->iicd_alive) { @@ -251,7 +251,7 @@ iicbus_print_child(device_t bus, device_t dev) break; default: - panic("%s: unknown class!", __FUNCTION__); + panic("%s: unknown class!", __func__); } return (retval); diff --git a/sys/bus/iicbus/iicsmb.c b/sys/bus/iicbus/iicsmb.c index 1c7cff7b70..35b78d6c9e 100644 --- a/sys/bus/iicbus/iicsmb.c +++ b/sys/bus/iicbus/iicsmb.c @@ -24,7 +24,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/iicbus/iicsmb.c,v 1.5.2.2 2000/08/09 00:59:27 peter Exp $ - * $DragonFly: src/sys/bus/iicbus/iicsmb.c,v 1.3 2003/08/07 21:16:45 dillon Exp $ + * $DragonFly: src/sys/bus/iicbus/iicsmb.c,v 1.4 2005/02/17 13:59:35 joerg Exp $ * */ @@ -184,7 +184,7 @@ iicsmb_intr(device_t dev, int event, char *buf) switch (sc->state) { case SMB_DONE: /* XXX too much data, discard */ - printf("%s: too much data from 0x%x\n", __FUNCTION__, + printf("%s: too much data from 0x%x\n", __func__, sc->devaddr & 0xff); goto end; @@ -217,14 +217,14 @@ end: break; default: - printf("%s unknown error 0x%x!\n", __FUNCTION__, + printf("%s unknown error 0x%x!\n", __func__, (int)*buf); break; } break; default: - panic("%s: unknown event (%d)!", __FUNCTION__, event); + panic("%s: unknown event (%d)!", __func__, event); } return; diff --git a/sys/bus/ppbus/ppb_1284.c b/sys/bus/ppbus/ppb_1284.c index d8e734d75e..efc960b879 100644 --- a/sys/bus/ppbus/ppb_1284.c +++ b/sys/bus/ppbus/ppb_1284.c @@ -24,7 +24,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/ppbus/ppb_1284.c,v 1.11 2000/01/14 08:03:14 nsouch Exp $ - * $DragonFly: src/sys/bus/ppbus/ppb_1284.c,v 1.3 2003/08/07 21:16:47 dillon Exp $ + * $DragonFly: src/sys/bus/ppbus/ppb_1284.c,v 1.4 2005/02/17 13:59:35 joerg Exp $ * */ @@ -175,7 +175,7 @@ ppb_request_mode(int mode, int options) request_mode = EPP_1284_NORMAL; break; default: - panic("%s: unsupported mode %d\n", __FUNCTION__, mode); + panic("%s: unsupported mode %d\n", __func__, mode); } } @@ -609,7 +609,7 @@ ppb_1284_read_id(device_t bus, int mode, char *buffer, error = spp_1284_read(bus, PPB_BYTE, buffer, max, read); break; default: - panic("%s: unsupported mode %d\n", __FUNCTION__, mode); + panic("%s: unsupported mode %d\n", __func__, mode); } ppb_1284_terminate(bus); @@ -792,7 +792,7 @@ ppb_1284_negociate(device_t bus, int mode, int options) break; default: - panic("%s: unknown mode (%d)!", __FUNCTION__, mode); + panic("%s: unknown mode (%d)!", __func__, mode); } ppb_set_mode(bus, mode); diff --git a/sys/bus/ppbus/ppb_msq.c b/sys/bus/ppbus/ppb_msq.c index aef54b7daa..bf7e73062c 100644 --- a/sys/bus/ppbus/ppb_msq.c +++ b/sys/bus/ppbus/ppb_msq.c @@ -24,7 +24,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/ppbus/ppb_msq.c,v 1.9.2.1 2000/05/24 00:20:57 n_hibma Exp $ - * $DragonFly: src/sys/bus/ppbus/ppb_msq.c,v 1.5 2003/11/15 21:05:38 dillon Exp $ + * $DragonFly: src/sys/bus/ppbus/ppb_msq.c,v 1.6 2005/02/17 13:59:35 joerg Exp $ * */ #include @@ -67,7 +67,7 @@ mode2xfer(device_t bus, struct ppb_device *ppbdev, int opcode) break; default: - panic("%s: unknown opcode (%d)", __FUNCTION__, opcode); + panic("%s: unknown opcode (%d)", __func__, opcode); } /* retrieve the device operating mode */ @@ -90,7 +90,7 @@ mode2xfer(device_t bus, struct ppb_device *ppbdev, int opcode) index = EPP19_MSQ; break; default: - panic("%s: unknown EPP protocol (0x%x)!", __FUNCTION__, + panic("%s: unknown EPP protocol (0x%x)!", __func__, epp); } break; @@ -98,7 +98,7 @@ mode2xfer(device_t bus, struct ppb_device *ppbdev, int opcode) index = ECP_MSQ; break; default: - panic("%s: unknown mode (%d)", __FUNCTION__, ppbdev->mode); + panic("%s: unknown mode (%d)", __func__, ppbdev->mode); } return (&table[index]); @@ -205,11 +205,11 @@ ppb_MS_init_msq(struct ppb_microseq *msq, int nbparam, ...) /* check the instruction position */ if (arg >= PPB_MS_MAXARGS) panic("%s: parameter out of range (0x%x)!", - __FUNCTION__, param); + __func__, param); #if 0 printf("%s: param = %d, ins = %d, arg = %d, type = %d\n", - __FUNCTION__, param, ins, arg, type); + __func__, param, ins, arg, type); #endif /* properly cast the parameter */ @@ -231,7 +231,7 @@ ppb_MS_init_msq(struct ppb_microseq *msq, int nbparam, ...) break; default: - panic("%s: unknown parameter (0x%x)!", __FUNCTION__, + panic("%s: unknown parameter (0x%x)!", __func__, param); } } @@ -289,7 +289,7 @@ ppb_MS_microseq(device_t bus, device_t dev, struct ppb_microseq *msq, int *ret) INCR_PC; continue; } else { - panic("%s: IEEE1284 read not supported", __FUNCTION__); + panic("%s: IEEE1284 read not supported", __func__); } } diff --git a/sys/dev/agp/agp_intel.c b/sys/dev/agp/agp_intel.c index 78fe0c2574..51519ad1e9 100644 --- a/sys/dev/agp/agp_intel.c +++ b/sys/dev/agp/agp_intel.c @@ -24,7 +24,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/pci/agp_intel.c,v 1.1.2.5 2003/06/02 17:38:19 jhb Exp $ - * $DragonFly: src/sys/dev/agp/agp_intel.c,v 1.5 2004/07/04 00:24:52 dillon Exp $ + * $DragonFly: src/sys/dev/agp/agp_intel.c,v 1.6 2005/02/17 13:59:35 joerg Exp $ */ #include "opt_bus.h" @@ -264,7 +264,7 @@ agp_intel_detach(device_t dev) case 0x1a218086: /* i840 */ case 0x25308086: /* i850 */ case 0x25318086: /* i860 */ - printf("%s: set MCHCFG to %x\n", __FUNCTION__, (unsigned) + printf("%s: set MCHCFG to %x\n", __func__, (unsigned) (pci_read_config(dev, AGP_INTEL_MCHCFG, 2) & ~(1 << 9))); pci_write_config(dev, AGP_INTEL_MCHCFG, @@ -273,7 +273,7 @@ agp_intel_detach(device_t dev) case 0x25008086: /* i820 */ case 0x25018086: /* i820 */ - printf("%s: set RDCR to %x\n", __FUNCTION__, (unsigned) + printf("%s: set RDCR to %x\n", __func__, (unsigned) (pci_read_config(dev, AGP_INTEL_I820_RDCR, 1) & ~(1 << 1))); pci_write_config(dev, AGP_INTEL_I820_RDCR, @@ -285,7 +285,7 @@ agp_intel_detach(device_t dev) case 0x33408086: /* i855 */ case 0x25708086: /* i865 */ case 0x25788086: /* i875P */ - printf("%s: set MCHCFG to %x\n", __FUNCTION__, (unsigned) + printf("%s: set MCHCFG to %x\n", __func__, (unsigned) (pci_read_config(dev, AGP_INTEL_I845_MCHCFG, 1) & ~(1 << 1))); pci_write_config(dev, AGP_INTEL_MCHCFG, @@ -293,7 +293,7 @@ agp_intel_detach(device_t dev) & ~(1 << 1)), 1); default: /* Intel Generic (maybe) */ - printf("%s: set NBXCFG to %x\n", __FUNCTION__, + printf("%s: set NBXCFG to %x\n", __func__, (pci_read_config(dev, AGP_INTEL_NBXCFG, 4) & ~(1 << 9))); pci_write_config(dev, AGP_INTEL_NBXCFG, diff --git a/sys/dev/disk/sbp/sbp.c b/sys/dev/disk/sbp/sbp.c index 91b3d6bf4d..9d7d5a4f2e 100644 --- a/sys/dev/disk/sbp/sbp.c +++ b/sys/dev/disk/sbp/sbp.c @@ -32,7 +32,7 @@ * POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/dev/firewire/sbp.c,v 1.74 2004/01/08 14:58:09 simokawa Exp $ - * $DragonFly: src/sys/dev/disk/sbp/sbp.c,v 1.12 2004/09/17 03:39:39 joerg Exp $ + * $DragonFly: src/sys/dev/disk/sbp/sbp.c,v 1.13 2005/02/17 13:59:35 joerg Exp $ * */ @@ -530,7 +530,7 @@ END_DEBUG SBP_DMA_SIZE, &sdev->dma, BUS_DMA_NOWAIT); if (sdev->dma.v_addr == NULL) { printf("%s: dma space allocation failed\n", - __FUNCTION__); + __func__); free(sdev, M_SBP); target->luns[lun] = NULL; goto next; @@ -672,7 +672,7 @@ sbp_login(struct sbp_dev *sdev) if (t.tv_sec >= 0 && t.tv_usec > 0) ticks = (t.tv_sec * 1000 + t.tv_usec / 1000) * hz / 1000; SBP_DEBUG(0) - printf("%s: sec = %ld usec = %ld ticks = %d\n", __FUNCTION__, + printf("%s: sec = %ld usec = %ld ticks = %d\n", __func__, t.tv_sec, t.tv_usec, ticks); END_DEBUG callout_reset(&sdev->login_callout, ticks, @@ -1068,11 +1068,11 @@ sbp_agent_reset_callback(struct fw_xfer *xfer) sdev = (struct sbp_dev *)xfer->sc; SBP_DEBUG(1) sbp_show_sdev_info(sdev, 2); - printf("%s\n", __FUNCTION__); + printf("%s\n", __func__); END_DEBUG if (xfer->resp != 0) { sbp_show_sdev_info(sdev, 2); - printf("%s: resp=%d\n", __FUNCTION__, xfer->resp); + printf("%s: resp=%d\n", __func__, xfer->resp); } sbp_xfer_free(xfer); @@ -1146,11 +1146,11 @@ sbp_orb_pointer_callback(struct fw_xfer *xfer) SBP_DEBUG(1) sbp_show_sdev_info(sdev, 2); - printf("%s\n", __FUNCTION__); + printf("%s\n", __func__); END_DEBUG if (xfer->resp != 0) { /* XXX */ - printf("%s: xfer->resp = %d\n", __FUNCTION__, xfer->resp); + printf("%s: xfer->resp = %d\n", __func__, xfer->resp); } sbp_xfer_free(xfer); sdev->flags &= ~ORB_POINTER_ACTIVE; @@ -1173,12 +1173,12 @@ sbp_orb_pointer(struct sbp_dev *sdev, struct sbp_ocb *ocb) struct fw_pkt *fp; SBP_DEBUG(1) sbp_show_sdev_info(sdev, 2); - printf("%s: 0x%08x\n", __FUNCTION__, (u_int32_t)ocb->bus_addr); + printf("%s: 0x%08x\n", __func__, (u_int32_t)ocb->bus_addr); END_DEBUG if ((sdev->flags & ORB_POINTER_ACTIVE) != 0) { SBP_DEBUG(0) - printf("%s: orb pointer active\n", __FUNCTION__); + printf("%s: orb pointer active\n", __func__); END_DEBUG sdev->flags |= ORB_POINTER_NEED; return; @@ -1216,7 +1216,7 @@ SBP_DEBUG(1) END_DEBUG if (xfer->resp != 0) { /* XXX */ - printf("%s: xfer->resp = %d\n", __FUNCTION__, xfer->resp); + printf("%s: xfer->resp = %d\n", __func__, xfer->resp); } sbp_xfer_free(xfer); return; @@ -2605,7 +2605,7 @@ sbp_dequeue_ocb(struct sbp_dev *sdev, struct sbp_status *sbp_status) SBP_DEBUG(1) sbp_show_sdev_info(sdev, 2); printf("%s: 0x%08x src %d\n", - __FUNCTION__, ntohl(sbp_status->orb_lo), sbp_status->src); + __func__, ntohl(sbp_status->orb_lo), sbp_status->src); END_DEBUG for (ocb = STAILQ_FIRST(&sdev->ocbs); ocb != NULL; ocb = next) { next = STAILQ_NEXT(ocb, ocb); @@ -2659,9 +2659,9 @@ sbp_enqueue_ocb(struct sbp_dev *sdev, struct sbp_ocb *ocb) SBP_DEBUG(1) sbp_show_sdev_info(sdev, 2); #if defined(__DragonFly__) || __FreeBSD_version < 500000 - printf("%s: 0x%08x\n", __FUNCTION__, ocb->bus_addr); + printf("%s: 0x%08x\n", __func__, ocb->bus_addr); #else - printf("%s: 0x%08jx\n", __FUNCTION__, (uintmax_t)ocb->bus_addr); + printf("%s: 0x%08jx\n", __func__, (uintmax_t)ocb->bus_addr); #endif END_DEBUG prev = STAILQ_LAST(&sdev->ocbs, sbp_ocb, ocb); diff --git a/sys/dev/disk/vpo/vpoio.c b/sys/dev/disk/vpo/vpoio.c index beb5618ecc..fbb95d34f5 100644 --- a/sys/dev/disk/vpo/vpoio.c +++ b/sys/dev/disk/vpo/vpoio.c @@ -25,7 +25,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/ppbus/vpoio.c,v 1.10.2.3 2001/10/02 05:27:20 nsouch Exp $ - * $DragonFly: src/sys/dev/disk/vpo/vpoio.c,v 1.5 2004/03/15 01:10:44 dillon Exp $ + * $DragonFly: src/sys/dev/disk/vpo/vpoio.c,v 1.6 2005/02/17 13:59:35 joerg Exp $ * */ @@ -298,7 +298,7 @@ vpoio_connect(struct vpoio_data *vpo, int how) if ((error = ppb_request_bus(ppbus, vpo->vpo_dev, how))) { #ifdef VP0_DEBUG - printf("%s: can't request bus!\n", __FUNCTION__); + printf("%s: can't request bus!\n", __func__); #endif return error; } @@ -650,7 +650,7 @@ vpoio_reset_bus(struct vpoio_data *vpo) if (vpoio_connect(vpo, PPB_WAIT|PPB_INTR) || !vpoio_in_disk_mode(vpo)) { #ifdef VP0_DEBUG - printf("%s: not in disk mode!\n", __FUNCTION__); + printf("%s: not in disk mode!\n", __func__); #endif /* release ppbus */ vpoio_disconnect(vpo); diff --git a/sys/dev/drm/drm_dma.h b/sys/dev/drm/drm_dma.h index 973c6df408..2ab7c2fe8d 100644 --- a/sys/dev/drm/drm_dma.h +++ b/sys/dev/drm/drm_dma.h @@ -29,7 +29,7 @@ * Gareth Hughes * * $FreeBSD: src/sys/dev/drm/drm_dma.h,v 1.5.2.1 2003/04/26 07:05:28 anholt Exp $ - * $DragonFly: src/sys/dev/drm/Attic/drm_dma.h,v 1.4 2004/02/13 01:23:57 joerg Exp $ + * $DragonFly: src/sys/dev/drm/Attic/drm_dma.h,v 1.5 2005/02/17 13:59:35 joerg Exp $ */ #include "dev/drm/drmP.h" @@ -170,7 +170,7 @@ int DRM(irq_install)( drm_device_t *dev, int irq ) dev->irq = irq; DRM_UNLOCK; - DRM_DEBUG( "%s: irq=%d\n", __FUNCTION__, irq ); + DRM_DEBUG( "%s: irq=%d\n", __func__, irq ); dev->context_flag = 0; @@ -250,7 +250,7 @@ int DRM(irq_uninstall)( drm_device_t *dev ) if ( !irq ) return DRM_ERR(EINVAL); - DRM_DEBUG( "%s: irq=%d\n", __FUNCTION__, irq ); + DRM_DEBUG( "%s: irq=%d\n", __func__, irq ); DRM(driver_irq_uninstall)( dev ); diff --git a/sys/dev/drm/drm_os_freebsd.h b/sys/dev/drm/drm_os_freebsd.h index db76efd7da..c391e1515f 100644 --- a/sys/dev/drm/drm_os_freebsd.h +++ b/sys/dev/drm/drm_os_freebsd.h @@ -1,6 +1,6 @@ /* * $FreeBSD: src/sys/dev/drm/drm_os_freebsd.h,v 1.10.2.1 2003/04/26 07:05:28 anholt Exp $ - * $DragonFly: src/sys/dev/drm/Attic/drm_os_freebsd.h,v 1.11 2004/08/15 14:15:00 joerg Exp $ + * $DragonFly: src/sys/dev/drm/Attic/drm_os_freebsd.h,v 1.12 2005/02/17 13:59:35 joerg Exp $ */ #include #include @@ -143,7 +143,7 @@ do { \ if (!_DRM_LOCK_IS_HELD(dev->lock.hw_lock->lock) || \ dev->lock.filp != filp) { \ DRM_ERROR("%s called without lock held\n", \ - __FUNCTION__); \ + __func__); \ return EINVAL; \ } \ } while (0) diff --git a/sys/dev/drm/drm_scatter.h b/sys/dev/drm/drm_scatter.h index 1db0041233..977635350d 100644 --- a/sys/dev/drm/drm_scatter.h +++ b/sys/dev/drm/drm_scatter.h @@ -27,7 +27,7 @@ * Gareth Hughes * * $FreeBSD: src/sys/dev/drm/drm_scatter.h,v 1.4.2.1 2003/04/26 07:05:28 anholt Exp $ - * $DragonFly: src/sys/dev/drm/Attic/drm_scatter.h,v 1.2 2003/06/17 04:28:24 dillon Exp $ + * $DragonFly: src/sys/dev/drm/Attic/drm_scatter.h,v 1.3 2005/02/17 13:59:35 joerg Exp $ */ #include "dev/drm/drmP.h" @@ -55,7 +55,7 @@ int DRM(sg_alloc)( DRM_IOCTL_ARGS ) drm_sg_mem_t *entry; unsigned long pages; - DRM_DEBUG( "%s\n", __FUNCTION__ ); + DRM_DEBUG( "%s\n", __func__ ); if ( dev->sg ) return EINVAL; diff --git a/sys/dev/drm/mga/mga_dma.c b/sys/dev/drm/mga/mga_dma.c index bf263e6398..5d02408077 100644 --- a/sys/dev/drm/mga/mga_dma.c +++ b/sys/dev/drm/mga/mga_dma.c @@ -33,7 +33,7 @@ * Gareth Hughes * * $FreeBSD: src/sys/dev/drm/mga_dma.c,v 1.6.2.1 2003/04/26 07:05:29 anholt Exp $ - * $DragonFly: src/sys/dev/drm/mga/Attic/mga_dma.c,v 1.3 2003/08/07 21:16:55 dillon Exp $ + * $DragonFly: src/sys/dev/drm/mga/Attic/mga_dma.c,v 1.4 2005/02/17 13:59:36 joerg Exp $ */ #include "mga.h" @@ -711,7 +711,7 @@ int mga_dma_flush( DRM_IOCTL_ARGS ) #if MGA_DMA_DEBUG int ret = mga_do_wait_for_idle( dev_priv ); if ( ret < 0 ) - DRM_INFO( "%s: -EBUSY\n", __FUNCTION__ ); + DRM_INFO( "%s: -EBUSY\n", __func__ ); return ret; #else return mga_do_wait_for_idle( dev_priv ); diff --git a/sys/dev/drm/mga/mga_drv.h b/sys/dev/drm/mga/mga_drv.h index 426dfd80c7..c3f63a51c7 100644 --- a/sys/dev/drm/mga/mga_drv.h +++ b/sys/dev/drm/mga/mga_drv.h @@ -28,7 +28,7 @@ * Gareth Hughes * * $FreeBSD: src/sys/dev/drm/mga_drv.h,v 1.5.2.1 2003/04/26 07:05:29 anholt Exp $ - * $DragonFly: src/sys/dev/drm/mga/Attic/mga_drv.h,v 1.2 2003/06/17 04:28:24 dillon Exp $ + * $DragonFly: src/sys/dev/drm/mga/Attic/mga_drv.h,v 1.3 2005/02/17 13:59:36 joerg Exp $ */ #ifndef __MGA_DRV_H__ @@ -195,7 +195,7 @@ do { \ } else if ( dev_priv->prim.space < \ dev_priv->prim.high_mark ) { \ if ( MGA_DMA_DEBUG ) \ - DRM_INFO( "%s: wrap...\n", __FUNCTION__ ); \ + DRM_INFO( "%s: wrap...\n", __func__ ); \ return DRM_ERR(EBUSY); \ } \ } \ @@ -206,7 +206,7 @@ do { \ if ( test_bit( 0, &dev_priv->prim.wrapped ) ) { \ if ( mga_do_wait_for_idle( dev_priv ) < 0 ) { \ if ( MGA_DMA_DEBUG ) \ - DRM_INFO( "%s: wrap...\n", __FUNCTION__ ); \ + DRM_INFO( "%s: wrap...\n", __func__ ); \ return DRM_ERR(EBUSY); \ } \ mga_do_dma_wrap_end( dev_priv ); \ @@ -228,7 +228,7 @@ do { \ do { \ if ( MGA_VERBOSE ) { \ DRM_INFO( "BEGIN_DMA( %d ) in %s\n", \ - (n), __FUNCTION__ ); \ + (n), __func__ ); \ DRM_INFO( " space=0x%x req=0x%x\n", \ dev_priv->prim.space, (n) * DMA_BLOCK_SIZE ); \ } \ @@ -239,7 +239,7 @@ do { \ #define BEGIN_DMA_WRAP() \ do { \ if ( MGA_VERBOSE ) { \ - DRM_INFO( "BEGIN_DMA() in %s\n", __FUNCTION__ ); \ + DRM_INFO( "BEGIN_DMA() in %s\n", __func__ ); \ DRM_INFO( " space=0x%x\n", dev_priv->prim.space ); \ } \ prim = dev_priv->prim.start; \ @@ -258,7 +258,7 @@ do { \ #define FLUSH_DMA() \ do { \ if ( 0 ) { \ - DRM_INFO( "%s:\n", __FUNCTION__ ); \ + DRM_INFO( "%s:\n", __func__ ); \ DRM_INFO( " tail=0x%06x head=0x%06lx\n", \ dev_priv->prim.tail, \ MGA_READ( MGA_PRIMADDRESS ) - \ diff --git a/sys/dev/drm/mga/mga_state.c b/sys/dev/drm/mga/mga_state.c index 5ebef3d34b..c5d1895886 100644 --- a/sys/dev/drm/mga/mga_state.c +++ b/sys/dev/drm/mga/mga_state.c @@ -32,7 +32,7 @@ * Gareth Hughes * * $FreeBSD: src/sys/dev/drm/mga_state.c,v 1.6.2.1 2003/04/26 07:05:29 anholt Exp $ - * $DragonFly: src/sys/dev/drm/mga/Attic/mga_state.c,v 1.3 2003/08/07 21:16:55 dillon Exp $ + * $DragonFly: src/sys/dev/drm/mga/Attic/mga_state.c,v 1.4 2005/02/17 13:59:36 joerg Exp $ */ #include "mga.h" @@ -664,7 +664,7 @@ static void mga_dma_dispatch_swap( drm_device_t *dev ) FLUSH_DMA(); - DRM_DEBUG( "%s... done.\n", __FUNCTION__ ); + DRM_DEBUG( "%s... done.\n", __func__ ); } static void mga_dma_dispatch_vertex( drm_device_t *dev, drm_buf_t *buf ) @@ -1025,7 +1025,7 @@ int mga_dma_iload( DRM_IOCTL_ARGS ) #if 0 if ( mga_do_wait_for_idle( dev_priv ) < 0 ) { if ( MGA_DMA_DEBUG ) - DRM_INFO( "%s: -EBUSY\n", __FUNCTION__ ); + DRM_INFO( "%s: -EBUSY\n", __func__ ); return DRM_ERR(EBUSY); } #endif @@ -1087,7 +1087,7 @@ int mga_getparam( DRM_IOCTL_ARGS ) int value; if ( !dev_priv ) { - DRM_ERROR( "%s called with no initialization\n", __FUNCTION__ ); + DRM_ERROR( "%s called with no initialization\n", __func__ ); return DRM_ERR(EINVAL); } diff --git a/sys/dev/drm/r128/r128_cce.c b/sys/dev/drm/r128/r128_cce.c index e20749e6eb..02bb9f8356 100644 --- a/sys/dev/drm/r128/r128_cce.c +++ b/sys/dev/drm/r128/r128_cce.c @@ -28,7 +28,7 @@ * Gareth Hughes * * $FreeBSD: src/sys/dev/drm/r128_cce.c,v 1.6.2.1 2003/04/26 07:05:29 anholt Exp $ - * $DragonFly: src/sys/dev/drm/r128/Attic/r128_cce.c,v 1.3 2003/08/07 21:16:55 dillon Exp $ + * $DragonFly: src/sys/dev/drm/r128/Attic/r128_cce.c,v 1.4 2005/02/17 13:59:36 joerg Exp $ */ #include "r128.h" @@ -673,7 +673,7 @@ int r128_cce_start( DRM_IOCTL_ARGS ) LOCK_TEST_WITH_RETURN( dev, filp ); if ( dev_priv->cce_running || dev_priv->cce_mode == R128_PM4_NONPM4 ) { - DRM_DEBUG( "%s while CCE running\n", __FUNCTION__ ); + DRM_DEBUG( "%s while CCE running\n", __func__ ); return 0; } @@ -735,7 +735,7 @@ int r128_cce_reset( DRM_IOCTL_ARGS ) LOCK_TEST_WITH_RETURN( dev, filp ); if ( !dev_priv ) { - DRM_DEBUG( "%s called before init done\n", __FUNCTION__ ); + DRM_DEBUG( "%s called before init done\n", __func__ ); return DRM_ERR(EINVAL); } diff --git a/sys/dev/drm/r128/r128_drv.h b/sys/dev/drm/r128/r128_drv.h index 373361c6f5..98eb2f5521 100644 --- a/sys/dev/drm/r128/r128_drv.h +++ b/sys/dev/drm/r128/r128_drv.h @@ -31,7 +31,7 @@ * Michel Dänzer * * $FreeBSD: src/sys/dev/drm/r128_drv.h,v 1.5.2.1 2003/04/26 07:05:29 anholt Exp $ - * $DragonFly: src/sys/dev/drm/r128/Attic/r128_drv.h,v 1.2 2003/06/17 04:28:24 dillon Exp $ + * $DragonFly: src/sys/dev/drm/r128/Attic/r128_drv.h,v 1.3 2005/02/17 13:59:36 joerg Exp $ */ #ifndef __R128_DRV_H__ @@ -455,7 +455,7 @@ do { \ #define BEGIN_RING( n ) do { \ if ( R128_VERBOSE ) { \ DRM_INFO( "BEGIN_RING( %d ) in %s\n", \ - (n), __FUNCTION__ ); \ + (n), __func__ ); \ } \ if ( dev_priv->ring.space <= (n) * sizeof(u32) ) { \ r128_wait_ring( dev_priv, (n) * sizeof(u32) ); \ diff --git a/sys/dev/drm/r128/r128_state.c b/sys/dev/drm/r128/r128_state.c index 60db46011f..74238dcadd 100644 --- a/sys/dev/drm/r128/r128_state.c +++ b/sys/dev/drm/r128/r128_state.c @@ -27,7 +27,7 @@ * Gareth Hughes * * $FreeBSD: src/sys/dev/drm/r128_state.c,v 1.6.2.1 2003/04/26 07:05:29 anholt Exp $ - * $DragonFly: src/sys/dev/drm/r128/Attic/r128_state.c,v 1.3 2003/08/07 21:16:55 dillon Exp $ + * $DragonFly: src/sys/dev/drm/r128/Attic/r128_state.c,v 1.4 2005/02/17 13:59:36 joerg Exp $ */ #include "r128.h" @@ -46,7 +46,7 @@ static void r128_emit_clip_rects( drm_r128_private_t *dev_priv, { u32 aux_sc_cntl = 0x00000000; RING_LOCALS; - DRM_DEBUG( " %s\n", __FUNCTION__ ); + DRM_DEBUG( " %s\n", __func__ ); BEGIN_RING( 17 ); @@ -89,7 +89,7 @@ static __inline__ void r128_emit_core( drm_r128_private_t *dev_priv ) drm_r128_sarea_t *sarea_priv = dev_priv->sarea_priv; drm_r128_context_regs_t *ctx = &sarea_priv->context_state; RING_LOCALS; - DRM_DEBUG( " %s\n", __FUNCTION__ ); + DRM_DEBUG( " %s\n", __func__ ); BEGIN_RING( 2 ); @@ -104,7 +104,7 @@ static __inline__ void r128_emit_context( drm_r128_private_t *dev_priv ) drm_r128_sarea_t *sarea_priv = dev_priv->sarea_priv; drm_r128_context_regs_t *ctx = &sarea_priv->context_state; RING_LOCALS; - DRM_DEBUG( " %s\n", __FUNCTION__ ); + DRM_DEBUG( " %s\n", __func__ ); BEGIN_RING( 13 ); @@ -130,7 +130,7 @@ static __inline__ void r128_emit_setup( drm_r128_private_t *dev_priv ) drm_r128_sarea_t *sarea_priv = dev_priv->sarea_priv; drm_r128_context_regs_t *ctx = &sarea_priv->context_state; RING_LOCALS; - DRM_DEBUG( " %s\n", __FUNCTION__ ); + DRM_DEBUG( " %s\n", __func__ ); BEGIN_RING( 3 ); @@ -146,7 +146,7 @@ static __inline__ void r128_emit_masks( drm_r128_private_t *dev_priv ) drm_r128_sarea_t *sarea_priv = dev_priv->sarea_priv; drm_r128_context_regs_t *ctx = &sarea_priv->context_state; RING_LOCALS; - DRM_DEBUG( " %s\n", __FUNCTION__ ); + DRM_DEBUG( " %s\n", __func__ ); BEGIN_RING( 5 ); @@ -165,7 +165,7 @@ static __inline__ void r128_emit_window( drm_r128_private_t *dev_priv ) drm_r128_sarea_t *sarea_priv = dev_priv->sarea_priv; drm_r128_context_regs_t *ctx = &sarea_priv->context_state; RING_LOCALS; - DRM_DEBUG( " %s\n", __FUNCTION__ ); + DRM_DEBUG( " %s\n", __func__ ); BEGIN_RING( 2 ); @@ -182,7 +182,7 @@ static __inline__ void r128_emit_tex0( drm_r128_private_t *dev_priv ) drm_r128_texture_regs_t *tex = &sarea_priv->tex_state[0]; int i; RING_LOCALS; - DRM_DEBUG( " %s\n", __FUNCTION__ ); + DRM_DEBUG( " %s\n", __func__ ); BEGIN_RING( 7 + R128_MAX_TEXTURE_LEVELS ); @@ -208,7 +208,7 @@ static __inline__ void r128_emit_tex1( drm_r128_private_t *dev_priv ) drm_r128_texture_regs_t *tex = &sarea_priv->tex_state[1]; int i; RING_LOCALS; - DRM_DEBUG( " %s\n", __FUNCTION__ ); + DRM_DEBUG( " %s\n", __func__ ); BEGIN_RING( 5 + R128_MAX_TEXTURE_LEVELS ); @@ -231,7 +231,7 @@ static __inline__ void r128_emit_state( drm_r128_private_t *dev_priv ) drm_r128_sarea_t *sarea_priv = dev_priv->sarea_priv; unsigned int dirty = sarea_priv->dirty; - DRM_DEBUG( "%s: dirty=0x%08x\n", __FUNCTION__, dirty ); + DRM_DEBUG( "%s: dirty=0x%08x\n", __func__, dirty ); if ( dirty & R128_UPLOAD_CORE ) { r128_emit_core( dev_priv ); @@ -372,7 +372,7 @@ static void r128_cce_dispatch_clear( drm_device_t *dev, unsigned int flags = clear->flags; int i; RING_LOCALS; - DRM_DEBUG( "%s\n", __FUNCTION__ ); + DRM_DEBUG( "%s\n", __func__ ); if ( dev_priv->page_flipping && dev_priv->current_page == 1 ) { unsigned int tmp = flags; @@ -475,7 +475,7 @@ static void r128_cce_dispatch_swap( drm_device_t *dev ) drm_clip_rect_t *pbox = sarea_priv->boxes; int i; RING_LOCALS; - DRM_DEBUG( "%s\n", __FUNCTION__ ); + DRM_DEBUG( "%s\n", __func__ ); #if R128_PERFORMANCE_BOXES /* Do some trivial performance monitoring... @@ -1154,7 +1154,7 @@ static int r128_cce_dispatch_read_pixels( drm_device_t *dev, int count, *x, *y; int i, xbuf_size, ybuf_size; RING_LOCALS; - DRM_DEBUG( "%s\n", __FUNCTION__ ); + DRM_DEBUG( "%s\n", __func__ ); count = depth->n; if ( count > dev_priv->depth_pitch ) { @@ -1223,7 +1223,7 @@ static void r128_cce_dispatch_stipple( drm_device_t *dev, u32 *stipple ) drm_r128_private_t *dev_priv = dev->dev_private; int i; RING_LOCALS; - DRM_DEBUG( "%s\n", __FUNCTION__ ); + DRM_DEBUG( "%s\n", __func__ ); BEGIN_RING( 33 ); @@ -1272,7 +1272,7 @@ int r128_cce_swap( DRM_IOCTL_ARGS ) DRM_DEVICE; drm_r128_private_t *dev_priv = dev->dev_private; drm_r128_sarea_t *sarea_priv = dev_priv->sarea_priv; - DRM_DEBUG( "%s\n", __FUNCTION__ ); + DRM_DEBUG( "%s\n", __func__ ); LOCK_TEST_WITH_RETURN( dev, filp ); @@ -1304,7 +1304,7 @@ int r128_cce_vertex( DRM_IOCTL_ARGS ) LOCK_TEST_WITH_RETURN( dev, filp ); if ( !dev_priv ) { - DRM_ERROR( "%s called with no initialization\n", __FUNCTION__ ); + DRM_ERROR( "%s called with no initialization\n", __func__ ); return DRM_ERR(EINVAL); } @@ -1364,7 +1364,7 @@ int r128_cce_indices( DRM_IOCTL_ARGS ) LOCK_TEST_WITH_RETURN( dev, filp ); if ( !dev_priv ) { - DRM_ERROR( "%s called with no initialization\n", __FUNCTION__ ); + DRM_ERROR( "%s called with no initialization\n", __func__ ); return DRM_ERR(EINVAL); } @@ -1513,7 +1513,7 @@ int r128_cce_indirect( DRM_IOCTL_ARGS ) LOCK_TEST_WITH_RETURN( dev, filp ); if ( !dev_priv ) { - DRM_ERROR( "%s called with no initialization\n", __FUNCTION__ ); + DRM_ERROR( "%s called with no initialization\n", __func__ ); return DRM_ERR(EINVAL); } @@ -1581,7 +1581,7 @@ int r128_getparam( DRM_IOCTL_ARGS ) int value; if ( !dev_priv ) { - DRM_ERROR( "%s called with no initialization\n", __FUNCTION__ ); + DRM_ERROR( "%s called with no initialization\n", __func__ ); return DRM_ERR(EINVAL); } diff --git a/sys/dev/drm/radeon/radeon_cp.c b/sys/dev/drm/radeon/radeon_cp.c index 3ae770d3cc..b5ba57f4a9 100644 --- a/sys/dev/drm/radeon/radeon_cp.c +++ b/sys/dev/drm/radeon/radeon_cp.c @@ -28,7 +28,7 @@ * Gareth Hughes * * $FreeBSD: src/sys/dev/drm/radeon_cp.c,v 1.6.2.1 2003/04/26 07:05:29 anholt Exp $ - * $DragonFly: src/sys/dev/drm/radeon/Attic/radeon_cp.c,v 1.4 2003/08/07 21:16:55 dillon Exp $ + * $DragonFly: src/sys/dev/drm/radeon/Attic/radeon_cp.c,v 1.5 2005/02/17 13:59:36 joerg Exp $ */ #include "radeon.h" @@ -572,7 +572,7 @@ int RADEON_READ_PLL(drm_device_t *dev, int addr) #if RADEON_FIFO_DEBUG static void radeon_status( drm_radeon_private_t *dev_priv ) { - printk( "%s:\n", __FUNCTION__ ); + printk( "%s:\n", __func__ ); printk( "RBBM_STATUS = 0x%08x\n", (unsigned int)RADEON_READ( RADEON_RBBM_STATUS ) ); printk( "CP_RB_RTPR = 0x%08x\n", @@ -1323,12 +1323,12 @@ int radeon_cp_start( DRM_IOCTL_ARGS ) LOCK_TEST_WITH_RETURN( dev, filp ); if ( dev_priv->cp_running ) { - DRM_DEBUG( "%s while CP running\n", __FUNCTION__ ); + DRM_DEBUG( "%s while CP running\n", __func__ ); return 0; } if ( dev_priv->cp_mode == RADEON_CSQ_PRIDIS_INDDIS ) { DRM_DEBUG( "%s called with bogus CP mode (%d)\n", - __FUNCTION__, dev_priv->cp_mode ); + __func__, dev_priv->cp_mode ); return 0; } @@ -1426,7 +1426,7 @@ int radeon_cp_reset( DRM_IOCTL_ARGS ) LOCK_TEST_WITH_RETURN( dev, filp ); if ( !dev_priv ) { - DRM_DEBUG( "%s called before init done\n", __FUNCTION__ ); + DRM_DEBUG( "%s called before init done\n", __func__ ); return DRM_ERR(EINVAL); } diff --git a/sys/dev/drm/radeon/radeon_drv.h b/sys/dev/drm/radeon/radeon_drv.h index 6f7c5b722f..4e19721a35 100644 --- a/sys/dev/drm/radeon/radeon_drv.h +++ b/sys/dev/drm/radeon/radeon_drv.h @@ -28,7 +28,7 @@ * Gareth Hughes * * $FreeBSD: src/sys/dev/drm/radeon_drv.h,v 1.5.2.1 2003/04/26 07:05:29 anholt Exp $ - * $DragonFly: src/sys/dev/drm/radeon/Attic/radeon_drv.h,v 1.2 2003/06/17 04:28:24 dillon Exp $ + * $DragonFly: src/sys/dev/drm/radeon/Attic/radeon_drv.h,v 1.3 2005/02/17 13:59:36 joerg Exp $ */ #ifndef __RADEON_DRV_H__ @@ -827,7 +827,7 @@ do { \ #define BEGIN_RING( n ) do { \ if ( RADEON_VERBOSE ) { \ DRM_INFO( "BEGIN_RING( %d ) in %s\n", \ - n, __FUNCTION__ ); \ + n, __func__ ); \ } \ if ( dev_priv->ring.space <= (n) * sizeof(u32) ) { \ COMMIT_RING(); \ diff --git a/sys/dev/drm/radeon/radeon_irq.c b/sys/dev/drm/radeon/radeon_irq.c index 435cc77bf6..f1393451af 100644 --- a/sys/dev/drm/radeon/radeon_irq.c +++ b/sys/dev/drm/radeon/radeon_irq.c @@ -30,7 +30,7 @@ * Michel Dänzer * * $FreeBSD: src/sys/dev/drm/radeon_irq.c,v 1.2.2.1 2003/04/26 07:05:29 anholt Exp $ - * $DragonFly: src/sys/dev/drm/radeon/Attic/radeon_irq.c,v 1.3 2003/08/07 21:16:55 dillon Exp $ + * $DragonFly: src/sys/dev/drm/radeon/Attic/radeon_irq.c,v 1.4 2005/02/17 13:59:36 joerg Exp $ */ #include "radeon.h" @@ -151,7 +151,7 @@ int DRM(vblank_wait)(drm_device_t *dev, unsigned int *sequence) int ret = 0; if ( !dev_priv ) { - DRM_ERROR( "%s called with no initialization\n", __FUNCTION__ ); + DRM_ERROR( "%s called with no initialization\n", __func__ ); return DRM_ERR(EINVAL); } @@ -185,7 +185,7 @@ int radeon_irq_emit( DRM_IOCTL_ARGS ) LOCK_TEST_WITH_RETURN( dev, filp ); if ( !dev_priv ) { - DRM_ERROR( "%s called with no initialization\n", __FUNCTION__ ); + DRM_ERROR( "%s called with no initialization\n", __func__ ); return DRM_ERR(EINVAL); } @@ -212,7 +212,7 @@ int radeon_irq_wait( DRM_IOCTL_ARGS ) drm_radeon_irq_wait_t irqwait; if ( !dev_priv ) { - DRM_ERROR( "%s called with no initialization\n", __FUNCTION__ ); + DRM_ERROR( "%s called with no initialization\n", __func__ ); return DRM_ERR(EINVAL); } diff --git a/sys/dev/drm/radeon/radeon_mem.c b/sys/dev/drm/radeon/radeon_mem.c index af40e9a199..c54f75f97f 100644 --- a/sys/dev/drm/radeon/radeon_mem.c +++ b/sys/dev/drm/radeon/radeon_mem.c @@ -29,7 +29,7 @@ * Keith Whitwell * * $FreeBSD: src/sys/dev/drm/radeon_mem.c,v 1.2.2.1 2003/04/26 07:05:29 anholt Exp $ - * $DragonFly: src/sys/dev/drm/radeon/Attic/radeon_mem.c,v 1.3 2003/08/07 21:16:55 dillon Exp $ + * $DragonFly: src/sys/dev/drm/radeon/Attic/radeon_mem.c,v 1.4 2005/02/17 13:59:36 joerg Exp $ */ #include "radeon.h" @@ -232,7 +232,7 @@ int radeon_mem_alloc( DRM_IOCTL_ARGS ) struct mem_block *block, **heap; if ( !dev_priv ) { - DRM_ERROR( "%s called with no initialization\n", __FUNCTION__ ); + DRM_ERROR( "%s called with no initialization\n", __func__ ); return DRM_ERR(EINVAL); } @@ -274,7 +274,7 @@ int radeon_mem_free( DRM_IOCTL_ARGS ) struct mem_block *block, **heap; if ( !dev_priv ) { - DRM_ERROR( "%s called with no initialization\n", __FUNCTION__ ); + DRM_ERROR( "%s called with no initialization\n", __func__ ); return DRM_ERR(EINVAL); } @@ -304,7 +304,7 @@ int radeon_mem_init_heap( DRM_IOCTL_ARGS ) struct mem_block **heap; if ( !dev_priv ) { - DRM_ERROR( "%s called with no initialization\n", __FUNCTION__ ); + DRM_ERROR( "%s called with no initialization\n", __func__ ); return DRM_ERR(EINVAL); } diff --git a/sys/dev/drm/radeon/radeon_state.c b/sys/dev/drm/radeon/radeon_state.c index 93777f7d06..4d27c6a477 100644 --- a/sys/dev/drm/radeon/radeon_state.c +++ b/sys/dev/drm/radeon/radeon_state.c @@ -27,7 +27,7 @@ * Kevin E. Martin * * $FreeBSD: src/sys/dev/drm/radeon_state.c,v 1.6.2.1 2003/04/26 07:05:30 anholt Exp $ - * $DragonFly: src/sys/dev/drm/radeon/Attic/radeon_state.c,v 1.4 2005/02/15 18:31:48 joerg Exp $ + * $DragonFly: src/sys/dev/drm/radeon/Attic/radeon_state.c,v 1.5 2005/02/17 13:59:36 joerg Exp $ */ #include "radeon.h" @@ -812,7 +812,7 @@ static void radeon_cp_dispatch_flip( drm_device_t *dev ) ? dev_priv->front_offset : dev_priv->back_offset; RING_LOCALS; DRM_DEBUG( "%s: page=%d pfCurrentPage=%d\n", - __FUNCTION__, + __func__, dev_priv->current_page, dev_priv->sarea_priv->pfCurrentPage); @@ -1393,7 +1393,7 @@ int radeon_cp_vertex( DRM_IOCTL_ARGS ) LOCK_TEST_WITH_RETURN( dev, filp ); if ( !dev_priv ) { - DRM_ERROR( "%s called with no initialization\n", __FUNCTION__ ); + DRM_ERROR( "%s called with no initialization\n", __func__ ); return DRM_ERR(EINVAL); } @@ -1480,7 +1480,7 @@ int radeon_cp_indices( DRM_IOCTL_ARGS ) LOCK_TEST_WITH_RETURN( dev, filp ); if ( !dev_priv ) { - DRM_ERROR( "%s called with no initialization\n", __FUNCTION__ ); + DRM_ERROR( "%s called with no initialization\n", __func__ ); return DRM_ERR(EINVAL); } @@ -1630,7 +1630,7 @@ int radeon_cp_indirect( DRM_IOCTL_ARGS ) LOCK_TEST_WITH_RETURN( dev, filp ); if ( !dev_priv ) { - DRM_ERROR( "%s called with no initialization\n", __FUNCTION__ ); + DRM_ERROR( "%s called with no initialization\n", __func__ ); return DRM_ERR(EINVAL); } @@ -1707,7 +1707,7 @@ int radeon_cp_vertex2( DRM_IOCTL_ARGS ) LOCK_TEST_WITH_RETURN( dev, filp ); if ( !dev_priv ) { - DRM_ERROR( "%s called with no initialization\n", __FUNCTION__ ); + DRM_ERROR( "%s called with no initialization\n", __func__ ); return DRM_ERR(EINVAL); } @@ -1996,7 +1996,7 @@ static int radeon_emit_wait( drm_device_t *dev, int flags ) drm_radeon_private_t *dev_priv = dev->dev_private; RING_LOCALS; - DRM_DEBUG("%s: %x\n", __FUNCTION__, flags); + DRM_DEBUG("%s: %x\n", __func__, flags); switch (flags) { case RADEON_WAIT_2D: BEGIN_RING( 2 ); @@ -2034,7 +2034,7 @@ int radeon_cp_cmdbuf( DRM_IOCTL_ARGS ) LOCK_TEST_WITH_RETURN( dev, filp ); if ( !dev_priv ) { - DRM_ERROR( "%s called with no initialization\n", __FUNCTION__ ); + DRM_ERROR( "%s called with no initialization\n", __func__ ); return DRM_ERR(EINVAL); } @@ -2164,7 +2164,7 @@ int radeon_cp_getparam( DRM_IOCTL_ARGS ) int value; if ( !dev_priv ) { - DRM_ERROR( "%s called with no initialization\n", __FUNCTION__ ); + DRM_ERROR( "%s called with no initialization\n", __func__ ); return DRM_ERR(EINVAL); } diff --git a/sys/dev/misc/ppc/ppc.c b/sys/dev/misc/ppc/ppc.c index beac0fb2d1..f525962e6d 100644 --- a/sys/dev/misc/ppc/ppc.c +++ b/sys/dev/misc/ppc/ppc.c @@ -24,7 +24,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/isa/ppc.c,v 1.26.2.5 2001/10/02 05:21:45 nsouch Exp $ - * $DragonFly: src/sys/dev/misc/ppc/ppc.c,v 1.5 2003/08/07 21:16:58 dillon Exp $ + * $DragonFly: src/sys/dev/misc/ppc/ppc.c,v 1.6 2005/02/17 13:59:36 joerg Exp $ * */ @@ -199,7 +199,7 @@ ppc_detect_fifo(struct ppc_data *ppc) /* XXX 16 and 32 bits implementations not supported */ if (ppc->ppc_pword != PPC_PWORD_8) { - LOG_PPC(__FUNCTION__, ppc, "PWord not supported"); + LOG_PPC(__func__, ppc, "PWord not supported"); goto error; } @@ -218,7 +218,7 @@ ppc_detect_fifo(struct ppc_data *ppc) } if (i >= 1024) { - LOG_PPC(__FUNCTION__, ppc, "can't flush FIFO"); + LOG_PPC(__func__, ppc, "can't flush FIFO"); goto error; } @@ -241,7 +241,7 @@ ppc_detect_fifo(struct ppc_data *ppc) } if (i >= 1024) { - LOG_PPC(__FUNCTION__, ppc, "can't fill FIFO"); + LOG_PPC(__func__, ppc, "can't fill FIFO"); goto error; } @@ -254,7 +254,7 @@ ppc_detect_fifo(struct ppc_data *ppc) */ for (i=ppc->ppc_fifo; i>0; i--) { if (r_fifo(ppc) != (char)(ppc->ppc_fifo-i)) { - LOG_PPC(__FUNCTION__, ppc, "invalid data in FIFO"); + LOG_PPC(__func__, ppc, "invalid data in FIFO"); goto error; } if (r_ecr(ppc) & PPC_SERVICE_INTR) { @@ -263,14 +263,14 @@ ppc_detect_fifo(struct ppc_data *ppc) } /* if FIFO empty before the last byte, error */ if (i>1 && (r_ecr(ppc) & PPC_FIFO_EMPTY)) { - LOG_PPC(__FUNCTION__, ppc, "data lost in FIFO"); + LOG_PPC(__func__, ppc, "data lost in FIFO"); goto error; } } /* FIFO must be empty after the last byte */ if (!(r_ecr(ppc) & PPC_FIFO_EMPTY)) { - LOG_PPC(__FUNCTION__, ppc, "can't empty the FIFO"); + LOG_PPC(__func__, ppc, "can't empty the FIFO"); goto error; } @@ -1149,7 +1149,7 @@ found: printf(" ECP+EPP SPP"); break; default: - printf("%s: unknown case (0x%x)!\n", __FUNCTION__, r); + printf("%s: unknown case (0x%x)!\n", __func__, r); } } else { @@ -1500,7 +1500,7 @@ ppc_exec_microseq(device_t dev, struct ppb_microseq **p_msq) case MS_OP_CALL: if (stack) - panic("%s: too much calls", __FUNCTION__); + panic("%s: too much calls", __func__); if (mi->arg[0].p) { /* store the state of the actual @@ -1534,7 +1534,7 @@ ppc_exec_microseq(device_t dev, struct ppb_microseq **p_msq) * of a submicrosequence */ if (stack) panic("%s: can't return to ppb level", - __FUNCTION__); + __func__); /* update pc for ppb level of execution */ *p_msq = mi; @@ -1544,7 +1544,7 @@ ppc_exec_microseq(device_t dev, struct ppb_microseq **p_msq) default: panic("%s: unknown microsequence opcode 0x%x", - __FUNCTION__, mi->opcode); + __func__, mi->opcode); } } @@ -2077,7 +2077,7 @@ ppc_io(device_t ppcdev, int iop, u_char *addr, int cnt, u_char byte) w_fifo(ppc, byte); break; default: - panic("%s: unknown I/O operation", __FUNCTION__); + panic("%s: unknown I/O operation", __func__); break; } diff --git a/sys/dev/netif/em/Makefile b/sys/dev/netif/em/Makefile index 9d64e04061..be920c887f 100644 --- a/sys/dev/netif/em/Makefile +++ b/sys/dev/netif/em/Makefile @@ -1,13 +1,8 @@ #$FreeBSD: src/sys/modules/em/Makefile,v 1.1.2.3 2002/06/18 21:00:56 pdeuskar Exp $ -#$DragonFly: src/sys/dev/netif/em/Makefile,v 1.2 2003/06/17 04:28:43 dillon Exp $ -.PATH: ${.CURDIR}/../../dev/em -KMOD = if_em -SRCS = device_if.h bus_if.h pci_if.h opt_bdg.h -SRCS += if_em.c if_em_hw.c +#$DragonFly: src/sys/dev/netif/em/Makefile,v 1.3 2005/02/17 13:59:36 joerg Exp $ -clean: - rm -f opt_bdg.h device_if.h bus_if.h pci_if.h setdef* - rm -f *.o *.kld *.ko - rm -f @ machine +KMOD= if_em +SRCS= if_em.c if_em_hw.c +SRCS+= device_if.h bus_if.h pci_if.h opt_bdg.h .include diff --git a/sys/dev/netif/ic/if_ic.c b/sys/dev/netif/ic/if_ic.c index d15f26eb96..bb3607f63b 100644 --- a/sys/dev/netif/ic/if_ic.c +++ b/sys/dev/netif/ic/if_ic.c @@ -24,7 +24,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/iicbus/if_ic.c,v 1.8 1999/12/29 04:35:39 peter Exp $ - * $DragonFly: src/sys/dev/netif/ic/if_ic.c,v 1.10 2005/01/26 00:37:39 joerg Exp $ + * $DragonFly: src/sys/dev/netif/ic/if_ic.c,v 1.11 2005/02/17 13:59:36 joerg Exp $ */ /* @@ -349,7 +349,7 @@ icintr (device_t dev, int event, char *ptr) break; default: - panic("%s: unknown event (%d)!", __FUNCTION__, event); + panic("%s: unknown event (%d)!", __func__, event); } splx(s); diff --git a/sys/dev/netif/ray/if_raydbg.h b/sys/dev/netif/ray/if_raydbg.h index 955b33c682..fb3e95be37 100644 --- a/sys/dev/netif/ray/if_raydbg.h +++ b/sys/dev/netif/ray/if_raydbg.h @@ -29,7 +29,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/ray/if_raydbg.h,v 1.10.2.2 2001/08/14 22:54:07 dmlb Exp $ - * $DragonFly: src/sys/dev/netif/ray/Attic/if_raydbg.h,v 1.2 2003/06/17 04:28:29 dillon Exp $ + * $DragonFly: src/sys/dev/netif/ray/Attic/if_raydbg.h,v 1.3 2005/02/17 13:59:36 joerg Exp $ * */ @@ -96,14 +96,14 @@ #define RAY_DPRINTF(sc, mask, fmt, args...) do {if (RAY_DEBUG & (mask)) {\ device_printf((sc)->dev, "%s(%d) " fmt "\n", \ - __FUNCTION__ , __LINE__ , ##args); \ + __func__ , __LINE__ , ##args); \ } } while (0) /* This macro assumes that common memory is mapped into kernel space */ #define RAY_DHEX8(sc, mask, off, len, s) do { if (RAY_DEBUG & (mask)) { \ int i, j; \ device_printf((sc)->dev, "%s(%d) %s\n", \ - __FUNCTION__ , __LINE__ , (s)); \ + __func__ , __LINE__ , (s)); \ for (i = (off); i < (off)+(len); i += 8) { \ printf(". 0x%04x ", i); \ for (j = 0; j < 8; j++) \ @@ -114,7 +114,7 @@ #define RAY_DCOM(sc, mask, com, s) do { if (RAY_DEBUG & (mask)) { \ device_printf((sc)->dev, "%s(%d) %s com entry 0x%p\n", \ - __FUNCTION__ , __LINE__ , (s) , (com)); \ + __func__ , __LINE__ , (s) , (com)); \ printf(". c_mesg %s\n", (com)->c_mesg); \ printf(". c_flags 0x%b\n", (com)->c_flags, RAY_COM_FLAGS_PRINTFB); \ printf(". c_retval 0x%x\n", (com)->c_retval); \ @@ -135,13 +135,13 @@ #if RAY_DEBUG #define RAY_RECERR(sc, fmt, args...) do { \ device_printf((sc)->dev, "%s(%d) " fmt "\n", \ - __FUNCTION__ , __LINE__ , ##args); \ + __func__ , __LINE__ , ##args); \ } while (0) #endif /* RAY_DEBUG */ #if RAY_DEBUG & RAY_DBG_COM #define RAY_COM_CHECK(sc, com) do { if (RAY_DEBUG & RAY_DBG_COM) { \ - ray_com_ecf_check((sc), (com), __FUNCTION__ ); \ + ray_com_ecf_check((sc), (com), __func__ ); \ } } while (0) #endif /* RAY_DEBUG & RAY_DBG_COM */ diff --git a/sys/dev/powermng/i386/alpm/alpm.c b/sys/dev/powermng/i386/alpm/alpm.c index 97e44ba5ac..b5f7087784 100644 --- a/sys/dev/powermng/i386/alpm/alpm.c +++ b/sys/dev/powermng/i386/alpm/alpm.c @@ -24,7 +24,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/pci/alpm.c,v 1.15 2001/01/17 00:38:06 peter Exp $ - * $DragonFly: src/sys/dev/powermng/i386/alpm/alpm.c,v 1.5 2003/12/07 18:22:09 dillon Exp $ + * $DragonFly: src/sys/dev/powermng/i386/alpm/alpm.c,v 1.6 2005/02/17 13:59:36 joerg Exp $ * */ @@ -439,8 +439,7 @@ alsmb_smb_quick(device_t dev, u_char slave, int how) ALPM_SMBOUTB(sc, SMBHADDR, slave | LSB); break; default: - panic("%s: unknown QUICK command (%x)!", __FUNCTION__, - how); + panic("%s: unknown QUICK command (%x)!", __func__, how); } ALPM_SMBOUTB(sc, SMBCMD, SMBQUICK); ALPM_SMBOUTB(sc, SMBSTART, 0xff); diff --git a/sys/dev/powermng/i386/amdpm/amdpm.c b/sys/dev/powermng/i386/amdpm/amdpm.c index bb471a71fa..fa37f5608f 100644 --- a/sys/dev/powermng/i386/amdpm/amdpm.c +++ b/sys/dev/powermng/i386/amdpm/amdpm.c @@ -28,7 +28,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/pci/amdpm.c,v 1.1.2.1 2001/10/10 12:10:26 murray Exp $ - * $DragonFly: src/sys/dev/powermng/i386/amdpm/amdpm.c,v 1.4 2003/08/07 21:17:07 dillon Exp $ + * $DragonFly: src/sys/dev/powermng/i386/amdpm/amdpm.c,v 1.5 2005/02/17 13:59:36 joerg Exp $ * */ @@ -346,7 +346,7 @@ amdsmb_smb_quick(device_t dev, u_char slave, int how) AMDPM_SMBOUTW(sc, AMDSMB_HSTADDR, slave | LSB); break; default: - panic("%s: unknown QUICK command (%x)!", __FUNCTION__, how); + panic("%s: unknown QUICK command (%x)!", __func__, how); } l = AMDPM_SMBINW(sc, AMDSMB_GLOBAL_ENABLE); AMDPM_SMBOUTW(sc, AMDSMB_GLOBAL_ENABLE, (l & 0xfff8) | AMDSMB_GE_CYC_QUICK | AMDSMB_GE_HOST_STC); diff --git a/sys/dev/powermng/i386/viapm/viapm.c b/sys/dev/powermng/i386/viapm/viapm.c index b7a77703b6..27ce85ebdf 100644 --- a/sys/dev/powermng/i386/viapm/viapm.c +++ b/sys/dev/powermng/i386/viapm/viapm.c @@ -25,7 +25,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/pci/viapm.c,v 1.1.2.1 2002/04/19 05:52:15 nsouch Exp $ - * $DragonFly: src/sys/dev/powermng/i386/viapm/viapm.c,v 1.4 2003/11/20 22:07:32 dillon Exp $ + * $DragonFly: src/sys/dev/powermng/i386/viapm/viapm.c,v 1.5 2005/02/17 13:59:36 joerg Exp $ * */ #include @@ -646,8 +646,7 @@ viasmb_quick(device_t dev, u_char slave, int how) VIAPM_OUTB(SMBHADDR, slave | LSB); break; default: - panic("%s: unknown QUICK command (%x)!", __FUNCTION__, - how); + panic("%s: unknown QUICK command (%x)!", __func__, how); } VIAPM_OUTB(SMBHCTRL, SMBHCTRL_START | SMBHCTRL_QUICK); diff --git a/sys/dev/powermng/ichsmb/ichsmb.c b/sys/dev/powermng/ichsmb/ichsmb.c index 4a1ebfc7ca..9bd71fbace 100644 --- a/sys/dev/powermng/ichsmb/ichsmb.c +++ b/sys/dev/powermng/ichsmb/ichsmb.c @@ -37,7 +37,7 @@ * Author: Archie Cobbs * * $FreeBSD: src/sys/dev/ichsmb/ichsmb.c,v 1.1.2.1 2000/10/09 00:52:43 archie Exp $ - * $DragonFly: src/sys/dev/powermng/ichsmb/ichsmb.c,v 1.4 2003/08/07 21:17:07 dillon Exp $ + * $DragonFly: src/sys/dev/powermng/ichsmb/ichsmb.c,v 1.5 2005/02/17 13:59:36 joerg Exp $ */ /* @@ -67,7 +67,7 @@ #define ICHSMB_DEBUG 0 #if ICHSMB_DEBUG != 0 && defined(__GNUC__) #define DBG(fmt, args...) \ - do { log(LOG_DEBUG, "%s: " fmt, __FUNCTION__ , ## args); } while (0) + do { log(LOG_DEBUG, "%s: " fmt, __func__ , ## args); } while (0) #else #define DBG(fmt, args...) do { } while (0) #endif @@ -160,7 +160,7 @@ ichsmb_quick(device_t dev, u_char slave, int how) DBG("slave=0x%02x how=%d\n", slave, how); KASSERT(sc->ich_cmd == -1, - ("%s: ich_cmd=%d\n", __FUNCTION__ , sc->ich_cmd)); + ("%s: ich_cmd=%d\n", __func__ , sc->ich_cmd)); switch (how) { case SMB_QREAD: case SMB_QWRITE: @@ -190,7 +190,7 @@ ichsmb_sendb(device_t dev, u_char slave, char byte) DBG("slave=0x%02x byte=0x%02x\n", slave, (u_char)byte); KASSERT(sc->ich_cmd == -1, - ("%s: ich_cmd=%d\n", __FUNCTION__ , sc->ich_cmd)); + ("%s: ich_cmd=%d\n", __func__ , sc->ich_cmd)); s = splhigh(); sc->ich_cmd = ICH_HST_CNT_SMB_CMD_BYTE; bus_space_write_1(sc->io_bst, sc->io_bsh, ICH_XMIT_SLVA, @@ -213,7 +213,7 @@ ichsmb_recvb(device_t dev, u_char slave, char *byte) DBG("slave=0x%02x\n", slave); KASSERT(sc->ich_cmd == -1, - ("%s: ich_cmd=%d\n", __FUNCTION__ , sc->ich_cmd)); + ("%s: ich_cmd=%d\n", __func__ , sc->ich_cmd)); s = splhigh(); sc->ich_cmd = ICH_HST_CNT_SMB_CMD_BYTE; bus_space_write_1(sc->io_bst, sc->io_bsh, ICH_XMIT_SLVA, @@ -237,7 +237,7 @@ ichsmb_writeb(device_t dev, u_char slave, char cmd, char byte) DBG("slave=0x%02x cmd=0x%02x byte=0x%02x\n", slave, (u_char)cmd, (u_char)byte); KASSERT(sc->ich_cmd == -1, - ("%s: ich_cmd=%d\n", __FUNCTION__ , sc->ich_cmd)); + ("%s: ich_cmd=%d\n", __func__ , sc->ich_cmd)); s = splhigh(); sc->ich_cmd = ICH_HST_CNT_SMB_CMD_BYTE_DATA; bus_space_write_1(sc->io_bst, sc->io_bsh, ICH_XMIT_SLVA, @@ -262,7 +262,7 @@ ichsmb_writew(device_t dev, u_char slave, char cmd, short word) DBG("slave=0x%02x cmd=0x%02x word=0x%04x\n", slave, (u_char)cmd, (u_int16_t)word); KASSERT(sc->ich_cmd == -1, - ("%s: ich_cmd=%d\n", __FUNCTION__ , sc->ich_cmd)); + ("%s: ich_cmd=%d\n", __func__ , sc->ich_cmd)); s = splhigh(); sc->ich_cmd = ICH_HST_CNT_SMB_CMD_WORD_DATA; bus_space_write_1(sc->io_bst, sc->io_bsh, ICH_XMIT_SLVA, @@ -287,7 +287,7 @@ ichsmb_readb(device_t dev, u_char slave, char cmd, char *byte) DBG("slave=0x%02x cmd=0x%02x\n", slave, (u_char)cmd); KASSERT(sc->ich_cmd == -1, - ("%s: ich_cmd=%d\n", __FUNCTION__ , sc->ich_cmd)); + ("%s: ich_cmd=%d\n", __func__ , sc->ich_cmd)); s = splhigh(); sc->ich_cmd = ICH_HST_CNT_SMB_CMD_BYTE_DATA; bus_space_write_1(sc->io_bst, sc->io_bsh, ICH_XMIT_SLVA, @@ -311,7 +311,7 @@ ichsmb_readw(device_t dev, u_char slave, char cmd, short *word) DBG("slave=0x%02x cmd=0x%02x\n", slave, (u_char)cmd); KASSERT(sc->ich_cmd == -1, - ("%s: ich_cmd=%d\n", __FUNCTION__ , sc->ich_cmd)); + ("%s: ich_cmd=%d\n", __func__ , sc->ich_cmd)); s = splhigh(); sc->ich_cmd = ICH_HST_CNT_SMB_CMD_WORD_DATA; bus_space_write_1(sc->io_bst, sc->io_bsh, ICH_XMIT_SLVA, @@ -340,7 +340,7 @@ ichsmb_pcall(device_t dev, u_char slave, char cmd, short sdata, short *rdata) DBG("slave=0x%02x cmd=0x%02x sdata=0x%04x\n", slave, (u_char)cmd, (u_int16_t)sdata); KASSERT(sc->ich_cmd == -1, - ("%s: ich_cmd=%d\n", __FUNCTION__ , sc->ich_cmd)); + ("%s: ich_cmd=%d\n", __func__ , sc->ich_cmd)); s = splhigh(); sc->ich_cmd = ICH_HST_CNT_SMB_CMD_PROC_CALL; bus_space_write_1(sc->io_bst, sc->io_bsh, ICH_XMIT_SLVA, @@ -385,7 +385,7 @@ ichsmb_bwrite(device_t dev, u_char slave, char cmd, u_char count, char *buf) #undef DISP #endif KASSERT(sc->ich_cmd == -1, - ("%s: ich_cmd=%d\n", __FUNCTION__ , sc->ich_cmd)); + ("%s: ich_cmd=%d\n", __func__ , sc->ich_cmd)); if (count < 1 || count > 32) return (EINVAL); bcopy(buf, sc->block_data, count); @@ -417,7 +417,7 @@ ichsmb_bread(device_t dev, u_char slave, char cmd, u_char count, char *buf) DBG("slave=0x%02x cmd=0x%02x count=%d\n", slave, (u_char)cmd, count); KASSERT(sc->ich_cmd == -1, - ("%s: ich_cmd=%d\n", __FUNCTION__ , sc->ich_cmd)); + ("%s: ich_cmd=%d\n", __func__ , sc->ich_cmd)); if (count < 1 || count > 32) return (EINVAL); bzero(sc->block_data, sizeof(sc->block_data)); @@ -631,7 +631,7 @@ ichsmb_wait(sc_p sc) int error, smb_error; KASSERT(sc->ich_cmd != -1, - ("%s: ich_cmd=%d\n", __FUNCTION__ , sc->ich_cmd)); + ("%s: ich_cmd=%d\n", __func__ , sc->ich_cmd)); sleep: error = tsleep(sc, PCATCH, "ichsmb", hz / 4); DBG("tsleep -> %d\n", error); diff --git a/sys/dev/raid/aac/aacvar.h b/sys/dev/raid/aac/aacvar.h index 30e40a07cc..736406c4c3 100644 --- a/sys/dev/raid/aac/aacvar.h +++ b/sys/dev/raid/aac/aacvar.h @@ -27,7 +27,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/aac/aacvar.h,v 1.4.2.7 2003/04/08 13:22:08 scottl Exp $ - * $DragonFly: src/sys/dev/raid/aac/aacvar.h,v 1.7 2004/09/15 16:23:51 joerg Exp $ + * $DragonFly: src/sys/dev/raid/aac/aacvar.h,v 1.8 2005/02/17 13:59:36 joerg Exp $ */ /* @@ -413,11 +413,11 @@ extern int aac_sync_fib(struct aac_softc *sc, u_int32_t command, #ifdef AAC_DEBUG # define debug(level, fmt, args...) \ do { \ - if (level <=AAC_DEBUG) printf("%s: " fmt "\n", __FUNCTION__ , ##args); \ + if (level <=AAC_DEBUG) printf("%s: " fmt "\n", __func__ , ##args); \ } while (0) # define debug_called(level) \ do { \ - if (level <= AAC_DEBUG) printf(__FUNCTION__ ": called\n"); \ + if (level <= AAC_DEBUG) printf(__func__ ": called\n"); \ } while (0) extern void aac_print_queues(struct aac_softc *sc); @@ -427,7 +427,7 @@ extern void aac_print_fib(struct aac_softc *sc, struct aac_fib *fib, extern void aac_print_aif(struct aac_softc *sc, struct aac_aif_command *aif); -# define AAC_PRINT_FIB(sc, fib) aac_print_fib(sc, fib, __FUNCTION__) +# define AAC_PRINT_FIB(sc, fib) aac_print_fib(sc, fib, __func__) #else # define debug(level, fmt, args...) diff --git a/sys/dev/raid/mlx/mlx.c b/sys/dev/raid/mlx/mlx.c index 93264534e5..438dae681c 100644 --- a/sys/dev/raid/mlx/mlx.c +++ b/sys/dev/raid/mlx/mlx.c @@ -24,7 +24,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/mlx/mlx.c,v 1.14.2.5 2001/09/11 09:49:53 kris Exp $ - * $DragonFly: src/sys/dev/raid/mlx/mlx.c,v 1.10 2004/09/15 14:31:22 joerg Exp $ + * $DragonFly: src/sys/dev/raid/mlx/mlx.c,v 1.11 2005/02/17 13:59:36 joerg Exp $ */ /* @@ -1173,7 +1173,7 @@ mlx_periodic_enquiry(struct mlx_command *mc) break; } default: - device_printf(sc->mlx_dev, "%s: unknown command 0x%x", __FUNCTION__, mc->mc_mailbox[0]); + device_printf(sc->mlx_dev, "%s: unknown command 0x%x", __func__, mc->mc_mailbox[0]); break; } diff --git a/sys/dev/raid/mlx/mlxvar.h b/sys/dev/raid/mlx/mlxvar.h index 37c06305ba..b443f39062 100644 --- a/sys/dev/raid/mlx/mlxvar.h +++ b/sys/dev/raid/mlx/mlxvar.h @@ -24,7 +24,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/mlx/mlxvar.h,v 1.5.2.3 2001/06/25 04:37:51 msmith Exp $ - * $DragonFly: src/sys/dev/raid/mlx/mlxvar.h,v 1.5 2004/09/15 14:31:22 joerg Exp $ + * $DragonFly: src/sys/dev/raid/mlx/mlxvar.h,v 1.6 2005/02/17 13:59:36 joerg Exp $ */ /* @@ -34,8 +34,8 @@ * 2 - extremely noisy, emit trace items in loops, etc. */ #ifdef MLX_DEBUG -#define debug(level, fmt, args...) do { if (level <= MLX_DEBUG) printf("%s: " fmt "\n", __FUNCTION__ , ##args); } while(0) -#define debug_called(level) do { if (level <= MLX_DEBUG) printf(__FUNCTION__ ": called\n"); } while(0) +#define debug(level, fmt, args...) do { if (level <= MLX_DEBUG) printf("%s: " fmt "\n", __func__ , ##args); } while(0) +#define debug_called(level) do { if (level <= MLX_DEBUG) printf(__func__ ": called\n"); } while(0) #else #define debug(level, fmt, args...) #define debug_called(level) diff --git a/sys/dev/raid/mly/mlyvar.h b/sys/dev/raid/mly/mlyvar.h index 7cc8a443d7..35694ed347 100644 --- a/sys/dev/raid/mly/mlyvar.h +++ b/sys/dev/raid/mly/mlyvar.h @@ -25,7 +25,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/mly/mlyvar.h,v 1.1.2.2 2001/03/05 20:17:24 msmith Exp $ - * $DragonFly: src/sys/dev/raid/mly/mlyvar.h,v 1.4 2004/09/15 14:24:33 joerg Exp $ + * $DragonFly: src/sys/dev/raid/mly/mlyvar.h,v 1.5 2005/02/17 13:59:36 joerg Exp $ */ /******************************************************************************** @@ -76,8 +76,8 @@ * 2 - extremely noisy, emit trace items in loops, etc. */ #ifdef MLY_DEBUG -# define debug(level, fmt, args...) do { if (level <= MLY_DEBUG) printf("%s: " fmt "\n", __FUNCTION__ , ##args); } while(0) -# define debug_called(level) do { if (level <= MLY_DEBUG) printf(__FUNCTION__ ": called\n"); } while(0) +# define debug(level, fmt, args...) do { if (level <= MLY_DEBUG) printf("%s: " fmt "\n", __func__ , ##args); } while(0) +# define debug_called(level) do { if (level <= MLY_DEBUG) printf(__func__ ": called\n"); } while(0) # define debug_struct(s) printf(" SIZE %s: %d\n", #s, sizeof(struct s)) # define debug_union(s) printf(" SIZE %s: %d\n", #s, sizeof(union s)) # define debug_field(s, f) printf(" OFFSET %s.%s: %d\n", #s, #f, ((int)&(((struct s *)0)->f))) diff --git a/sys/emulation/ibcs2/coff/imgact_coff.c b/sys/emulation/ibcs2/coff/imgact_coff.c index 449070186e..0ef74ffbb2 100644 --- a/sys/emulation/ibcs2/coff/imgact_coff.c +++ b/sys/emulation/ibcs2/coff/imgact_coff.c @@ -27,7 +27,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/i386/ibcs2/imgact_coff.c,v 1.40 1999/12/15 23:01:47 eivind Exp $ - * $DragonFly: src/sys/emulation/ibcs2/coff/Attic/imgact_coff.c,v 1.13 2004/11/12 00:09:12 dillon Exp $ + * $DragonFly: src/sys/emulation/ibcs2/coff/Attic/imgact_coff.c,v 1.14 2005/02/17 13:59:36 joerg Exp $ */ #include @@ -282,7 +282,7 @@ coff_load_file(struct thread *td, char *name) if (vm_map_remove(kernel_map, (vm_offset_t) ptr, (vm_offset_t) ptr + PAGE_SIZE)) - panic("%s: vm_map_remove failed", __FUNCTION__); + panic("%s: vm_map_remove failed", __func__); fail: VOP_UNLOCK(vp, 0, td); diff --git a/sys/emulation/linux/linux_ioctl.c b/sys/emulation/linux/linux_ioctl.c index b8f6947131..e192f26985 100644 --- a/sys/emulation/linux/linux_ioctl.c +++ b/sys/emulation/linux/linux_ioctl.c @@ -27,7 +27,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/compat/linux/linux_ioctl.c,v 1.55.2.11 2003/05/01 20:16:09 anholt Exp $ - * $DragonFly: src/sys/emulation/linux/linux_ioctl.c,v 1.15 2004/08/15 14:15:00 joerg Exp $ + * $DragonFly: src/sys/emulation/linux/linux_ioctl.c,v 1.16 2005/02/17 13:59:36 joerg Exp $ */ #include @@ -1146,7 +1146,7 @@ linux_ioctl_map_ifname(struct file *fp, u_long cmd, u_long ocmd, caddr_t data, s char lifname[LINUX_IFNAMSIZ]; KASSERT(LINUX_IFNAMSIZ == IFNAMSIZ, - ("%s(): LINUX_IFNAMSIZ != IFNAMSIZ", __FUNCTION__)); + ("%s(): LINUX_IFNAMSIZ != IFNAMSIZ", __func__)); if (fp->f_type != DTYPE_SOCKET) { /* @@ -1164,7 +1164,7 @@ linux_ioctl_map_ifname(struct file *fp, u_long cmd, u_long ocmd, caddr_t data, s /* Save the original ifname */ bcopy(oifname, lifname, LINUX_IFNAMSIZ); #ifdef DEBUG - printf("%s(): ioctl %d on %.*s\n", __FUNCTION__, + printf("%s(): ioctl %d on %.*s\n", __func__, (int)(cmd & 0xffff), LINUX_IFNAMSIZ, lifname); #endif /* Replace linux ifname with bsd ifname */ @@ -1175,7 +1175,7 @@ linux_ioctl_map_ifname(struct file *fp, u_long cmd, u_long ocmd, caddr_t data, s } #ifdef DEBUG - printf("%s(): %s translated to %s\n", __FUNCTION__, + printf("%s(): %s translated to %s\n", __func__, lifname, oifname); #endif diff --git a/sys/kern/libmchain/subr_mchain.c b/sys/kern/libmchain/subr_mchain.c index f468f768eb..8d9a0bc8d2 100644 --- a/sys/kern/libmchain/subr_mchain.c +++ b/sys/kern/libmchain/subr_mchain.c @@ -30,7 +30,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/kern/subr_mchain.c,v 1.2.2.2 2002/04/13 12:46:40 bp Exp $ - * $DragonFly: src/sys/kern/libmchain/subr_mchain.c,v 1.2 2003/06/17 04:28:41 dillon Exp $ + * $DragonFly: src/sys/kern/libmchain/subr_mchain.c,v 1.3 2005/02/17 13:59:36 joerg Exp $ */ @@ -47,10 +47,10 @@ MODULE_VERSION(libmchain, 1); -#define MBERROR(format, args...) printf("%s(%d): "format, __FUNCTION__ , \ +#define MBERROR(format, args...) printf("%s(%d): "format, __func__ , \ __LINE__ ,## args) -#define MBPANIC(format, args...) printf("%s(%d): "format, __FUNCTION__ , \ +#define MBPANIC(format, args...) printf("%s(%d): "format, __func__ , \ __LINE__ ,## args) /* diff --git a/sys/kern/subr_bus.c b/sys/kern/subr_bus.c index 56e4b069f2..671c39c0f2 100644 --- a/sys/kern/subr_bus.c +++ b/sys/kern/subr_bus.c @@ -24,7 +24,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/kern/subr_bus.c,v 1.54.2.9 2002/10/10 15:13:32 jhb Exp $ - * $DragonFly: src/sys/kern/subr_bus.c,v 1.23 2005/02/04 03:32:37 dillon Exp $ + * $DragonFly: src/sys/kern/subr_bus.c,v 1.24 2005/02/17 13:59:36 joerg Exp $ */ #include "opt_bus.h" @@ -47,7 +47,7 @@ MALLOC_DEFINE(M_BUS, "bus", "Bus data structures"); #ifdef BUS_DEBUG -#define PDEBUG(a) (printf("%s:%d: ", __FUNCTION__, __LINE__), printf a, printf("\n")) +#define PDEBUG(a) (printf("%s:%d: ", __func__, __LINE__), printf a, printf("\n")) #define DEVICENAME(d) ((d)? device_get_name(d): "no device") #define DRIVERNAME(d) ((d)? d->name : "no driver") #define DEVCLANAME(d) ((d)? d->name : "no devclass") diff --git a/sys/kern/subr_sbuf.c b/sys/kern/subr_sbuf.c index 9dc89976d3..6bc449ea18 100644 --- a/sys/kern/subr_sbuf.c +++ b/sys/kern/subr_sbuf.c @@ -26,7 +26,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/kern/subr_sbuf.c,v 1.11.2.2 2002/03/12 01:01:07 archie Exp $ - * $DragonFly: src/sys/kern/subr_sbuf.c,v 1.5 2004/07/02 15:37:07 joerg Exp $ + * $DragonFly: src/sys/kern/subr_sbuf.c,v 1.6 2005/02/17 13:59:36 joerg Exp $ */ #include @@ -101,8 +101,8 @@ _assert_sbuf_state(const char *fun, struct sbuf *s, int state) ("%s called with %sfinished or corrupt sbuf", fun, (state ? "un" : ""))); } -#define assert_sbuf_integrity(s) _assert_sbuf_integrity(__FUNCTION__, (s)) -#define assert_sbuf_state(s, i) _assert_sbuf_state(__FUNCTION__, (s), (i)) +#define assert_sbuf_integrity(s) _assert_sbuf_integrity(__func__, (s)) +#define assert_sbuf_state(s, i) _assert_sbuf_state(__func__, (s), (i)) #else /* _KERNEL && INVARIANTS */ #define assert_sbuf_integrity(s) do { } while (0) #define assert_sbuf_state(s, i) do { } while (0) @@ -162,7 +162,7 @@ sbuf_new(struct sbuf *s, char *buf, int length, int flags) KASSERT(length >= 0, ("attempt to create an sbuf of negative length (%d)", length)); KASSERT((flags & ~SBUF_USRFLAGMSK) == 0, - ("%s called with invalid flags", __FUNCTION__)); + ("%s called with invalid flags", __func__)); flags &= SBUF_USRFLAGMSK; if (s == NULL) { @@ -201,9 +201,9 @@ struct sbuf * sbuf_uionew(struct sbuf *s, struct uio *uio, int *error) { KASSERT(uio != NULL, - ("%s called with NULL uio pointer", __FUNCTION__)); + ("%s called with NULL uio pointer", __func__)); KASSERT(error != NULL, - ("%s called with NULL error pointer", __FUNCTION__)); + ("%s called with NULL error pointer", __func__)); s = sbuf_new(s, NULL, uio->uio_resid + 1, 0); if (s == NULL) { @@ -405,7 +405,7 @@ sbuf_vprintf(struct sbuf *s, const char *fmt, __va_list ap) assert_sbuf_state(s, 0); KASSERT(fmt != NULL, - ("%s called with a NULL format string", __FUNCTION__)); + ("%s called with a NULL format string", __func__)); if (SBUF_HASOVERFLOWED(s)) return (-1); diff --git a/sys/kern/uipc_mbuf.c b/sys/kern/uipc_mbuf.c index b86355f66b..2678f00ac7 100644 --- a/sys/kern/uipc_mbuf.c +++ b/sys/kern/uipc_mbuf.c @@ -82,7 +82,7 @@ * * @(#)uipc_mbuf.c 8.2 (Berkeley) 1/4/94 * $FreeBSD: src/sys/kern/uipc_mbuf.c,v 1.51.2.24 2003/04/15 06:59:29 silby Exp $ - * $DragonFly: src/sys/kern/uipc_mbuf.c,v 1.32 2005/02/11 22:25:57 joerg Exp $ + * $DragonFly: src/sys/kern/uipc_mbuf.c,v 1.33 2005/02/17 13:59:36 joerg Exp $ */ #include "opt_param.h" @@ -1284,7 +1284,7 @@ m_dup(struct mbuf *m, int how) /* Sanity check */ if (m == NULL) return (0); - KASSERT((m->m_flags & M_PKTHDR) != 0, ("%s: !PKTHDR", __FUNCTION__)); + KASSERT((m->m_flags & M_PKTHDR) != 0, ("%s: !PKTHDR", __func__)); /* While there's more data, get a new mbuf, tack it on, and fill it */ remain = m->m_pkthdr.len; @@ -1333,7 +1333,7 @@ m_dup(struct mbuf *m, int how) /* Check correct total mbuf length */ KASSERT((remain > 0 && m != NULL) || (remain == 0 && m == NULL), - ("%s: bogus m_pkthdr.len", __FUNCTION__)); + ("%s: bogus m_pkthdr.len", __func__)); } return (top); diff --git a/sys/net/ef/if_ef.c b/sys/net/ef/if_ef.c index 81ad3579c3..cca524a545 100644 --- a/sys/net/ef/if_ef.c +++ b/sys/net/ef/if_ef.c @@ -24,7 +24,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/net/if_ef.c,v 1.2.2.4 2001/02/22 09:27:04 bp Exp $ - * $DragonFly: src/sys/net/ef/if_ef.c,v 1.13 2005/01/26 00:37:39 joerg Exp $ + * $DragonFly: src/sys/net/ef/if_ef.c,v 1.14 2005/02/17 13:59:59 joerg Exp $ */ #include "opt_inet.h" @@ -70,12 +70,12 @@ #define EF_NFT 4 /* total number of frame types */ #ifdef EF_DEBUG -#define EFDEBUG(format, args...) printf("%s: "format, __FUNCTION__ ,## args) +#define EFDEBUG(format, args...) printf("%s: "format, __func__ ,## args) #else #define EFDEBUG(format, args...) #endif -#define EFERROR(format, args...) printf("%s: "format, __FUNCTION__ ,## args) +#define EFERROR(format, args...) printf("%s: "format, __func__ ,## args) struct efnet { struct arpcom ef_ac; diff --git a/sys/net/i4b/include/i386/i4b_debug.h b/sys/net/i4b/include/i386/i4b_debug.h index 7ccd3c8ba0..95b054fdb7 100644 --- a/sys/net/i4b/include/i386/i4b_debug.h +++ b/sys/net/i4b/include/i386/i4b_debug.h @@ -28,7 +28,7 @@ * ----------------------------------- * * $FreeBSD: src/sys/i386/include/i4b_debug.h,v 1.6.2.1 2001/08/01 17:45:01 obrien Exp $ - * $DragonFly: src/sys/net/i4b/include/i386/i4b_debug.h,v 1.3 2003/06/28 04:16:03 dillon Exp $ + * $DragonFly: src/sys/net/i4b/include/i386/i4b_debug.h,v 1.4 2005/02/17 13:59:59 joerg Exp $ * * last edit-date: [Mon May 21 10:05:34 2001] * @@ -55,19 +55,19 @@ extern unsigned int i4b_l4_debug; #define NDBGL1(bits, fmt, args...) \ if(bits & i4b_l1_debug) \ - { printf("i4b-L1 %s: " fmt "\n", __FUNCTION__ , ##args ); } + { printf("i4b-L1 %s: " fmt "\n", __func__ , ##args ); } #define NDBGL2(bits, fmt, args...) \ if(bits & i4b_l2_debug) \ - { printf("i4b-L2 %s: " fmt "\n", __FUNCTION__ , ##args ); } + { printf("i4b-L2 %s: " fmt "\n", __func__ , ##args ); } #define NDBGL3(bits, fmt, args...) \ if(bits & i4b_l3_debug) \ - { printf("i4b-L3 %s: " fmt "\n", __FUNCTION__ , ##args ); } + { printf("i4b-L3 %s: " fmt "\n", __func__ , ##args ); } #define NDBGL4(bits, fmt, args...) \ if(bits & i4b_l4_debug) \ - { printf("i4b-L4 %s: " fmt "\n", __FUNCTION__ , ##args ); } + { printf("i4b-L4 %s: " fmt "\n", __func__ , ##args ); } #else /* !DO_I4B_DEBUG */ diff --git a/sys/net/if_arcsubr.c b/sys/net/if_arcsubr.c index d417a4fea6..2698df7d21 100644 --- a/sys/net/if_arcsubr.c +++ b/sys/net/if_arcsubr.c @@ -1,6 +1,6 @@ /* $NetBSD: if_arcsubr.c,v 1.36 2001/06/14 05:44:23 itojun Exp $ */ /* $FreeBSD: src/sys/net/if_arcsubr.c,v 1.1.2.5 2003/02/05 18:42:15 fjoe Exp $ */ -/* $DragonFly: src/sys/net/Attic/if_arcsubr.c,v 1.14 2005/02/11 22:25:57 joerg Exp $ */ +/* $DragonFly: src/sys/net/Attic/if_arcsubr.c,v 1.15 2005/02/17 13:59:36 joerg Exp $ */ /* * Copyright (c) 1994, 1995 Ignatios Souvatzis @@ -631,7 +631,7 @@ arc_ifattach(ifp, lla) #else ifa = ifaddr_byindex(ifp->if_index); #endif - KASSERT(ifa != NULL, ("%s: no lladdr!\n", __FUNCTION__)); + KASSERT(ifa != NULL, ("%s: no lladdr!\n", __func__)); sdl = (struct sockaddr_dl *)ifa->ifa_addr; sdl->sdl_type = IFT_ARCNET; sdl->sdl_alen = ifp->if_addrlen; diff --git a/sys/net/if_ethersubr.c b/sys/net/if_ethersubr.c index f6a3c0616b..71d050c3c6 100644 --- a/sys/net/if_ethersubr.c +++ b/sys/net/if_ethersubr.c @@ -32,7 +32,7 @@ * * @(#)if_ethersubr.c 8.1 (Berkeley) 6/10/93 * $FreeBSD: src/sys/net/if_ethersubr.c,v 1.70.2.33 2003/04/28 15:45:53 archie Exp $ - * $DragonFly: src/sys/net/if_ethersubr.c,v 1.27 2005/02/11 22:25:57 joerg Exp $ + * $DragonFly: src/sys/net/if_ethersubr.c,v 1.28 2005/02/17 13:59:36 joerg Exp $ */ #include "opt_atalk.h" @@ -817,7 +817,7 @@ ether_ifattach_bpf(struct ifnet *ifp, uint8_t *lla, u_int dlt, u_int hdrlen) ifp->if_resolvemulti = ether_resolvemulti; ifp->if_broadcastaddr = etherbroadcastaddr; ifa = ifnet_addrs[ifp->if_index - 1]; - KASSERT(ifa != NULL, ("%s: no lladdr!\n", __FUNCTION__)); + KASSERT(ifa != NULL, ("%s: no lladdr!\n", __func__)); sdl = (struct sockaddr_dl *)ifa->ifa_addr; sdl->sdl_type = IFT_ETHER; sdl->sdl_alen = ifp->if_addrlen; diff --git a/sys/net/ip6fw/ip6_fw.c b/sys/net/ip6fw/ip6_fw.c index 7c77c655c6..70f9717869 100644 --- a/sys/net/ip6fw/ip6_fw.c +++ b/sys/net/ip6fw/ip6_fw.c @@ -1,5 +1,5 @@ /* $FreeBSD: src/sys/netinet6/ip6_fw.c,v 1.2.2.10 2003/08/03 17:52:54 ume Exp $ */ -/* $DragonFly: src/sys/net/ip6fw/ip6_fw.c,v 1.11 2004/12/28 22:20:53 hsu Exp $ */ +/* $DragonFly: src/sys/net/ip6fw/ip6_fw.c,v 1.12 2005/02/17 13:59:59 joerg Exp $ */ /* $KAME: ip6_fw.c,v 1.21 2001/01/24 01:25:32 itojun Exp $ */ /* @@ -1228,7 +1228,7 @@ ip6_fw_init(void) default_rule.fw_flg |= IPV6_FW_F_IN | IPV6_FW_F_OUT; if (check_ip6fw_struct(&default_rule) == NULL || add_entry6(&ip6_fw_chain, &default_rule)) - panic(__FUNCTION__); + panic(__func__); printf("IPv6 packet filtering initialized, "); #ifdef IPV6FIREWALL_DEFAULT_TO_ACCEPT diff --git a/sys/net/pf/pf_norm.c b/sys/net/pf/pf_norm.c index 53986c59a7..dafd7fbba5 100644 --- a/sys/net/pf/pf_norm.c +++ b/sys/net/pf/pf_norm.c @@ -1,7 +1,7 @@ /* $FreeBSD: src/sys/contrib/pf/net/pf_norm.c,v 1.10 2004/08/14 15:32:40 dwmalone Exp $ */ /* $OpenBSD: pf_norm.c,v 1.80.2.1 2004/04/30 21:46:33 brad Exp $ */ /* add $OpenBSD: pf_norm.c,v 1.87 2004/05/11 07:34:11 dhartmei Exp $ */ -/* $DragonFly: src/sys/net/pf/pf_norm.c,v 1.2 2005/02/11 22:25:57 joerg Exp $ */ +/* $DragonFly: src/sys/net/pf/pf_norm.c,v 1.3 2005/02/17 13:59:59 joerg Exp $ */ /* * Copyright (c) 2004 The DragonFly Project. All rights reserved. @@ -187,7 +187,7 @@ pf_purge_expired_fragments(void) while ((frag = TAILQ_LAST(&pf_fragqueue, pf_fragqueue)) != NULL) { KASSERT((BUFFER_FRAGMENTS(frag)), - ("BUFFER_FRAGMENTS(frag) == 0: %s", __FUNCTION__)); + ("BUFFER_FRAGMENTS(frag) == 0: %s", __func__)); if (frag->fr_timeout > expire) break; @@ -197,7 +197,7 @@ pf_purge_expired_fragments(void) while ((frag = TAILQ_LAST(&pf_cachequeue, pf_cachequeue)) != NULL) { KASSERT((!BUFFER_FRAGMENTS(frag)), - ("BUFFER_FRAGMENTS(frag) != 0: %s", __FUNCTION__)); + ("BUFFER_FRAGMENTS(frag) != 0: %s", __func__)); if (frag->fr_timeout > expire) break; @@ -206,7 +206,7 @@ pf_purge_expired_fragments(void) KASSERT((TAILQ_EMPTY(&pf_cachequeue) || TAILQ_LAST(&pf_cachequeue, pf_cachequeue) != frag), ("!(TAILQ_EMPTY() || TAILQ_LAST() == farg): %s", - __FUNCTION__)); + __func__)); } } @@ -269,7 +269,7 @@ pf_free_fragment(struct pf_fragment *frag) LIST_FIRST(&frag->fr_cache)->fr_off > frcache->fr_end), ("! (LIST_EMPTY() || LIST_FIRST()->fr_off >" - " frcache->fr_end): %s", __FUNCTION__)); + " frcache->fr_end): %s", __func__)); pool_put(&pf_cent_pl, frcache); pf_ncache--; @@ -343,7 +343,7 @@ pf_reassemble(struct mbuf **m0, struct pf_fragment **frag, u_int16_t max = ip_len + off; KASSERT((*frag == NULL || BUFFER_FRAGMENTS(*frag)), - ("! (*frag == NULL || BUFFER_FRAGMENTS(*frag)): %s", __FUNCTION__)); + ("! (*frag == NULL || BUFFER_FRAGMENTS(*frag)): %s", __func__)); /* Strip off ip header */ m->m_data += hlen; @@ -387,7 +387,7 @@ pf_reassemble(struct mbuf **m0, struct pf_fragment **frag, } KASSERT((frep != NULL || frea != NULL), - ("!(frep != NULL || frea != NULL): %s", __FUNCTION__));; + ("!(frep != NULL || frea != NULL): %s", __func__));; if (frep != NULL && FR_IP_OFF(frep) + frep->fr_ip->ip_len - frep->fr_ip->ip_hl * @@ -472,7 +472,7 @@ pf_reassemble(struct mbuf **m0, struct pf_fragment **frag, /* We have all the data */ frent = LIST_FIRST(&(*frag)->fr_queue); - KASSERT((frent != NULL), ("frent == NULL: %s", __FUNCTION__)); + KASSERT((frent != NULL), ("frent == NULL: %s", __func__)); if ((frent->fr_ip->ip_hl << 2) + off > IP_MAXPACKET) { DPFPRINTF(("drop: too big: %d\n", off)); pf_free_fragment(*frag); @@ -542,7 +542,7 @@ pf_fragcache(struct mbuf **m0, struct ip *h, struct pf_fragment **frag, int mff, int hosed = 0; KASSERT((*frag == NULL || !BUFFER_FRAGMENTS(*frag)), - ("!(*frag == NULL || !BUFFER_FRAGMENTS(*frag)): %s", __FUNCTION__)); + ("!(*frag == NULL || !BUFFER_FRAGMENTS(*frag)): %s", __func__)); /* Create a new range queue for this packet */ if (*frag == NULL) { @@ -596,7 +596,7 @@ pf_fragcache(struct mbuf **m0, struct ip *h, struct pf_fragment **frag, int mff, } KASSERT((frp != NULL || fra != NULL), - ("!(frp != NULL || fra != NULL): %s", __FUNCTION__)); + ("!(frp != NULL || fra != NULL): %s", __func__)); if (frp != NULL) { int precut; @@ -646,7 +646,7 @@ pf_fragcache(struct mbuf **m0, struct ip *h, struct pf_fragment **frag, int mff, goto no_mem; KASSERT(((*m0)->m_next == NULL), ("(*m0)->m_next != NULL: %s", - __FUNCTION__)); + __func__)); m_adj(m, precut + (h->ip_hl << 2)); m_cat(*m0, m); m = *m0; @@ -664,7 +664,7 @@ pf_fragcache(struct mbuf **m0, struct ip *h, struct pf_fragment **frag, int mff, KASSERT(((int)m->m_len == h->ip_len - precut), ("m->m_len != h->ip_len - precut: %s", - __FUNCTION__)); + __func__)); h->ip_off = h->ip_off + (precut >> 3); h->ip_len = h->ip_len - precut; @@ -722,7 +722,7 @@ pf_fragcache(struct mbuf **m0, struct ip *h, struct pf_fragment **frag, int mff, h = mtod(m, struct ip *); KASSERT(((int)m->m_len == h->ip_len - aftercut), ("m->m_len != h->ip_len - aftercut: %s", - __FUNCTION__)); + __func__)); h->ip_len = h->ip_len - aftercut; } else { hosed++; @@ -761,7 +761,7 @@ pf_fragcache(struct mbuf **m0, struct ip *h, struct pf_fragment **frag, int mff, } else if (frp && fra->fr_off <= frp->fr_end) { /* Need to merge in a modified 'frp' */ KASSERT((cur == NULL), ("cur != NULL: %s", - __FUNCTION__)); + __func__)); DPFPRINTF(("fragcache[%d]: adjacent(merge " "%d-%d) %d-%d (%d-%d)\n", h->ip_id, frp->fr_off, frp->fr_end, off, diff --git a/sys/netgraph/UI/ng_UI.c b/sys/netgraph/UI/ng_UI.c index 44cc0b7aad..8e891050e8 100644 --- a/sys/netgraph/UI/ng_UI.c +++ b/sys/netgraph/UI/ng_UI.c @@ -37,7 +37,7 @@ * Author: Julian Elischer * * $FreeBSD: src/sys/netgraph/ng_UI.c,v 1.6.2.2 2000/10/24 18:36:44 julian Exp $ - * $DragonFly: src/sys/netgraph/UI/ng_UI.c,v 1.4 2004/06/02 14:42:59 eirikn Exp $ + * $DragonFly: src/sys/netgraph/UI/ng_UI.c,v 1.5 2005/02/17 13:59:59 joerg Exp $ * $Whistle: ng_UI.c,v 1.14 1999/11/01 09:24:51 julian Exp $ */ @@ -191,7 +191,7 @@ ng_UI_rcvdata(hook_p hook, struct mbuf *m, meta_p meta) mtod(m, u_char *)[0] = HDLC_UI; NG_SEND_DATA(error, priv->downlink, m, meta); /* m -> NULL */ } else - panic(__FUNCTION__); + panic(__func__); done: NG_FREE_DATA(m, meta); /* does nothing if m == NULL */ @@ -232,7 +232,7 @@ ng_UI_disconnect(hook_p hook) else if (hook == priv->uplink) priv->uplink = NULL; else - panic(__FUNCTION__); + panic(__func__); return (0); } diff --git a/sys/netgraph/async/ng_async.c b/sys/netgraph/async/ng_async.c index 2a751c855f..977031a1c0 100644 --- a/sys/netgraph/async/ng_async.c +++ b/sys/netgraph/async/ng_async.c @@ -37,7 +37,7 @@ * Author: Archie Cobbs * * $FreeBSD: src/sys/netgraph/ng_async.c,v 1.6.2.5 2002/07/02 23:44:02 archie Exp $ - * $DragonFly: src/sys/netgraph/async/ng_async.c,v 1.5 2003/11/15 21:05:43 dillon Exp $ + * $DragonFly: src/sys/netgraph/async/ng_async.c,v 1.6 2005/02/17 13:59:59 joerg Exp $ * $Whistle: ng_async.c,v 1.17 1999/11/01 09:24:51 julian Exp $ */ @@ -241,7 +241,7 @@ nga_rcvdata(hook_p hook, struct mbuf *m, meta_p meta) return (nga_rcv_sync(sc, m, meta)); if (hook == sc->async) return (nga_rcv_async(sc, m, meta)); - panic(__FUNCTION__); + panic(__func__); } /* @@ -362,9 +362,9 @@ nga_disconnect(hook_p hook) else if (hook == sc->sync) hookp = &sc->sync; else - panic(__FUNCTION__); + panic(__func__); if (!*hookp) - panic("%s2", __FUNCTION__); + panic("%s2", __func__); *hookp = NULL; bzero(&sc->stats, sizeof(sc->stats)); sc->lasttime = 0; diff --git a/sys/netgraph/bpf/ng_bpf.c b/sys/netgraph/bpf/ng_bpf.c index 0d487a46b3..4dfef3f395 100644 --- a/sys/netgraph/bpf/ng_bpf.c +++ b/sys/netgraph/bpf/ng_bpf.c @@ -37,7 +37,7 @@ * Author: Archie Cobbs * * $FreeBSD: src/sys/netgraph/ng_bpf.c,v 1.2.4.4 2002/07/02 23:44:02 archie Exp $ - * $DragonFly: src/sys/netgraph/bpf/ng_bpf.c,v 1.3 2003/08/07 21:17:31 dillon Exp $ + * $DragonFly: src/sys/netgraph/bpf/ng_bpf.c,v 1.4 2005/02/17 13:59:59 joerg Exp $ * $Whistle: ng_bpf.c,v 1.3 1999/12/03 20:30:23 archie Exp $ */ @@ -457,7 +457,7 @@ ng_bpf_disconnect(hook_p hook) { const hinfo_p hip = hook->private; - KASSERT(hip != NULL, ("%s: null info", __FUNCTION__)); + KASSERT(hip != NULL, ("%s: null info", __func__)); FREE(hip->prog, M_NETGRAPH); bzero(hip, sizeof(*hip)); FREE(hip, M_NETGRAPH); diff --git a/sys/netgraph/bridge/ng_bridge.c b/sys/netgraph/bridge/ng_bridge.c index 43ba3a75fb..20cd9f7666 100644 --- a/sys/netgraph/bridge/ng_bridge.c +++ b/sys/netgraph/bridge/ng_bridge.c @@ -37,7 +37,7 @@ * Author: Archie Cobbs * * $FreeBSD: src/sys/netgraph/ng_bridge.c,v 1.1.2.5 2002/07/02 23:44:02 archie Exp $ - * $DragonFly: src/sys/netgraph/bridge/ng_bridge.c,v 1.6 2004/01/06 03:17:27 dillon Exp $ + * $DragonFly: src/sys/netgraph/bridge/ng_bridge.c,v 1.7 2005/02/17 13:59:59 joerg Exp $ */ /* @@ -528,9 +528,9 @@ ng_bridge_rcvdata(hook_p hook, struct mbuf *m, meta_p meta) /* Get link number */ linkNum = LINK_NUM(hook); KASSERT(linkNum >= 0 && linkNum < NG_BRIDGE_MAX_LINKS, - ("%s: linkNum=%u", __FUNCTION__, linkNum)); + ("%s: linkNum=%u", __func__, linkNum)); link = priv->links[linkNum]; - KASSERT(link != NULL, ("%s: link%d null", __FUNCTION__, linkNum)); + KASSERT(link != NULL, ("%s: link%d null", __func__, linkNum)); /* Sanity check packet and pull up header */ if (m->m_pkthdr.len < ETHER_HDR_LEN) { @@ -643,7 +643,7 @@ ng_bridge_rcvdata(hook_p hook, struct mbuf *m, meta_p meta) /* If destination same as incoming link, do nothing */ KASSERT(destLink != NULL, - ("%s: link%d null", __FUNCTION__, host->linkNum)); + ("%s: link%d null", __func__, host->linkNum)); if (destLink == link) { NG_FREE_DATA(m, meta); return (0); @@ -727,7 +727,7 @@ ng_bridge_rmnode(node_p node) ng_cutlinks(node); /* frees all link and host info */ KASSERT(priv->numLinks == 0 && priv->numHosts == 0, ("%s: numLinks=%d numHosts=%d", - __FUNCTION__, priv->numLinks, priv->numHosts)); + __func__, priv->numLinks, priv->numHosts)); FREE(priv->tab, M_NETGRAPH); /* NG_INVALID flag is now set so node will be freed at next timeout */ @@ -746,13 +746,13 @@ ng_bridge_disconnect(hook_p hook) /* Get link number */ linkNum = LINK_NUM(hook); KASSERT(linkNum >= 0 && linkNum < NG_BRIDGE_MAX_LINKS, - ("%s: linkNum=%u", __FUNCTION__, linkNum)); + ("%s: linkNum=%u", __func__, linkNum)); /* Remove all hosts associated with this link */ ng_bridge_remove_hosts(priv, linkNum); /* Free associated link information */ - KASSERT(priv->links[linkNum] != NULL, ("%s: no link", __FUNCTION__)); + KASSERT(priv->links[linkNum] != NULL, ("%s: no link", __func__)); FREE(priv->links[linkNum], M_NETGRAPH); priv->links[linkNum] = NULL; priv->numLinks--; @@ -807,7 +807,7 @@ ng_bridge_put(priv_p priv, const u_char *addr, int linkNum) /* Assert that entry does not already exist in hashtable */ SLIST_FOREACH(hent, &priv->tab[bucket], next) { KASSERT(!ETHER_EQUAL(hent->host.addr, addr), - ("%s: entry %6D exists in table", __FUNCTION__, addr, ":")); + ("%s: entry %6D exists in table", __func__, addr, ":")); } #endif @@ -959,7 +959,7 @@ ng_bridge_timeout(void *arg) /* Make sure host's link really exists */ KASSERT(priv->links[hent->host.linkNum] != NULL, ("%s: host %6D on nonexistent link %d\n", - __FUNCTION__, hent->host.addr, ":", + __func__, hent->host.addr, ":", hent->host.linkNum)); /* Remove hosts we haven't heard from in a while */ @@ -976,7 +976,7 @@ ng_bridge_timeout(void *arg) } } KASSERT(priv->numHosts == counter, - ("%s: hosts: %d != %d", __FUNCTION__, priv->numHosts, counter)); + ("%s: hosts: %d != %d", __func__, priv->numHosts, counter)); /* Decrease table size if necessary */ ng_bridge_rehash(priv); @@ -999,7 +999,7 @@ ng_bridge_timeout(void *arg) } } KASSERT(priv->numLinks == counter, - ("%s: links: %d != %d", __FUNCTION__, priv->numLinks, counter)); + ("%s: links: %d != %d", __func__, priv->numLinks, counter)); /* Done */ splx(s); diff --git a/sys/netgraph/ether/ng_ether.c b/sys/netgraph/ether/ng_ether.c index 4d1f05642f..fb3faba19e 100644 --- a/sys/netgraph/ether/ng_ether.c +++ b/sys/netgraph/ether/ng_ether.c @@ -38,7 +38,7 @@ * Julian Elischer * * $FreeBSD: src/sys/netgraph/ng_ether.c,v 1.2.2.13 2002/07/02 20:10:25 archie Exp $ - * $DragonFly: src/sys/netgraph/ether/ng_ether.c,v 1.5 2004/06/02 14:43:00 eirikn Exp $ + * $DragonFly: src/sys/netgraph/ether/ng_ether.c,v 1.6 2005/02/17 13:59:59 joerg Exp $ */ /* @@ -300,11 +300,11 @@ ng_ether_attach(struct ifnet *ifp) node_p node; /* Create node */ - KASSERT(!IFP2NG(ifp), ("%s: node already exists?", __FUNCTION__)); + KASSERT(!IFP2NG(ifp), ("%s: node already exists?", __func__)); strlcpy(name, ifp->if_xname, sizeof(name)); if (ng_make_node_common(&ng_ether_typestruct, &node) != 0) { log(LOG_ERR, "%s: can't %s for %s\n", - __FUNCTION__, "create node", name); + __func__, "create node", name); return; } @@ -312,7 +312,7 @@ ng_ether_attach(struct ifnet *ifp) MALLOC(priv, priv_p, sizeof(*priv), M_NETGRAPH, M_NOWAIT); if (priv == NULL) { log(LOG_ERR, "%s: can't %s for %s\n", - __FUNCTION__, "allocate memory", name); + __func__, "allocate memory", name); ng_unref(node); return; } @@ -326,7 +326,7 @@ ng_ether_attach(struct ifnet *ifp) /* Try to give the node the same name as the interface */ if (ng_name_node(node, name) != 0) { log(LOG_WARNING, "%s: can't name node %s\n", - __FUNCTION__, name); + __func__, name); } } @@ -564,7 +564,7 @@ ng_ether_rcvdata(hook_p hook, struct mbuf *m, meta_p meta) return ng_ether_rcv_lower(node, m, meta); if (hook == priv->upper) return ng_ether_rcv_upper(node, m, meta); - panic("%s: weird hook", __FUNCTION__); + panic("%s: weird hook", __func__); } /* @@ -675,7 +675,7 @@ ng_ether_disconnect(hook_p hook) priv->lower = NULL; priv->lowerOrphan = 0; } else - panic("%s: weird hook", __FUNCTION__); + panic("%s: weird hook", __func__); if (hook->node->numhooks == 0) ng_rmnode(hook->node); /* reset node */ return (0); diff --git a/sys/netgraph/fec/ng_fec.c b/sys/netgraph/fec/ng_fec.c index 8a474dbf16..85802266ba 100644 --- a/sys/netgraph/fec/ng_fec.c +++ b/sys/netgraph/fec/ng_fec.c @@ -33,7 +33,7 @@ * THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/netgraph/ng_fec.c,v 1.1.2.1 2002/11/01 21:39:31 julian Exp $ - * $DragonFly: src/sys/netgraph/fec/ng_fec.c,v 1.11 2005/01/26 00:37:40 joerg Exp $ + * $DragonFly: src/sys/netgraph/fec/ng_fec.c,v 1.12 2005/02/17 13:59:59 joerg Exp $ */ /* * Copyright (c) 1996-1999 Whistle Communications, Inc. @@ -286,7 +286,7 @@ ng_fec_get_unit(int *unit) } bit = ffs(ng_fec_units[index]) - 1; KASSERT(bit >= 0 && bit <= UNITS_BITSPERWORD - 1, - ("%s: word=%d bit=%d", __FUNCTION__, ng_fec_units[index], bit)); + ("%s: word=%d bit=%d", __func__, ng_fec_units[index], bit)); ng_fec_units[index] &= ~(1 << bit); *unit = (index * UNITS_BITSPERWORD) + bit; ng_units_in_use++; @@ -304,9 +304,9 @@ ng_fec_free_unit(int unit) index = unit / UNITS_BITSPERWORD; bit = unit % UNITS_BITSPERWORD; KASSERT(index < ng_fec_units_len, - ("%s: unit=%d len=%d", __FUNCTION__, unit, ng_fec_units_len)); + ("%s: unit=%d len=%d", __func__, unit, ng_fec_units_len)); KASSERT((ng_fec_units[index] & (1 << bit)) == 0, - ("%s: unit=%d is free", __FUNCTION__, unit)); + ("%s: unit=%d is free", __func__, unit)); ng_fec_units[index] |= (1 << bit); /* * XXX We could think about reducing the size of ng_fec_units[] diff --git a/sys/netgraph/frame_relay/ng_frame_relay.c b/sys/netgraph/frame_relay/ng_frame_relay.c index b030cbd079..9699f9c846 100644 --- a/sys/netgraph/frame_relay/ng_frame_relay.c +++ b/sys/netgraph/frame_relay/ng_frame_relay.c @@ -37,7 +37,7 @@ * Author: Julian Elisher * * $FreeBSD: src/sys/netgraph/ng_frame_relay.c,v 1.9.2.2 2000/10/24 18:36:45 julian Exp $ - * $DragonFly: src/sys/netgraph/frame_relay/ng_frame_relay.c,v 1.4 2004/06/02 14:43:00 eirikn Exp $ + * $DragonFly: src/sys/netgraph/frame_relay/ng_frame_relay.c,v 1.5 2005/02/17 13:59:59 joerg Exp $ * $Whistle: ng_frame_relay.c,v 1.20 1999/11/01 09:24:51 julian Exp $ */ @@ -407,7 +407,7 @@ ngfrm_rcvdata(hook_p hook, struct mbuf *m, meta_p meta) data[3] |= BYTEX_EA; break; default: - panic(__FUNCTION__); + panic(__func__); } /* Send it */ diff --git a/sys/netgraph/iface/ng_iface.c b/sys/netgraph/iface/ng_iface.c index 1d5cf862c5..e841739e0f 100644 --- a/sys/netgraph/iface/ng_iface.c +++ b/sys/netgraph/iface/ng_iface.c @@ -37,7 +37,7 @@ * Author: Archie Cobbs * * $FreeBSD: src/sys/netgraph/ng_iface.c,v 1.7.2.5 2002/07/02 23:44:02 archie Exp $ - * $DragonFly: src/sys/netgraph/iface/ng_iface.c,v 1.9 2005/01/31 21:40:04 joerg Exp $ + * $DragonFly: src/sys/netgraph/iface/ng_iface.c,v 1.10 2005/02/17 13:59:59 joerg Exp $ * $Whistle: ng_iface.c,v 1.33 1999/11/01 09:24:51 julian Exp $ */ @@ -303,7 +303,7 @@ ng_iface_get_unit(int *unit) } bit = ffs(ng_iface_units[index]) - 1; KASSERT(bit >= 0 && bit <= UNITS_BITSPERWORD - 1, - ("%s: word=%d bit=%d", __FUNCTION__, ng_iface_units[index], bit)); + ("%s: word=%d bit=%d", __func__, ng_iface_units[index], bit)); ng_iface_units[index] &= ~(1 << bit); *unit = (index * UNITS_BITSPERWORD) + bit; return (0); @@ -320,9 +320,9 @@ ng_iface_free_unit(int unit) index = unit / UNITS_BITSPERWORD; bit = unit % UNITS_BITSPERWORD; KASSERT(index < ng_iface_units_len, - ("%s: unit=%d len=%d", __FUNCTION__, unit, ng_iface_units_len)); + ("%s: unit=%d len=%d", __func__, unit, ng_iface_units_len)); KASSERT((ng_iface_units[index] & (1 << bit)) == 0, - ("%s: unit=%d is free", __FUNCTION__, unit)); + ("%s: unit=%d is free", __func__, unit)); ng_iface_units[index] |= (1 << bit); /* * XXX We could think about reducing the size of ng_iface_units[] @@ -464,7 +464,7 @@ ng_iface_output(struct ifnet *ifp, struct mbuf *m, static void ng_iface_start(struct ifnet *ifp) { - printf("%s: %s called?", ifp->if_xname, __FUNCTION__); + printf("%s: %s called?", ifp->if_xname, __func__); } /* @@ -475,7 +475,7 @@ ng_iface_bpftap(struct ifnet *ifp, struct mbuf *m, sa_family_t family) { int32_t family4 = (int32_t)family; - KASSERT(family != AF_UNSPEC, ("%s: family=AF_UNSPEC", __FUNCTION__)); + KASSERT(family != AF_UNSPEC, ("%s: family=AF_UNSPEC", __func__)); if (ifp->if_bpf) bpf_ptap(ifp->if_bpf, m, &family, sizeof(family4)); @@ -731,8 +731,8 @@ ng_iface_rcvdata(hook_p hook, struct mbuf *m, meta_p meta) int isr; /* Sanity checks */ - KASSERT(iffam != NULL, ("%s: iffam", __FUNCTION__)); - KASSERT(m->m_flags & M_PKTHDR, ("%s: not pkthdr", __FUNCTION__)); + KASSERT(iffam != NULL, ("%s: iffam", __func__)); + KASSERT(m->m_flags & M_PKTHDR, ("%s: not pkthdr", __func__)); if (m == NULL) return (EINVAL); if ((ifp->if_flags & IFF_UP) == 0) { @@ -815,7 +815,7 @@ ng_iface_disconnect(hook_p hook) const iffam_p iffam = get_iffam_from_hook(priv, hook); if (iffam == NULL) - panic(__FUNCTION__); + panic(__func__); *get_hook_from_iffam(priv, iffam) = NULL; return (0); } diff --git a/sys/netgraph/ksocket/ng_ksocket.c b/sys/netgraph/ksocket/ng_ksocket.c index 7039792fd9..9ed666d7a1 100644 --- a/sys/netgraph/ksocket/ng_ksocket.c +++ b/sys/netgraph/ksocket/ng_ksocket.c @@ -37,7 +37,7 @@ * Author: Archie Cobbs * * $FreeBSD: src/sys/netgraph/ng_ksocket.c,v 1.5.2.14 2003/08/24 08:24:38 hsu Exp $ - * $DragonFly: src/sys/netgraph/ksocket/ng_ksocket.c,v 1.8 2004/04/08 20:13:28 hsu Exp $ + * $DragonFly: src/sys/netgraph/ksocket/ng_ksocket.c,v 1.9 2005/02/17 13:59:59 joerg Exp $ * $Whistle: ng_ksocket.c,v 1.1 1999/11/16 20:04:40 archie Exp $ */ @@ -972,7 +972,7 @@ static int ng_ksocket_disconnect(hook_p hook) { KASSERT(hook->node->numhooks == 0, - ("%s: numhooks=%d?", __FUNCTION__, hook->node->numhooks)); + ("%s: numhooks=%d?", __func__, hook->node->numhooks)); ng_rmnode(hook->node); return (0); } @@ -1002,7 +1002,7 @@ ng_ksocket_incoming(struct socket *so, void *arg, int waitflag) splx(s); return; } - KASSERT(so == priv->so, ("%s: wrong socket", __FUNCTION__)); + KASSERT(so == priv->so, ("%s: wrong socket", __func__)); /* Check whether a pending connect operation has completed */ if (priv->flags & KSF_CONNECTING) { diff --git a/sys/netgraph/l2tp/ng_l2tp.c b/sys/netgraph/l2tp/ng_l2tp.c index e562df0d64..1ecb77d37d 100644 --- a/sys/netgraph/l2tp/ng_l2tp.c +++ b/sys/netgraph/l2tp/ng_l2tp.c @@ -38,7 +38,7 @@ * Author: Archie Cobbs * * $FreeBSD: src/sys/netgraph/ng_l2tp.c,v 1.1.2.1 2002/08/20 23:48:15 archie Exp $ - * $DragonFly: src/sys/netgraph/l2tp/ng_l2tp.c,v 1.5 2004/06/02 14:43:00 eirikn Exp $ + * $DragonFly: src/sys/netgraph/l2tp/ng_l2tp.c,v 1.6 2005/02/17 13:59:59 joerg Exp $ */ /* @@ -922,7 +922,7 @@ ng_l2tp_recv_ctrl(node_p node, struct mbuf *m, meta_p meta) /* Sanity check receive ack timer state */ KASSERT((i == 0) ^ seq->rack_timer_running, ("%s: xwin %d full but rack timer %srunning", - __FUNCTION__, i, seq->rack_timer_running ? "" : "not ")); + __func__, i, seq->rack_timer_running ? "" : "not ")); /* If peer's receive window is already full, nothing else to do */ if (i >= seq->cwnd) @@ -1022,7 +1022,7 @@ ng_l2tp_seq_init(priv_p priv) struct l2tp_seq *const seq = &priv->seq; KASSERT(priv->conf.peer_win >= 1, - ("%s: peer_win is zero", __FUNCTION__)); + ("%s: peer_win is zero", __func__)); memset(seq, 0, sizeof(*seq)); seq->cwnd = 1; seq->wmax = priv->conf.peer_win; @@ -1139,7 +1139,7 @@ ng_l2tp_seq_recv_nr(priv_p priv, u_int16_t nr) return; } KASSERT(nack <= L2TP_MAX_XWIN, - ("%s: nack=%d > %d", __FUNCTION__, nack, L2TP_MAX_XWIN)); + ("%s: nack=%d > %d", __func__, nack, L2TP_MAX_XWIN)); /* Update receive ack stats */ seq->rack = nr; @@ -1438,7 +1438,7 @@ ng_l2tp_seq_check(struct l2tp_seq *seq) const int peer_unack = L2TP_SEQ_DIFF(seq->ns, seq->rack); int i; -#define CHECK(p) KASSERT((p), ("%s: not: %s", __FUNCTION__, #p)) +#define CHECK(p) KASSERT((p), ("%s: not: %s", __func__, #p)) CHECK(seq->wmax <= L2TP_MAX_XWIN); CHECK(seq->cwnd >= 1); diff --git a/sys/netgraph/mppc/ng_mppc.c b/sys/netgraph/mppc/ng_mppc.c index 4a62bccf5f..bf631f6b17 100644 --- a/sys/netgraph/mppc/ng_mppc.c +++ b/sys/netgraph/mppc/ng_mppc.c @@ -38,7 +38,7 @@ * * $Whistle: ng_mppc.c,v 1.4 1999/11/25 00:10:12 archie Exp $ * $FreeBSD: src/sys/netgraph/ng_mppc.c,v 1.1.2.7 2002/12/16 17:58:42 archie Exp $ - * $DragonFly: src/sys/netgraph/mppc/ng_mppc.c,v 1.4 2004/07/23 14:14:30 joerg Exp $ + * $DragonFly: src/sys/netgraph/mppc/ng_mppc.c,v 1.5 2005/02/17 13:59:59 joerg Exp $ */ /* @@ -403,7 +403,7 @@ ng_mppc_rcvdata(hook_p hook, struct mbuf *m, meta_p meta) } /* Oops */ - panic("%s: unknown hook", __FUNCTION__); + panic("%s: unknown hook", __func__); } /* @@ -516,7 +516,7 @@ ng_mppc_compress(node_p node, struct mbuf *m, struct mbuf **resultp) &destCnt, d->history, flags, 0); /* Check return value */ - KASSERT(rtn != MPPC_INVALID, ("%s: invalid", __FUNCTION__)); + KASSERT(rtn != MPPC_INVALID, ("%s: invalid", __func__)); if ((rtn & MPPC_EXPANDED) == 0 && (rtn & MPPC_COMP_OK) == MPPC_COMP_OK) { outlen -= destCnt; @@ -621,7 +621,7 @@ ng_mppc_decompress(node_p node, struct mbuf *m, struct mbuf **resultp) if (rekey > MPPE_MAX_REKEY) { log(LOG_ERR, "%s: too many (%d) packets" " dropped, disabling node %p!", - __FUNCTION__, numLost, node); + __func__, numLost, node); priv->recv.cfg.enable = 0; goto failed; } @@ -656,7 +656,7 @@ ng_mppc_decompress(node_p node, struct mbuf *m, struct mbuf **resultp) /* Are we not expecting encryption? */ if ((d->cfg.bits & MPPE_BITS) == 0) { log(LOG_ERR, "%s: rec'd unexpectedly %s packet", - __FUNCTION__, "encrypted"); + __func__, "encrypted"); goto failed; } @@ -676,7 +676,7 @@ ng_mppc_decompress(node_p node, struct mbuf *m, struct mbuf **resultp) /* Are we expecting encryption? */ if ((d->cfg.bits & MPPE_BITS) != 0) { log(LOG_ERR, "%s: rec'd unexpectedly %s packet", - __FUNCTION__, "unencrypted"); + __func__, "unencrypted"); goto failed; } } @@ -688,7 +688,7 @@ ng_mppc_decompress(node_p node, struct mbuf *m, struct mbuf **resultp) if ((header & MPPC_FLAG_COMPRESSED) != 0 && (d->cfg.bits & MPPC_BIT) == 0) { log(LOG_ERR, "%s: rec'd unexpectedly %s packet", - __FUNCTION__, "compressed"); + __func__, "compressed"); failed: FREE(buf, M_NETGRAPH); return (EINVAL); @@ -724,11 +724,11 @@ failed: &sourceCnt, &destCnt, d->history, flags); /* Check return value */ - KASSERT(rtn != MPPC_INVALID, ("%s: invalid", __FUNCTION__)); + KASSERT(rtn != MPPC_INVALID, ("%s: invalid", __func__)); if ((rtn & MPPC_DEST_EXHAUSTED) != 0 || (rtn & MPPC_DECOMP_OK) != MPPC_DECOMP_OK) { log(LOG_ERR, "%s: decomp returned 0x%x", - __FUNCTION__, rtn); + __func__, rtn); FREE(decompbuf, M_NETGRAPH); goto failed; } diff --git a/sys/netgraph/netgraph/ng_base.c b/sys/netgraph/netgraph/ng_base.c index 8d1a4de2f8..f5e8ea408a 100644 --- a/sys/netgraph/netgraph/ng_base.c +++ b/sys/netgraph/netgraph/ng_base.c @@ -38,7 +38,7 @@ * Archie Cobbs * * $FreeBSD: src/sys/netgraph/ng_base.c,v 1.11.2.17 2002/07/02 23:44:02 archie Exp $ - * $DragonFly: src/sys/netgraph/netgraph/ng_base.c,v 1.13 2004/04/21 18:13:54 dillon Exp $ + * $DragonFly: src/sys/netgraph/netgraph/ng_base.c,v 1.14 2005/02/17 13:59:59 joerg Exp $ * $Whistle: ng_base.c,v 1.39 1999/01/28 23:54:53 julian Exp $ */ @@ -105,12 +105,12 @@ static ng_ID_t nextID = 1; int total; \ \ if (((m)->m_flags & M_PKTHDR) == 0) \ - panic("%s: !PKTHDR", __FUNCTION__); \ + panic("%s: !PKTHDR", __func__); \ for (total = 0, n = (m); n != NULL; n = n->m_next) \ total += n->m_len; \ if ((m)->m_pkthdr.len != total) { \ panic("%s: %d != %d", \ - __FUNCTION__, (m)->m_pkthdr.len, total); \ + __func__, (m)->m_pkthdr.len, total); \ } \ } while (0) #else @@ -479,7 +479,7 @@ ng_wait_node(node_p node, char *msg) error = ENXIO; } else { KASSERT(node->refs > 1, - ("%s: refs=%d", __FUNCTION__, node->refs)); + ("%s: refs=%d", __func__, node->refs)); node->flags |= NG_BUSY; } splx(s); @@ -1342,7 +1342,7 @@ ng_generic_msg(node_p here, struct ng_mesg *msg, const char *retaddr, if (ni->hooks >= nhooks) { log(LOG_ERR, "%s: number of %s changed\n", - __FUNCTION__, "hooks"); + __func__, "hooks"); break; } if ((hook->flags & HK_INVALID) != 0) @@ -1403,7 +1403,7 @@ ng_generic_msg(node_p here, struct ng_mesg *msg, const char *retaddr, if (nl->numnames >= num) { log(LOG_ERR, "%s: number of %s changed\n", - __FUNCTION__, "nodes"); + __func__, "nodes"); break; } if ((node->flags & NG_INVALID) != 0) @@ -1457,7 +1457,7 @@ ng_generic_msg(node_p here, struct ng_mesg *msg, const char *retaddr, if (tl->numtypes >= num) { log(LOG_ERR, "%s: number of %s changed\n", - __FUNCTION__, "types"); + __func__, "types"); break; } strncpy(tp->type_name, type->name, NG_TYPELEN); diff --git a/sys/netgraph/one2many/ng_one2many.c b/sys/netgraph/one2many/ng_one2many.c index bfd8ce445e..561bce5e57 100644 --- a/sys/netgraph/one2many/ng_one2many.c +++ b/sys/netgraph/one2many/ng_one2many.c @@ -37,7 +37,7 @@ * Author: Archie Cobbs * * $FreeBSD: src/sys/netgraph/ng_one2many.c,v 1.1.2.2 2002/07/02 23:44:02 archie Exp $ - * $DragonFly: src/sys/netgraph/one2many/ng_one2many.c,v 1.3 2003/08/07 21:17:32 dillon Exp $ + * $DragonFly: src/sys/netgraph/one2many/ng_one2many.c,v 1.4 2005/02/17 13:59:59 joerg Exp $ */ /* @@ -396,12 +396,12 @@ ng_one2many_rcvdata(hook_p hook, struct mbuf *m, meta_p meta) linkNum = LINK_NUM(hook); KASSERT(linkNum == NG_ONE2MANY_ONE_LINKNUM || (linkNum >= 0 && linkNum < NG_ONE2MANY_MAX_LINKS), - ("%s: linkNum=%d", __FUNCTION__, linkNum)); + ("%s: linkNum=%d", __func__, linkNum)); /* Figure out source link */ src = (linkNum == NG_ONE2MANY_ONE_LINKNUM) ? &priv->one : &priv->many[linkNum]; - KASSERT(src->hook != NULL, ("%s: no src%d", __FUNCTION__, linkNum)); + KASSERT(src->hook != NULL, ("%s: no src%d", __func__, linkNum)); /* Update receive stats */ src->stats.recvPackets++; @@ -438,7 +438,7 @@ ng_one2many_rmnode(node_p node) ng_unname(node); ng_cutlinks(node); KASSERT(priv->numActiveMany == 0, - ("%s: numActiveMany=%d", __FUNCTION__, priv->numActiveMany)); + ("%s: numActiveMany=%d", __func__, priv->numActiveMany)); FREE(priv, M_NETGRAPH); node->private = NULL; ng_unref(node); @@ -458,7 +458,7 @@ ng_one2many_disconnect(hook_p hook) linkNum = LINK_NUM(hook); KASSERT(linkNum == NG_ONE2MANY_ONE_LINKNUM || (linkNum >= 0 && linkNum < NG_ONE2MANY_MAX_LINKS), - ("%s: linkNum=%d", __FUNCTION__, linkNum)); + ("%s: linkNum=%d", __func__, linkNum)); /* Nuke the link */ if (linkNum == NG_ONE2MANY_ONE_LINKNUM) @@ -500,7 +500,7 @@ ng_one2many_update_many(priv_p priv) break; #ifdef INVARIANTS default: - panic("%s: invalid failAlg", __FUNCTION__); + panic("%s: invalid failAlg", __func__); #endif } } @@ -513,7 +513,7 @@ ng_one2many_update_many(priv_p priv) break; #ifdef INVARIANTS default: - panic("%s: invalid xmitAlg", __FUNCTION__); + panic("%s: invalid xmitAlg", __func__); #endif } } diff --git a/sys/netgraph/ppp/ng_ppp.c b/sys/netgraph/ppp/ng_ppp.c index e8cb97071e..0aaf43f420 100644 --- a/sys/netgraph/ppp/ng_ppp.c +++ b/sys/netgraph/ppp/ng_ppp.c @@ -37,7 +37,7 @@ * Author: Archie Cobbs * * $FreeBSD: src/sys/netgraph/ng_ppp.c,v 1.15.2.10 2003/03/10 17:55:48 archie Exp $ - * $DragonFly: src/sys/netgraph/ppp/ng_ppp.c,v 1.7 2004/09/16 03:43:09 dillon Exp $ + * $DragonFly: src/sys/netgraph/ppp/ng_ppp.c,v 1.8 2005/02/17 14:00:00 joerg Exp $ * $Whistle: ng_ppp.c,v 1.24 1999/11/01 09:24:52 julian Exp $ */ @@ -602,7 +602,7 @@ ng_ppp_rcvdata(hook_p hook, struct mbuf *m, meta_p meta) /* Convert index into a link number */ linkNum = (u_int16_t)~index; KASSERT(linkNum < NG_PPP_MAX_LINKS, - ("%s: bogus index 0x%x", __FUNCTION__, index)); + ("%s: bogus index 0x%x", __func__, index)); link = &priv->links[linkNum]; /* Stats */ @@ -724,7 +724,7 @@ ng_ppp_rcvdata(hook_p hook, struct mbuf *m, meta_p meta) } break; default: - panic("%s: bogus index 0x%x", __FUNCTION__, index); + panic("%s: bogus index 0x%x", __func__, index); } /* Now figure out what to do with the frame */ @@ -1210,11 +1210,11 @@ ng_ppp_get_packet(node_p node, struct mbuf **mp, meta_p *metap) qent = CIRCLEQ_FIRST(&priv->frags); KASSERT(!CIRCLEQ_EMPTY(&priv->frags) && qent->first, - ("%s: no packet", __FUNCTION__)); + ("%s: no packet", __func__)); for (tail = NULL; qent != NULL; qent = qnext) { qnext = CIRCLEQ_NEXT(qent, f_qent); KASSERT(!CIRCLEQ_EMPTY(&priv->frags), - ("%s: empty q", __FUNCTION__)); + ("%s: empty q", __func__)); CIRCLEQ_REMOVE(&priv->frags, qent, f_qent); if (tail == NULL) { tail = m = qent->data; @@ -1260,7 +1260,7 @@ ng_ppp_frag_trim(node_p node) break; qnext = CIRCLEQ_NEXT(qent, f_qent); KASSERT(qnext != (void*)&priv->frags, - ("%s: last frag < MSEQ?", __FUNCTION__)); + ("%s: last frag < MSEQ?", __func__)); if (qnext->seq != MP_NEXT_RECV_SEQ(priv, qent->seq) || qent->last || qnext->first) { dead = 1; @@ -1273,7 +1273,7 @@ ng_ppp_frag_trim(node_p node) /* Remove fragment and all others in the same packet */ while ((qent = CIRCLEQ_FIRST(&priv->frags)) != qnext) { KASSERT(!CIRCLEQ_EMPTY(&priv->frags), - ("%s: empty q", __FUNCTION__)); + ("%s: empty q", __func__)); priv->bundleStats.dropFragments++; CIRCLEQ_REMOVE(&priv->frags, qent, f_qent); NG_FREE_DATA(qent->data, qent->meta); @@ -1319,7 +1319,7 @@ ng_ppp_frag_process(node_p node) /* Get oldest fragment */ KASSERT(!CIRCLEQ_EMPTY(&priv->frags), - ("%s: empty q", __FUNCTION__)); + ("%s: empty q", __func__)); qent = CIRCLEQ_FIRST(&priv->frags); /* Bump MSEQ if necessary */ @@ -1412,7 +1412,7 @@ ng_ppp_frag_checkstale(node_p node) /* Throw away junk fragments in front of the completed packet */ while ((qent = CIRCLEQ_FIRST(&priv->frags)) != beg) { KASSERT(!CIRCLEQ_EMPTY(&priv->frags), - ("%s: empty q", __FUNCTION__)); + ("%s: empty q", __func__)); priv->bundleStats.dropFragments++; CIRCLEQ_REMOVE(&priv->frags, qent, f_qent); NG_FREE_DATA(qent->data, qent->meta); @@ -1460,9 +1460,9 @@ ng_ppp_frag_timeout(void *arg) } /* Reset timer state after timeout */ - KASSERT(priv->timerActive, ("%s: !timerActive", __FUNCTION__)); + KASSERT(priv->timerActive, ("%s: !timerActive", __func__)); priv->timerActive = 0; - KASSERT(node->refs > 1, ("%s: refs=%d", __FUNCTION__, node->refs)); + KASSERT(node->refs > 1, ("%s: refs=%d", __func__, node->refs)); ng_unref(node); /* Start timer again */ @@ -2041,7 +2041,7 @@ ng_ppp_stop_frag_timer(node_p node) callout_stop(&priv->fragTimer); priv->timerActive = 0; KASSERT(node->refs > 1, - ("%s: refs=%d", __FUNCTION__, node->refs)); + ("%s: refs=%d", __func__, node->refs)); ng_unref(node); } } diff --git a/sys/netgraph/pppoe/ng_pppoe.c b/sys/netgraph/pppoe/ng_pppoe.c index a87c470f94..4e7b24b806 100644 --- a/sys/netgraph/pppoe/ng_pppoe.c +++ b/sys/netgraph/pppoe/ng_pppoe.c @@ -37,11 +37,11 @@ * Author: Julian Elischer * * $FreeBSD: src/sys/netgraph/ng_pppoe.c,v 1.23.2.17 2002/07/02 22:17:18 archie Exp $ - * $DragonFly: src/sys/netgraph/pppoe/ng_pppoe.c,v 1.6 2004/09/16 03:43:09 dillon Exp $ + * $DragonFly: src/sys/netgraph/pppoe/ng_pppoe.c,v 1.7 2005/02/17 14:00:00 joerg Exp $ * $Whistle: ng_pppoe.c,v 1.10 1999/11/01 09:24:52 julian Exp $ */ #if 0 -#define AAA printf("pppoe: %s\n", __FUNCTION__ ); +#define AAA printf("pppoe: %s\n", __func__ ); #define BBB printf("-%d-", __LINE__ ); #else #define AAA diff --git a/sys/netgraph/pptpgre/ng_pptpgre.c b/sys/netgraph/pptpgre/ng_pptpgre.c index cd650a35e9..878710fb9e 100644 --- a/sys/netgraph/pptpgre/ng_pptpgre.c +++ b/sys/netgraph/pptpgre/ng_pptpgre.c @@ -37,7 +37,7 @@ * Author: Archie Cobbs * * $FreeBSD: src/sys/netgraph/ng_pptpgre.c,v 1.2.2.13 2002/10/10 18:27:54 archie Exp $ - * $DragonFly: src/sys/netgraph/pptpgre/ng_pptpgre.c,v 1.5 2004/06/02 14:43:00 eirikn Exp $ + * $DragonFly: src/sys/netgraph/pptpgre/ng_pptpgre.c,v 1.6 2005/02/17 14:00:00 joerg Exp $ * $Whistle: ng_pptpgre.c,v 1.7 1999/12/08 00:10:06 archie Exp $ */ @@ -415,7 +415,7 @@ ng_pptpgre_rcvdata(hook_p hook, struct mbuf *m, meta_p meta) return ng_pptpgre_xmit(node, m, meta); if (hook == priv->lower) return ng_pptpgre_recv(node, m, meta); - panic("%s: weird hook", __FUNCTION__); + panic("%s: weird hook", __func__); } /* @@ -460,7 +460,7 @@ ng_pptpgre_disconnect(hook_p hook) else if (hook == priv->lower) priv->lower = NULL; else - panic("%s: unknown hook", __FUNCTION__); + panic("%s: unknown hook", __func__); /* Go away if no longer connected to anything */ if (node->numhooks == 0) @@ -750,7 +750,7 @@ ng_pptpgre_start_recv_ack_timer(node_p node) /* Compute how long until oldest unack'd packet times out, and reset the timer to that time. */ - KASSERT(a->rackTimerPtr == NULL, ("%s: rackTimer", __FUNCTION__)); + KASSERT(a->rackTimerPtr == NULL, ("%s: rackTimer", __func__)); remain = (a->timeSent[0] + a->ato) - ng_pptpgre_time(node); if (remain < 0) remain = 0; @@ -807,8 +807,8 @@ ng_pptpgre_recv_ack_timeout(void *arg) /* This complicated stuff is needed to avoid race conditions */ FREE(arg, M_NETGRAPH); - KASSERT(node->refs > 0, ("%s: no refs", __FUNCTION__)); - KASSERT(priv != NULL, ("%s: priv=NULL", __FUNCTION__)); + KASSERT(node->refs > 0, ("%s: no refs", __func__)); + KASSERT(priv != NULL, ("%s: priv=NULL", __func__)); priv->timers--; if ((node->flags & NG_INVALID) != 0) { /* shutdown race condition */ if (priv->timers == 0) { @@ -862,7 +862,7 @@ ng_pptpgre_start_send_ack_timer(node_p node, int ackTimeout) int ticks; /* Start new timer */ - KASSERT(a->sackTimerPtr == NULL, ("%s: sackTimer", __FUNCTION__)); + KASSERT(a->sackTimerPtr == NULL, ("%s: sackTimer", __func__)); MALLOC(a->sackTimerPtr, node_p *, sizeof(node_p), M_NETGRAPH, M_NOWAIT); if (a->sackTimerPtr == NULL) { priv->stats.memoryFailures++; @@ -911,8 +911,8 @@ ng_pptpgre_send_ack_timeout(void *arg) /* This complicated stuff is needed to avoid race conditions */ FREE(arg, M_NETGRAPH); - KASSERT(node->refs > 0, ("%s: no refs", __FUNCTION__)); - KASSERT(priv != NULL, ("%s: priv=NULL", __FUNCTION__)); + KASSERT(node->refs > 0, ("%s: no refs", __func__)); + KASSERT(priv != NULL, ("%s: priv=NULL", __func__)); priv->timers--; if ((node->flags & NG_INVALID) != 0) { /* shutdown race condition */ if (priv->timers == 0) { diff --git a/sys/netgraph/rfc1490/ng_rfc1490.c b/sys/netgraph/rfc1490/ng_rfc1490.c index 611ab3bfdb..7518db6cb4 100644 --- a/sys/netgraph/rfc1490/ng_rfc1490.c +++ b/sys/netgraph/rfc1490/ng_rfc1490.c @@ -37,7 +37,7 @@ * Author: Julian Elischer * * $FreeBSD: src/sys/netgraph/ng_rfc1490.c,v 1.6.2.4 2002/07/02 22:17:18 archie Exp $ - * $DragonFly: src/sys/netgraph/rfc1490/ng_rfc1490.c,v 1.4 2004/06/02 14:43:00 eirikn Exp $ + * $DragonFly: src/sys/netgraph/rfc1490/ng_rfc1490.c,v 1.5 2005/02/17 14:00:00 joerg Exp $ * $Whistle: ng_rfc1490.c,v 1.22 1999/11/01 09:24:52 julian Exp $ */ @@ -300,7 +300,7 @@ ng_rfc1490_rcvdata(hook_p hook, struct mbuf *m, meta_p meta) mtod(m, u_char *)[1] = NLPID_IP; NG_SEND_DATA(error, priv->downlink, m, meta); } else - panic(__FUNCTION__); + panic(__func__); done: NG_FREE_DATA(m, meta); @@ -343,7 +343,7 @@ ng_rfc1490_disconnect(hook_p hook) else if (hook == priv->ppp) priv->ppp = NULL; else - panic(__FUNCTION__); + panic(__func__); return (0); } diff --git a/sys/netgraph/socket/ng_socket.c b/sys/netgraph/socket/ng_socket.c index 0c269bb283..a06b6bc444 100644 --- a/sys/netgraph/socket/ng_socket.c +++ b/sys/netgraph/socket/ng_socket.c @@ -37,7 +37,7 @@ * Author: Julian Elischer * * $FreeBSD: src/sys/netgraph/ng_socket.c,v 1.11.2.6 2002/07/02 22:17:18 archie Exp $ - * $DragonFly: src/sys/netgraph/socket/ng_socket.c,v 1.7 2004/03/06 01:58:55 hsu Exp $ + * $DragonFly: src/sys/netgraph/socket/ng_socket.c,v 1.8 2005/02/17 14:00:00 joerg Exp $ * $Whistle: ng_socket.c,v 1.28 1999/11/01 09:24:52 julian Exp $ */ @@ -521,7 +521,7 @@ ng_detach_common(struct ngpcb *pcbp, int which) sockdata->datasock = NULL; break; default: - panic(__FUNCTION__); + panic(__func__); } if ((--sockdata->refs == 0) && (sockdata->node != NULL)) ng_rmnode(sockdata->node); diff --git a/sys/netgraph/tee/ng_tee.c b/sys/netgraph/tee/ng_tee.c index 78bc375174..257db8e8bd 100644 --- a/sys/netgraph/tee/ng_tee.c +++ b/sys/netgraph/tee/ng_tee.c @@ -37,7 +37,7 @@ * Author: Julian Elischer * * $FreeBSD: src/sys/netgraph/ng_tee.c,v 1.7.2.5 2002/07/02 23:44:03 archie Exp $ - * $DragonFly: src/sys/netgraph/tee/ng_tee.c,v 1.4 2003/08/08 22:23:55 drhodus Exp $ + * $DragonFly: src/sys/netgraph/tee/ng_tee.c,v 1.5 2005/02/17 14:00:00 joerg Exp $ * $Whistle: ng_tee.c,v 1.18 1999/11/01 09:24:52 julian Exp $ */ @@ -298,7 +298,7 @@ ngt_rcvdata(hook_p hook, struct mbuf *m, meta_p meta) dup = NULL; dest = &sc->left; } else - panic("%s: no hook!", __FUNCTION__); + panic("%s: no hook!", __func__); /* Update stats on incoming hook */ hinfo->stats.inOctets += m->m_pkthdr.len; @@ -378,7 +378,7 @@ ngt_disconnect(hook_p hook) { struct hookinfo *const hinfo = (struct hookinfo *) hook->private; - KASSERT(hinfo != NULL, ("%s: null info", __FUNCTION__)); + KASSERT(hinfo != NULL, ("%s: null info", __func__)); hinfo->hook = NULL; if (hook->node->numhooks == 0) ng_rmnode(hook->node); diff --git a/sys/netgraph/tty/ng_tty.c b/sys/netgraph/tty/ng_tty.c index aa3fc3c053..908b28d345 100644 --- a/sys/netgraph/tty/ng_tty.c +++ b/sys/netgraph/tty/ng_tty.c @@ -37,7 +37,7 @@ * Author: Archie Cobbs * * $FreeBSD: src/sys/netgraph/ng_tty.c,v 1.7.2.3 2002/02/13 00:43:12 dillon Exp $ - * $DragonFly: src/sys/netgraph/tty/ng_tty.c,v 1.8 2004/09/16 03:43:09 dillon Exp $ + * $DragonFly: src/sys/netgraph/tty/ng_tty.c,v 1.9 2005/02/17 14:00:00 joerg Exp $ * $Whistle: ng_tty.c,v 1.21 1999/11/01 09:24:52 julian Exp $ */ @@ -115,7 +115,7 @@ typedef struct ngt_sc *sc_p; k <= MAX_MBUFQ && *mp; \ k++, mp = &(*mp)->m_nextpkt); \ if (k != sc->qlen || k > MAX_MBUFQ || *mp || mp != sc->qtail) \ - panic("%s: queue", __FUNCTION__); \ + panic("%s: queue", __func__); \ } while (0) #else #define QUEUECHECK(sc) do {} while (0) @@ -532,7 +532,7 @@ ngt_disconnect(hook_p hook) s = spltty(); if (hook != sc->hook) - panic(__FUNCTION__); + panic(__func__); sc->hook = NULL; m_freem(sc->m); sc->m = NULL; @@ -573,7 +573,7 @@ ngt_rcvdata(hook_p hook, struct mbuf *m, meta_p meta) int s, error = 0; if (hook != sc->hook) - panic(__FUNCTION__); + panic(__func__); NG_FREE_META(meta); s = spltty(); if (sc->qlen >= MAX_MBUFQ) @@ -677,7 +677,7 @@ ngt_mod_event(module_t mod, int event, void *data) if ((ngt_ldisc = ldisc_register(NETGRAPHDISC, &ngt_disc)) < 0) { splx(s); log(LOG_ERR, "%s: can't register line discipline", - __FUNCTION__); + __func__); return (EIO); } splx(s); diff --git a/sys/netgraph/vjc/ng_vjc.c b/sys/netgraph/vjc/ng_vjc.c index e086f9d5e2..4ab17269b5 100644 --- a/sys/netgraph/vjc/ng_vjc.c +++ b/sys/netgraph/vjc/ng_vjc.c @@ -37,7 +37,7 @@ * Author: Archie Cobbs * * $FreeBSD: src/sys/netgraph/ng_vjc.c,v 1.9.2.5 2002/07/02 23:44:03 archie Exp $ - * $DragonFly: src/sys/netgraph/vjc/ng_vjc.c,v 1.4 2004/06/02 14:43:01 eirikn Exp $ + * $DragonFly: src/sys/netgraph/vjc/ng_vjc.c,v 1.5 2005/02/17 14:00:00 joerg Exp $ * $Whistle: ng_vjc.c,v 1.17 1999/11/01 09:24:52 julian Exp $ */ @@ -448,7 +448,7 @@ ng_vjc_rcvdata(hook_p hook, struct mbuf *m, meta_p meta) hook = priv->vjcomp; break; default: - panic("%s: type=%d", __FUNCTION__, type); + panic("%s: type=%d", __func__, type); } } else if (hook == priv->vjcomp) { /* incoming compressed packet */ int vjlen, need2pullup; @@ -536,7 +536,7 @@ ng_vjc_rcvdata(hook_p hook, struct mbuf *m, meta_p meta) } else if (hook == priv->vjip) /* incoming regular packet (bypass) */ hook = priv->ip; else - panic("%s: unknown hook", __FUNCTION__); + panic("%s: unknown hook", __func__); /* Send result back out */ NG_SEND_DATA(error, hook, m, meta); @@ -580,7 +580,7 @@ ng_vjc_disconnect(hook_p hook) else if (hook == priv->vjip) priv->vjip = NULL; else - panic("%s: unknown hook", __FUNCTION__); + panic("%s: unknown hook", __func__); /* Go away if no hooks left */ if (node->numhooks == 0) diff --git a/sys/netinet/ip_divert.c b/sys/netinet/ip_divert.c index 574f3ef903..2effe6efc9 100644 --- a/sys/netinet/ip_divert.c +++ b/sys/netinet/ip_divert.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/netinet/ip_divert.c,v 1.42.2.6 2003/01/23 21:06:45 sam Exp $ - * $DragonFly: src/sys/netinet/ip_divert.c,v 1.20 2005/02/08 22:56:19 hsu Exp $ + * $DragonFly: src/sys/netinet/ip_divert.c,v 1.21 2005/02/17 14:00:00 joerg Exp $ */ #include "opt_inet.h" @@ -153,7 +153,7 @@ divert_packet(struct mbuf *m, int incoming, int port, int rule) u_int16_t nport; /* Sanity check */ - KASSERT(port != 0, ("%s: port=0", __FUNCTION__)); + KASSERT(port != 0, ("%s: port=0", __func__)); divsrc.sin_port = rule; /* record matching rule */ @@ -172,7 +172,7 @@ divert_packet(struct mbuf *m, int incoming, int port, int rule) struct ifaddr *ifa; /* Sanity check */ - KASSERT((m->m_flags & M_PKTHDR), ("%s: !PKTHDR", __FUNCTION__)); + KASSERT((m->m_flags & M_PKTHDR), ("%s: !PKTHDR", __func__)); /* Find IP address for receive interface */ TAILQ_FOREACH(ifa, &m->m_pkthdr.rcvif->if_addrhead, ifa_link) { diff --git a/sys/netproto/ncp/ncp_login.c b/sys/netproto/ncp/ncp_login.c index ce71109275..1b3bba8137 100644 --- a/sys/netproto/ncp/ncp_login.c +++ b/sys/netproto/ncp/ncp_login.c @@ -30,7 +30,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/netncp/ncp_login.c,v 1.2 1999/10/12 10:36:59 bp Exp $ - * $DragonFly: src/sys/netproto/ncp/ncp_login.c,v 1.4 2003/08/07 21:17:38 dillon Exp $ + * $DragonFly: src/sys/netproto/ncp/ncp_login.c,v 1.5 2005/02/17 14:00:00 joerg Exp $ */ #include #include @@ -110,7 +110,7 @@ ncp_login_object(struct ncp_conn *conn, unsigned char *username, struct ncp_bindery_object user; if ((error = ncp_get_encryption_key(conn, ncp_key)) != 0) { - printf("%s: Warning: use unencrypted login\n", __FUNCTION__); + printf("%s: Warning: use unencrypted login\n", __func__); return ncp_login_unencrypted(conn, login_type, username, password,td,cred); } if ((error = ncp_get_bindery_object_id(conn, login_type, username, &user,td,cred)) != 0) { diff --git a/sys/netproto/ncp/ncp_ncp.c b/sys/netproto/ncp/ncp_ncp.c index 001c49d9ae..8f285acded 100644 --- a/sys/netproto/ncp/ncp_ncp.c +++ b/sys/netproto/ncp/ncp_ncp.c @@ -30,7 +30,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/netncp/ncp_ncp.c,v 1.3 1999/10/29 10:21:07 bp Exp $ - * $DragonFly: src/sys/netproto/ncp/ncp_ncp.c,v 1.6 2003/08/07 21:54:35 dillon Exp $ + * $DragonFly: src/sys/netproto/ncp/ncp_ncp.c,v 1.7 2005/02/17 14:00:00 joerg Exp $ * * Core of NCP protocol */ @@ -193,12 +193,12 @@ ncp_do_request(struct ncp_conn *conn, struct ncp_rq *rqp) { if (td == NULL) td = curthread; /* XXX maybe procpage ? */ if (!ncp_conn_valid(conn)) { - printf("%s: conn not valid\n",__FUNCTION__); + printf("%s: conn not valid\n",__func__); return (error); } so = conn->ncp_so; if (!so) { - printf("%s: ncp_so is NULL !\n",__FUNCTION__); + printf("%s: ncp_so is NULL !\n",__func__); ncp_conn_invalidate(conn); /* wow ! how we do that ? */ return EBADF; } @@ -277,7 +277,7 @@ ncp_do_request(struct ncp_conn *conn, struct ncp_rq *rqp) { if (m->m_len < sizeof(*rp)) { m = m_pullup(m, sizeof(*rp)); if (m == NULL) { - printf("%s: reply too short\n",__FUNCTION__); + printf("%s: reply too short\n",__func__); continue; } } diff --git a/sys/netproto/ncp/ncp_subr.c b/sys/netproto/ncp/ncp_subr.c index 11ec10e478..2ed9cd06b6 100644 --- a/sys/netproto/ncp/ncp_subr.c +++ b/sys/netproto/ncp/ncp_subr.c @@ -30,7 +30,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/netncp/ncp_subr.c,v 1.2.2.1 2001/02/22 08:54:11 bp Exp $ - * $DragonFly: src/sys/netproto/ncp/ncp_subr.c,v 1.6 2004/09/16 23:01:34 joerg Exp $ + * $DragonFly: src/sys/netproto/ncp/ncp_subr.c,v 1.7 2005/02/17 14:00:00 joerg Exp $ */ #include #include @@ -226,7 +226,7 @@ ncp_write(struct ncp_conn *conn, ncp_fh *file, struct uio *uiop, struct ucred *c DECLARE_RQ; if (uiop->uio_iovcnt != 1) { - printf("%s: can't handle iovcnt>1 !!!\n", __FUNCTION__); + printf("%s: can't handle iovcnt>1 !!!\n", __func__); return EIO; } tsiz = uiop->uio_resid; diff --git a/sys/netproto/ncp/ncp_subr.h b/sys/netproto/ncp/ncp_subr.h index 0c92f30887..0301aac11d 100644 --- a/sys/netproto/ncp/ncp_subr.h +++ b/sys/netproto/ncp/ncp_subr.h @@ -30,7 +30,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/netncp/ncp_subr.h,v 1.3 2000/01/14 19:54:39 bde Exp $ - * $DragonFly: src/sys/netproto/ncp/ncp_subr.h,v 1.4 2003/06/25 03:56:05 dillon Exp $ + * $DragonFly: src/sys/netproto/ncp/ncp_subr.h,v 1.5 2005/02/17 14:00:00 joerg Exp $ */ #ifndef _NETNCP_NCP_SUBR_H_ #define _NETNCP_NCP_SUBR_H_ @@ -42,21 +42,21 @@ SIGISMEMBER(set, SIGQUIT)) -#define NCP_PRINT(format, args...) printf("FATAL: %s: "format, __FUNCTION__ ,## args) +#define NCP_PRINT(format, args...) printf("FATAL: %s: "format, __func__ ,## args) #define nwfs_printf NCP_PRINT /* Maybe this should panic, but I dont like that */ #define NCPFATAL NCP_PRINT /* socket debugging */ #ifdef NCP_SOCKET_DEBUG -#define NCPSDEBUG(format, args...) printf("%s: "format, __FUNCTION__ ,## args) +#define NCPSDEBUG(format, args...) printf("%s: "format, __func__ ,## args) #else #define NCPSDEBUG(format, args...) #endif /* NCP calls debug */ #ifdef NCP_NCP_DEBUG -#define NCPNDEBUG(format, args...) printf("%s: "format, __FUNCTION__ ,## args) +#define NCPNDEBUG(format, args...) printf("%s: "format, __func__ ,## args) #else #define NCPNDEBUG(format, args...) #endif @@ -70,14 +70,14 @@ /* FS VOPS debug */ #ifdef NWFS_VOPS_DEBUG -#define NCPVODEBUG(format, args...) printf("%s: "format, __FUNCTION__ ,## args) +#define NCPVODEBUG(format, args...) printf("%s: "format, __func__ ,## args) #else #define NCPVODEBUG(format, args...) #endif /* FS VNOPS debug */ #ifdef NWFS_VNOPS_DEBUG -#define NCPVNDEBUG(format, args...) printf("%s: "format, __FUNCTION__ ,## args) +#define NCPVNDEBUG(format, args...) printf("%s: "format, __func__ ,## args) #else #define NCPVNDEBUG(format, args...) #endif diff --git a/sys/netproto/smb/smb_smb.c b/sys/netproto/smb/smb_smb.c index 106e3aca30..6946686903 100644 --- a/sys/netproto/smb/smb_smb.c +++ b/sys/netproto/smb/smb_smb.c @@ -30,7 +30,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/netsmb/smb_smb.c,v 1.1.2.3 2002/12/14 14:44:19 fjoe Exp $ - * $DragonFly: src/sys/netproto/smb/smb_smb.c,v 1.4 2003/08/07 21:17:39 dillon Exp $ + * $DragonFly: src/sys/netproto/smb/smb_smb.c,v 1.5 2005/02/17 14:00:09 joerg Exp $ */ /* * various SMB requests. Most of the routines merely packs data into mbufs. @@ -93,7 +93,7 @@ smb_smb_negotiate(struct smb_vc *vcp, struct smb_cred *scred) u_int16_t dindex, tw, tw1, swlen, bc; int error, maxqsz; - if (smb_smb_nomux(vcp, scred, __FUNCTION__) != 0) + if (smb_smb_nomux(vcp, scred, __func__) != 0) return EINVAL; vcp->vc_hflags = 0; vcp->vc_hflags2 = 0; @@ -239,7 +239,7 @@ smb_smb_ssnsetup(struct smb_vc *vcp, struct smb_cred *scred) vcp->vc_smbuid = SMB_UID_UNKNOWN; - if (smb_smb_nomux(vcp, scred, __FUNCTION__) != 0) + if (smb_smb_nomux(vcp, scred, __func__) != 0) return EINVAL; error = smb_rq_alloc(VCTOCP(vcp), SMB_COM_SESSION_SETUP_ANDX, scred, &rqp); @@ -345,7 +345,7 @@ smb_smb_ssnclose(struct smb_vc *vcp, struct smb_cred *scred) if (vcp->vc_smbuid == SMB_UID_UNKNOWN) return 0; - if (smb_smb_nomux(vcp, scred, __FUNCTION__) != 0) + if (smb_smb_nomux(vcp, scred, __func__) != 0) return EINVAL; error = smb_rq_alloc(VCTOCP(vcp), SMB_COM_LOGOFF_ANDX, scred, &rqp); diff --git a/sys/netproto/smb/smb_subr.h b/sys/netproto/smb/smb_subr.h index 11654ec8c7..3ce2b41ddc 100644 --- a/sys/netproto/smb/smb_subr.h +++ b/sys/netproto/smb/smb_subr.h @@ -30,7 +30,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/netsmb/smb_subr.h,v 1.1.2.1 2001/05/22 08:32:34 bp Exp $ - * $DragonFly: src/sys/netproto/smb/smb_subr.h,v 1.10 2005/01/06 22:31:16 dillon Exp $ + * $DragonFly: src/sys/netproto/smb/smb_subr.h,v 1.11 2005/02/17 14:00:09 joerg Exp $ */ #ifndef _NETSMB_SMB_SUBR_H_ #define _NETSMB_SMB_SUBR_H_ @@ -48,17 +48,17 @@ MALLOC_DECLARE(M_SMBTEMP); */ #define PDROP PUSRFLAG1 /* OR'd with pri to stop re-entry of interlock mutex */ -#define SMBERROR(format, args...) printf("%s: "format, __FUNCTION__ ,## args) -#define SMBPANIC(format, args...) printf("%s: "format, __FUNCTION__ ,## args) +#define SMBERROR(format, args...) printf("%s: "format, __func__ ,## args) +#define SMBPANIC(format, args...) printf("%s: "format, __func__ ,## args) #ifdef SMB_SOCKET_DEBUG -#define SMBSDEBUG(format, args...) printf("%s: "format, __FUNCTION__ ,## args) +#define SMBSDEBUG(format, args...) printf("%s: "format, __func__ ,## args) #else #define SMBSDEBUG(format, args...) #endif #ifdef SMB_IOD_DEBUG -#define SMBIODEBUG(format, args...) printf("%s: "format, __FUNCTION__ ,## args) +#define SMBIODEBUG(format, args...) printf("%s: "format, __func__ ,## args) #else #define SMBIODEBUG(format, args...) #endif diff --git a/sys/netproto/smb/smb_trantcp.h b/sys/netproto/smb/smb_trantcp.h index 57b6c3c8d9..0e8b9b7f49 100644 --- a/sys/netproto/smb/smb_trantcp.h +++ b/sys/netproto/smb/smb_trantcp.h @@ -30,7 +30,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/netsmb/smb_trantcp.h,v 1.1.2.1 2001/05/22 08:32:34 bp Exp $ - * $DragonFly: src/sys/netproto/smb/smb_trantcp.h,v 1.2 2003/06/17 04:28:54 dillon Exp $ + * $DragonFly: src/sys/netproto/smb/smb_trantcp.h,v 1.3 2005/02/17 14:00:09 joerg Exp $ */ #ifndef _NETSMB_SMB_TRANTCP_H_ #define _NETSMB_SMB_TRANTCP_H_ @@ -39,7 +39,7 @@ #ifdef NB_DEBUG #define NBDEBUG(format, args...) printf("%s(%d): "format, \ - __FUNCTION__ , __LINE__ ,## args) + __func__ , __LINE__ ,## args) #else #define NBDEBUG(format, args...) #endif diff --git a/sys/sys/ckpt.h b/sys/sys/ckpt.h index ce968790ad..cc19a52e9b 100644 --- a/sys/sys/ckpt.h +++ b/sys/sys/ckpt.h @@ -22,7 +22,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $DragonFly: src/sys/sys/ckpt.h,v 1.4 2003/11/10 18:09:10 dillon Exp $ + * $DragonFly: src/sys/sys/ckpt.h,v 1.5 2005/02/17 14:00:09 joerg Exp $ */ #ifndef _SYS_CKPT_H_ #define _SYS_CKPT_H_ @@ -69,12 +69,9 @@ struct vn_hdr { #ifdef _KERNEL #ifdef DEBUG -#define TRACE_ENTER \ -printf("entering %s at %s:%d\n", __FUNCTION__, __FILE__, __LINE__) -#define TRACE_EXIT \ -printf("exiting %s at %s:%d\n", __FUNCTION__, __FILE__, __LINE__) -#define TRACE_ERR \ -printf("failure encountered in %s at %s:%d\n", __FUNCTION__, __FILE__, __LINE__) +#define TRACE_ENTER printf("entering %s at %s:%d\n", __func__, __FILE__, __LINE__) +#define TRACE_EXIT printf("exiting %s at %s:%d\n", __func__, __FILE__, __LINE__) +#define TRACE_ERR printf("failure encountered in %s at %s:%d\n", __func__, __FILE__, __LINE__) #define PRINTF(args) printf args #else #define TRACE_ENTER diff --git a/sys/sys/iconv.h b/sys/sys/iconv.h index f28d70613b..54be92a835 100644 --- a/sys/sys/iconv.h +++ b/sys/sys/iconv.h @@ -30,7 +30,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/sys/iconv.h,v 1.1.2.1 2001/05/21 08:28:07 bp Exp $ - * $DragonFly: src/sys/sys/iconv.h,v 1.2 2003/06/17 04:28:58 dillon Exp $ + * $DragonFly: src/sys/sys/iconv.h,v 1.3 2005/02/17 14:00:09 joerg Exp $ */ #ifndef _SYS_ICONV_H_ #define _SYS_ICONV_H_ @@ -147,7 +147,7 @@ int iconv_converter_donestub(struct iconv_converter_class *dp); int iconv_converter_handler(module_t mod, int type, void *data); #ifdef ICONV_DEBUG -#define ICDEBUG(format, args...) printf("%s: "format, __FUNCTION__ ,## args) +#define ICDEBUG(format, args...) printf("%s: "format, __func__ ,## args) #else #define ICDEBUG(format, args...) #endif diff --git a/sys/sys/systm.h b/sys/sys/systm.h index d4e2fba7b8..610eb0e92c 100644 --- a/sys/sys/systm.h +++ b/sys/sys/systm.h @@ -37,7 +37,7 @@ * * @(#)systm.h 8.7 (Berkeley) 3/29/95 * $FreeBSD: src/sys/sys/systm.h,v 1.111.2.18 2002/12/17 18:04:02 sam Exp $ - * $DragonFly: src/sys/sys/systm.h,v 1.27 2005/02/01 22:41:31 dillon Exp $ + * $DragonFly: src/sys/sys/systm.h,v 1.28 2005/02/17 14:00:09 joerg Exp $ */ #ifndef _SYS_SYSTM_H_ @@ -94,7 +94,7 @@ extern int clocks_running; /* timing/timeout subsystem is operational */ #ifdef INVARIANTS /* The option is always available */ #define KASSERT(exp,msg) do { if (!(exp)) panic msg; } while (0) -#define KKASSERT(exp) if (!(exp)) panic("assertion: " #exp " in %s", __FUNCTION__) +#define KKASSERT(exp) if (!(exp)) panic("assertion: " #exp " in %s", __func__) #define SPLASSERT(level, msg) __CONCAT(__CONCAT(spl,level),assert)(msg) #define CONDSPLASSERT(cond, level, msg) do { \ if (cond) \ diff --git a/sys/vfs/coda/coda_psdev.c b/sys/vfs/coda/coda_psdev.c index 00b2cb50f4..1a16d077ca 100644 --- a/sys/vfs/coda/coda_psdev.c +++ b/sys/vfs/coda/coda_psdev.c @@ -28,7 +28,7 @@ * * @(#) src/sys/coda/coda_psdev.c,v 1.1.1.1 1998/08/29 21:14:52 rvb Exp $ * $FreeBSD: src/sys/coda/coda_psdev.c,v 1.13 1999/09/29 15:03:46 marcel Exp $ - * $DragonFly: src/sys/vfs/coda/Attic/coda_psdev.c,v 1.8 2004/03/31 02:34:37 cpressey Exp $ + * $DragonFly: src/sys/vfs/coda/Attic/coda_psdev.c,v 1.9 2005/02/17 14:00:10 joerg Exp $ * */ @@ -88,7 +88,7 @@ int coda_pcatch = PCATCH; #else #endif -#define ENTRY if(coda_psdev_print_entry) myprintf(("Entered %s\n",__FUNCTION__)) +#define ENTRY if(coda_psdev_print_entry) myprintf(("Entered %s\n",__func__)) void vcodaattach(int n); diff --git a/sys/vfs/coda/coda_vfsops.c b/sys/vfs/coda/coda_vfsops.c index abf019da49..502124bdd6 100644 --- a/sys/vfs/coda/coda_vfsops.c +++ b/sys/vfs/coda/coda_vfsops.c @@ -28,7 +28,7 @@ * * @(#) src/sys/cfs/coda_vfsops.c,v 1.1.1.1 1998/08/29 21:14:52 rvb Exp $ * $FreeBSD: src/sys/coda/coda_vfsops.c,v 1.24.2.1 2001/07/26 20:36:45 iedowse Exp $ - * $DragonFly: src/sys/vfs/coda/Attic/coda_vfsops.c,v 1.19 2005/02/02 21:34:18 joerg Exp $ + * $DragonFly: src/sys/vfs/coda/Attic/coda_vfsops.c,v 1.20 2005/02/17 14:00:10 joerg Exp $ * */ @@ -70,7 +70,7 @@ MALLOC_DEFINE(M_CODA, "CODA storage", "Various Coda Structures"); int codadebug = 0; int coda_vfsop_print_entry = 0; -#define ENTRY if(coda_vfsop_print_entry) myprintf(("Entered %s\n",__FUNCTION__)) +#define ENTRY if(coda_vfsop_print_entry) myprintf(("Entered %s\n",__func__)) struct vnode *coda_ctlvp; struct coda_mntinfo coda_mnttbl[NVCODA]; /* indexed by minor device number */ diff --git a/sys/vfs/coda/coda_vnops.c b/sys/vfs/coda/coda_vnops.c index 87f5257a6c..45cadfb129 100644 --- a/sys/vfs/coda/coda_vnops.c +++ b/sys/vfs/coda/coda_vnops.c @@ -28,7 +28,7 @@ * * @(#) src/sys/coda/coda_vnops.c,v 1.1.1.1 1998/08/29 21:14:52 rvb Exp $ * $FreeBSD: src/sys/coda/coda_vnops.c,v 1.22.2.1 2001/06/29 16:26:22 shafeeq Exp $ - * $DragonFly: src/sys/vfs/coda/Attic/coda_vnops.c,v 1.25 2005/02/15 08:32:18 joerg Exp $ + * $DragonFly: src/sys/vfs/coda/Attic/coda_vnops.c,v 1.26 2005/02/17 14:00:10 joerg Exp $ * */ @@ -106,7 +106,7 @@ static int coda_lockdebug = 0; * coda_init is called at boot time. */ -#define ENTRY if(coda_vnop_print_entry) myprintf(("Entered %s\n",__FUNCTION__)) +#define ENTRY if(coda_vnop_print_entry) myprintf(("Entered %s\n",__func__)) /* Definition of the vnode operation vector */ diff --git a/sys/vfs/gnu/ext2fs/ext2_fs.h b/sys/vfs/gnu/ext2fs/ext2_fs.h index 0eaaede7af..444a305b9b 100644 --- a/sys/vfs/gnu/ext2fs/ext2_fs.h +++ b/sys/vfs/gnu/ext2fs/ext2_fs.h @@ -5,7 +5,7 @@ * University of Utah, Department of Computer Science * * $FreeBSD: src/sys/gnu/ext2fs/ext2_fs.h,v 1.8.2.2 2001/09/29 12:52:47 iedowse Exp $ - * $DragonFly: src/sys/vfs/gnu/ext2fs/ext2_fs.h,v 1.4 2004/02/05 21:03:37 rob Exp $ + * $DragonFly: src/sys/vfs/gnu/ext2fs/ext2_fs.h,v 1.5 2005/02/17 14:00:10 joerg Exp $ */ /* * linux/include/linux/ext2_fs.h @@ -79,7 +79,7 @@ #ifdef EXT2FS_DEBUG # define ext2_debug(f, a...) { \ printf ("EXT2-fs DEBUG (%s, %d): %s:", \ - __FILE__, __LINE__, __FUNCTION__); \ + __FILE__, __LINE__, __func__); \ printf (f, ## a); \ } #else diff --git a/sys/vfs/nwfs/nwfs_io.c b/sys/vfs/nwfs/nwfs_io.c index ef8fe7fb01..24bccd5930 100644 --- a/sys/vfs/nwfs/nwfs_io.c +++ b/sys/vfs/nwfs/nwfs_io.c @@ -30,7 +30,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/nwfs/nwfs_io.c,v 1.6.2.1 2000/10/25 02:11:10 bp Exp $ - * $DragonFly: src/sys/vfs/nwfs/nwfs_io.c,v 1.13 2004/11/12 00:09:42 dillon Exp $ + * $DragonFly: src/sys/vfs/nwfs/nwfs_io.c,v 1.14 2005/02/17 14:00:10 joerg Exp $ * */ #include @@ -160,7 +160,7 @@ nwfs_readvnode(struct vnode *vp, struct uio *uiop, struct ucred *cred) int error, biosize; if (vp->v_type != VREG && vp->v_type != VDIR) { - printf("%s: vn types other than VREG or VDIR are unsupported !\n",__FUNCTION__); + printf("%s: vn types other than VREG or VDIR are unsupported !\n",__func__); return EIO; } if (uiop->uio_resid == 0) return 0; @@ -202,7 +202,7 @@ nwfs_writevnode(struct vnode *vp, struct uio *uiop, struct ucred *cred, int error = 0; if (vp->v_type != VREG) { - printf("%s: vn types other than VREG unsupported !\n",__FUNCTION__); + printf("%s: vn types other than VREG unsupported !\n",__func__); return EIO; } NCPVNDEBUG("ofs=%d,resid=%d\n",(int)uiop->uio_offset, uiop->uio_resid); diff --git a/sys/vfs/nwfs/nwfs_subr.c b/sys/vfs/nwfs/nwfs_subr.c index d8637794af..05a164adbc 100644 --- a/sys/vfs/nwfs/nwfs_subr.c +++ b/sys/vfs/nwfs/nwfs_subr.c @@ -30,7 +30,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/nwfs/nwfs_subr.c,v 1.2.2.2 2000/10/25 02:11:10 bp Exp $ - * $DragonFly: src/sys/vfs/nwfs/nwfs_subr.c,v 1.6 2004/04/22 17:56:44 cpressey Exp $ + * $DragonFly: src/sys/vfs/nwfs/nwfs_subr.c,v 1.7 2005/02/17 14:00:10 joerg Exp $ */ #include #include @@ -194,7 +194,7 @@ ncp_lookup(struct vnode *dvp, int len, char *name, struct nw_entry_info *fap, } return error; } else if (len == 2 && name[0] == '.' && name[1] == '.') { - printf("%s: knows NOTHING about '..'\n", __FUNCTION__); + printf("%s: knows NOTHING about '..'\n", __func__); return EIO; } else { error = ncp_obtain_info(nmp, dnp->n_fid.f_id, diff --git a/sys/vfs/smbfs/smbfs_smb.c b/sys/vfs/smbfs/smbfs_smb.c index f7783ba00a..6b3618aa29 100644 --- a/sys/vfs/smbfs/smbfs_smb.c +++ b/sys/vfs/smbfs/smbfs_smb.c @@ -30,7 +30,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/fs/smbfs/smbfs_smb.c,v 1.1.2.2 2003/01/17 08:20:26 tjr Exp $ - * $DragonFly: src/sys/vfs/smbfs/smbfs_smb.c,v 1.6 2004/01/07 11:04:21 dillon Exp $ + * $DragonFly: src/sys/vfs/smbfs/smbfs_smb.c,v 1.7 2005/02/17 14:00:10 joerg Exp $ */ #include #include @@ -1256,7 +1256,7 @@ smbfs_smb_lookup(struct smbnode *dnp, const char *name, int nmlen, } else if (nmlen == 2 && name[0] == '.' && name[1] == '.') { error = smbfs_smb_lookup(VTOSMB(dnp->n_parent), NULL, 0, fap, scred); - printf("%s: knows NOTHING about '..'\n", __FUNCTION__); + printf("%s: knows NOTHING about '..'\n", __func__); return error; } error = smbfs_findopen(dnp, name, nmlen, diff --git a/sys/vfs/smbfs/smbfs_subr.h b/sys/vfs/smbfs/smbfs_subr.h index 466c543e2c..816f5dcd77 100644 --- a/sys/vfs/smbfs/smbfs_subr.h +++ b/sys/vfs/smbfs/smbfs_subr.h @@ -30,7 +30,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/fs/smbfs/smbfs_subr.h,v 1.1.2.1 2001/05/22 08:32:28 bp Exp $ - * $DragonFly: src/sys/vfs/smbfs/smbfs_subr.h,v 1.2 2003/06/17 04:28:33 dillon Exp $ + * $DragonFly: src/sys/vfs/smbfs/smbfs_subr.h,v 1.3 2005/02/17 14:00:10 joerg Exp $ */ #ifndef _FS_SMBFS_SMBFS_SUBR_H_ #define _FS_SMBFS_SMBFS_SUBR_H_ @@ -39,10 +39,10 @@ MALLOC_DECLARE(M_SMBFSDATA); #endif -#define SMBFSERR(format, args...) printf("%s: "format, __FUNCTION__ ,## args) +#define SMBFSERR(format, args...) printf("%s: "format, __func__ ,## args) #ifdef SMB_VNODE_DEBUG -#define SMBVDEBUG(format, args...) printf("%s: "format, __FUNCTION__ ,## args) +#define SMBVDEBUG(format, args...) printf("%s: "format, __func__ ,## args) #else #define SMBVDEBUG(format, args...) #endif diff --git a/sys/vfs/udf/udf_vnops.c b/sys/vfs/udf/udf_vnops.c index 3c09895200..b8f863d755 100644 --- a/sys/vfs/udf/udf_vnops.c +++ b/sys/vfs/udf/udf_vnops.c @@ -24,7 +24,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/fs/udf/udf_vnops.c,v 1.33 2003/12/07 05:04:49 scottl Exp $ - * $DragonFly: src/sys/vfs/udf/udf_vnops.c,v 1.12 2005/02/15 08:32:18 joerg Exp $ + * $DragonFly: src/sys/vfs/udf/udf_vnops.c,v 1.13 2005/02/17 14:00:10 joerg Exp $ */ /* udf_vnops.c */ @@ -406,7 +406,7 @@ udf_getattr(struct vop_getattr_args *a) static int udf_ioctl(struct vop_ioctl_args *a) { - printf("%s called\n", __FUNCTION__); + printf("%s called\n", __func__); return(ENOTTY); } @@ -819,7 +819,7 @@ udf_readdir(struct vop_readdir_args *a) static int udf_readlink(struct vop_readlink_args *ap) { - printf("%s called\n", __FUNCTION__); + printf("%s called\n", __func__); return(EOPNOTSUPP); } diff --git a/usr.sbin/inetd/inetd.c b/usr.sbin/inetd/inetd.c index 82083fa93b..676b404ed2 100644 --- a/usr.sbin/inetd/inetd.c +++ b/usr.sbin/inetd/inetd.c @@ -33,7 +33,7 @@ * @(#) Copyright (c) 1983, 1991, 1993, 1994 The Regents of the University of California. All rights reserved. * @(#)from: inetd.c 8.4 (Berkeley) 4/13/94 * $FreeBSD: src/usr.sbin/inetd/inetd.c,v 1.80.2.11 2003/04/05 13:39:18 dwmalone Exp $ - * $DragonFly: src/usr.sbin/inetd/inetd.c,v 1.6 2004/08/30 19:27:21 eirikn Exp $ + * $DragonFly: src/usr.sbin/inetd/inetd.c,v 1.7 2005/02/17 14:00:10 joerg Exp $ */ /* @@ -531,7 +531,7 @@ main(int argc, char **argv) #ifdef SANITY_CHECK if (nsock == 0) { - syslog(LOG_ERR, "%s: nsock=0", __FUNCTION__); + syslog(LOG_ERR, "%s: nsock=0", __func__); exit(EX_SOFTWARE); } #endif @@ -878,7 +878,7 @@ addchild(struct servtab *sep, pid_t pid) #ifdef SANITY_CHECK if (sep->se_numchild >= sep->se_maxchild) { syslog(LOG_ERR, "%s: %d >= %d", - __FUNCTION__, sep->se_numchild, sep->se_maxchild); + __func__, sep->se_numchild, sep->se_maxchild); exit(EX_SOFTWARE); } #endif @@ -1455,17 +1455,17 @@ enable(struct servtab *sep) #ifdef SANITY_CHECK if (sep->se_fd < 0) { syslog(LOG_ERR, - "%s: %s: bad fd", __FUNCTION__, sep->se_service); + "%s: %s: bad fd", __func__, sep->se_service); exit(EX_SOFTWARE); } if (ISMUX(sep)) { syslog(LOG_ERR, - "%s: %s: is mux", __FUNCTION__, sep->se_service); + "%s: %s: is mux", __func__, sep->se_service); exit(EX_SOFTWARE); } if (FD_ISSET(sep->se_fd, &allsock)) { syslog(LOG_ERR, - "%s: %s: not off", __FUNCTION__, sep->se_service); + "%s: %s: not off", __func__, sep->se_service); exit(EX_SOFTWARE); } nsock++; @@ -1484,21 +1484,21 @@ disable(struct servtab *sep) #ifdef SANITY_CHECK if (sep->se_fd < 0) { syslog(LOG_ERR, - "%s: %s: bad fd", __FUNCTION__, sep->se_service); + "%s: %s: bad fd", __func__, sep->se_service); exit(EX_SOFTWARE); } if (ISMUX(sep)) { syslog(LOG_ERR, - "%s: %s: is mux", __FUNCTION__, sep->se_service); + "%s: %s: is mux", __func__, sep->se_service); exit(EX_SOFTWARE); } if (!FD_ISSET(sep->se_fd, &allsock)) { syslog(LOG_ERR, - "%s: %s: not on", __FUNCTION__, sep->se_service); + "%s: %s: not on", __func__, sep->se_service); exit(EX_SOFTWARE); } if (nsock == 0) { - syslog(LOG_ERR, "%s: nsock=0", __FUNCTION__); + syslog(LOG_ERR, "%s: nsock=0", __func__); exit(EX_SOFTWARE); } nsock--; diff --git a/usr.sbin/mlxcontrol/mlxcontrol.h b/usr.sbin/mlxcontrol/mlxcontrol.h index f84963067e..9224c534ab 100644 --- a/usr.sbin/mlxcontrol/mlxcontrol.h +++ b/usr.sbin/mlxcontrol/mlxcontrol.h @@ -24,12 +24,12 @@ * SUCH DAMAGE. * * $FreeBSD: src/usr.sbin/mlxcontrol/mlxcontrol.h,v 1.1.1.1.2.1 2000/04/24 19:44:47 msmith Exp $ - * $DragonFly: src/usr.sbin/mlxcontrol/mlxcontrol.h,v 1.2 2003/06/17 04:29:57 dillon Exp $ + * $DragonFly: src/usr.sbin/mlxcontrol/mlxcontrol.h,v 1.3 2005/02/17 14:00:10 joerg Exp $ */ #include -#define debug(fmt, args...) printf("%s: " fmt "\n", __FUNCTION__ , ##args) +#define debug(fmt, args...) printf("%s: " fmt "\n", __func__ , ##args) struct mlxd_foreach_action { diff --git a/usr.sbin/rrenumd/rrenumd.c b/usr.sbin/rrenumd/rrenumd.c index 161526c767..152b865c1e 100644 --- a/usr.sbin/rrenumd/rrenumd.c +++ b/usr.sbin/rrenumd/rrenumd.c @@ -29,7 +29,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/usr.sbin/rrenumd/rrenumd.c,v 1.1.2.4 2001/07/09 09:49:49 ume Exp $ - * $DragonFly: src/usr.sbin/rrenumd/rrenumd.c,v 1.4 2004/12/18 22:48:14 swildner Exp $ + * $DragonFly: src/usr.sbin/rrenumd/rrenumd.c,v 1.5 2005/02/17 14:00:10 joerg Exp $ */ #include @@ -156,21 +156,21 @@ join_multi(const char *addrname) if (inet_pton(AF_INET6, addrname, &mreq.ipv6mr_multiaddr.s6_addr) != 1) { syslog(LOG_ERR, "<%s> inet_pton failed(library bug?)", - __FUNCTION__); + __func__); exit(1); } /* ADHOC: currently join only one */ { if ((mreq.ipv6mr_interface = if_nametoindex(ifname)) == 0) { syslog(LOG_ERR, "<%s> ifname %s should be invalid: %s", - __FUNCTION__, ifname, strerror(errno)); + __func__, ifname, strerror(errno)); exit(1); } if (setsockopt(s, IPPROTO_IPV6, IPV6_JOIN_GROUP, &mreq, sizeof(mreq)) < 0) { syslog(LOG_ERR, "<%s> IPV6_JOIN_GROUP on %s: %s", - __FUNCTION__, ifname, strerror(errno)); + __func__, ifname, strerror(errno)); exit(1); } } @@ -199,7 +199,7 @@ init_globals() CMSG_SPACE(sizeof(int)); if (rcvcmsgbuf == NULL && (rcvcmsgbuf = (u_char *)malloc(rcvcmsglen)) == NULL) { - syslog(LOG_ERR, "<%s>: malloc failed", __FUNCTION__); + syslog(LOG_ERR, "<%s>: malloc failed", __func__); exit(1); } rcvmhdr.msg_control = (caddr_t)rcvcmsgbuf; @@ -212,7 +212,7 @@ init_globals() CMSG_SPACE(sizeof(int)); if (sndcmsgbuf == NULL && (sndcmsgbuf = (u_char *)malloc(sndcmsglen)) == NULL) { - syslog(LOG_ERR, "<%s>: malloc failed", __FUNCTION__); + syslog(LOG_ERR, "<%s>: malloc failed", __func__); exit(1); } sndmhdr.msg_control = (caddr_t)sndcmsgbuf; @@ -228,7 +228,7 @@ config(FILE **fpp) struct rr_pco_match *rpm; if (parse(fpp) < 0) { - syslog(LOG_ERR, "<%s> parse failed", __FUNCTION__); + syslog(LOG_ERR, "<%s> parse failed", __func__); exit(1); } @@ -281,7 +281,7 @@ sock6_open(struct flags *flags return; if (with_v6dest && (s6 = socket(AF_INET6, SOCK_RAW, IPPROTO_ICMPV6)) < 0) { - syslog(LOG_ERR, "<%s> socket(v6): %s", __FUNCTION__, + syslog(LOG_ERR, "<%s> socket(v6): %s", __func__, strerror(errno)); exit(1); } @@ -300,7 +300,7 @@ sock6_open(struct flags *flags if (setsockopt(s6, IPPROTO_ICMPV6, ICMP6_FILTER, &filt, sizeof(filt)) < 0) { syslog(LOG_ERR, "<%s> IICMP6_FILTER: %s", - __FUNCTION__, strerror(errno)); + __func__, strerror(errno)); exit(1); } @@ -309,7 +309,7 @@ sock6_open(struct flags *flags if (setsockopt(s6, IPPROTO_IPV6, IPV6_PKTINFO, &on, sizeof(on)) < 0) { syslog(LOG_ERR, "<%s> IPV6_PKTINFO: %s", - __FUNCTION__, strerror(errno)); + __func__, strerror(errno)); exit(1); } @@ -332,7 +332,7 @@ sock6_open(struct flags *flags if (setsockopt(s6, IPPROTO_IPV6, IPV6_AUTH_TRANS_LEVEL, &optval, sizeof(optval)) == -1) { syslog(LOG_ERR, "<%s> IPV6_AUTH_TRANS_LEVEL: %s", - __FUNCTION__, strerror(errno)); + __func__, strerror(errno)); exit(1); } } @@ -341,7 +341,7 @@ sock6_open(struct flags *flags if (setsockopt(s6, IPPROTO_IPV6, IPV6_ESP_TRANS_LEVEL, &optval, sizeof(optval)) == -1) { syslog(LOG_ERR, "<%s> IPV6_ESP_TRANS_LEVEL: %s", - __FUNCTION__, strerror(errno)); + __func__, strerror(errno)); exit(1); } } @@ -367,7 +367,7 @@ sock4_open(struct flags *flags if (with_v4dest == 0) return; if ((s4 = socket(AF_INET, SOCK_RAW, IPPROTO_ICMPV6)) < 0) { - syslog(LOG_ERR, "<%s> socket(v4): %s", __FUNCTION__, + syslog(LOG_ERR, "<%s> socket(v4): %s", __func__, strerror(errno)); exit(1); } @@ -398,7 +398,7 @@ sock4_open(struct flags *flags if (setsockopt(s4, IPPROTO_IP, IP_AUTH_TRANS_LEVEL, &optval, sizeof(optval)) == -1) { syslog(LOG_ERR, "<%s> IP_AUTH_TRANS_LEVEL: %s", - __FUNCTION__, strerror(errno)); + __func__, strerror(errno)); exit(1); } } @@ -407,7 +407,7 @@ sock4_open(struct flags *flags if (setsockopt(s4, IPPROTO_IP, IP_ESP_TRANS_LEVEL, &optval, sizeof(optval)) == -1) { syslog(LOG_ERR, "<%s> IP_ESP_TRANS_LEVEL: %s", - __FUNCTION__, strerror(errno)); + __func__, strerror(errno)); exit(1); } } @@ -460,7 +460,7 @@ rrenum_output(struct payload_list *pl, struct dst_list *dl) i = sendmsg(dl->dl_dst->sa_family == AF_INET ? s4 : s6, &sndmhdr, 0); if (i < 0 || i != sndmhdr.msg_iov->iov_len) - syslog(LOG_ERR, "<%s> sendmsg: %s", __FUNCTION__, + syslog(LOG_ERR, "<%s> sendmsg: %s", __func__, strerror(errno)); } @@ -494,7 +494,7 @@ rrenum_input(int s) /* get message */ if ((i = recvmsg(s, &rcvmhdr, 0)) < 0) { - syslog(LOG_ERR, "<%s> recvmsg: %s", __FUNCTION__, + syslog(LOG_ERR, "<%s> recvmsg: %s", __func__, strerror(errno)); return; } @@ -502,7 +502,7 @@ rrenum_input(int s) i -= sizeof(struct ip); if (i < sizeof(struct icmp6_router_renum)) { syslog(LOG_ERR, "<%s> packet size(%d) is too short", - __FUNCTION__, i); + __func__, i); return; } if (s == s4) { @@ -521,7 +521,7 @@ rrenum_input(int s) break; default: syslog(LOG_ERR, "<%s> received unknown code %d", - __FUNCTION__, rr->rr_code); + __func__, rr->rr_code); break; } } @@ -557,7 +557,7 @@ main(int argc, char *argv[]) if((fp = fopen(optarg, "r")) == NULL) { syslog(LOG_ERR, "<%s> config file %s open failed", - __FUNCTION__, optarg); + __func__, optarg); exit(1); } break; @@ -641,7 +641,7 @@ main(int argc, char *argv[]) if ((i = select(maxfd + 1, &select_fd, NULL, NULL, &timeout)) < 0){ syslog(LOG_ERR, "<%s> select: %s", - __FUNCTION__, strerror(errno)); + __func__, strerror(errno)); continue; } if (i == 0) { /* timeout */ diff --git a/usr.sbin/rtadvd/advcap.c b/usr.sbin/rtadvd/advcap.c index 366794ff41..31170305b0 100644 --- a/usr.sbin/rtadvd/advcap.c +++ b/usr.sbin/rtadvd/advcap.c @@ -33,7 +33,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/usr.sbin/rtadvd/advcap.c,v 1.1.2.2 2001/07/03 11:02:13 ume Exp $ - * $DragonFly: src/usr.sbin/rtadvd/advcap.c,v 1.4 2004/03/20 17:22:46 cpressey Exp $ + * $DragonFly: src/usr.sbin/rtadvd/advcap.c,v 1.5 2005/02/17 14:00:10 joerg Exp $ */ /* @@ -139,7 +139,7 @@ getent(char *bp, char *name, char *cp) } if (tf < 0) { syslog(LOG_INFO, - "<%s> open: %s", __FUNCTION__, strerror(errno)); + "<%s> open: %s", __func__, strerror(errno)); return (-2); } for (;;) { diff --git a/usr.sbin/rtadvd/config.c b/usr.sbin/rtadvd/config.c index 16677b8c61..7388bd74ca 100644 --- a/usr.sbin/rtadvd/config.c +++ b/usr.sbin/rtadvd/config.c @@ -29,7 +29,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/usr.sbin/rtadvd/config.c,v 1.3.2.5 2003/04/22 09:40:57 suz Exp $ - * $DragonFly: src/usr.sbin/rtadvd/config.c,v 1.4 2004/02/10 02:59:43 rob Exp $ + * $DragonFly: src/usr.sbin/rtadvd/config.c,v 1.5 2005/02/17 14:00:10 joerg Exp $ */ #include @@ -118,7 +118,7 @@ getconfig(intface) "<%s> %s isn't defined in the configuration file" " or the configuration file doesn't exist." " Treat it as default", - __FUNCTION__, intface); + __func__, intface); } tmp = (struct rainfo *)malloc(sizeof(*ralist)); @@ -141,7 +141,7 @@ getconfig(intface) if ((tmp->sdl = if_nametosdl(intface)) == NULL) { syslog(LOG_ERR, "<%s> can't get information of %s", - __FUNCTION__, intface); + __func__, intface); exit(1); } tmp->ifindex = tmp->sdl->sdl_index; @@ -152,7 +152,7 @@ getconfig(intface) tmp->phymtu = IPV6_MMTU; syslog(LOG_WARNING, "<%s> can't get interface mtu of %s. Treat as %d", - __FUNCTION__, intface, IPV6_MMTU); + __func__, intface, IPV6_MMTU); } /* @@ -162,7 +162,7 @@ getconfig(intface) if (val < MIN_MAXINTERVAL || val > MAX_MAXINTERVAL) { syslog(LOG_ERR, "<%s> maxinterval must be between %e and %u", - __FUNCTION__, MIN_MAXINTERVAL, MAX_MAXINTERVAL); + __func__, MIN_MAXINTERVAL, MAX_MAXINTERVAL); exit(1); } tmp->maxinterval = (u_int)val; @@ -170,7 +170,7 @@ getconfig(intface) if (val < MIN_MININTERVAL || val > (tmp->maxinterval * 3) / 4) { syslog(LOG_ERR, "<%s> mininterval must be between %e and %d", - __FUNCTION__, + __func__, MIN_MININTERVAL, (tmp->maxinterval * 3) / 4); exit(1); @@ -194,7 +194,7 @@ getconfig(intface) tmp->rtpref = val & ND_RA_FLAG_RTPREF_MASK; if (tmp->rtpref == ND_RA_FLAG_RTPREF_RSV) { syslog(LOG_ERR, "<%s> invalid router preference on %s", - __FUNCTION__, intface); + __func__, intface); exit(1); } @@ -203,7 +203,7 @@ getconfig(intface) syslog(LOG_ERR, "<%s> router lifetime on %s must be 0 or" " between %d and %d", - __FUNCTION__, intface, + __func__, intface, tmp->maxinterval, MAXROUTERLIFETIME); exit(1); } @@ -219,7 +219,7 @@ getconfig(intface) syslog(LOG_WARNING, "<%s> non zero router lifetime is specified for %s, " "which must not be allowed for hosts.", - __FUNCTION__, intface); + __func__, intface); exit(1); } tmp->lifetime = val & 0xffff; @@ -228,7 +228,7 @@ getconfig(intface) if (val > MAXREACHABLETIME) { syslog(LOG_ERR, "<%s> reachable time must be no greater than %d", - __FUNCTION__, MAXREACHABLETIME); + __func__, MAXREACHABLETIME); exit(1); } tmp->reachabletime = (u_int32_t)val; @@ -236,7 +236,7 @@ getconfig(intface) MAYHAVE(val64, "retrans", DEF_ADVRETRANSTIMER); if (val64 < 0 || val64 > 0xffffffff) { syslog(LOG_ERR, - "<%s> retrans time out of range", __FUNCTION__); + "<%s> retrans time out of range", __func__); exit(1); } tmp->retranstimer = (u_int32_t)val64; @@ -245,7 +245,7 @@ getconfig(intface) if (agetstr("hapref", &bp) || agetstr("hatime", &bp)) { syslog(LOG_ERR, "<%s> mobile-ip6 configuration not supported", - __FUNCTION__); + __func__); exit(1); } #else @@ -254,7 +254,7 @@ getconfig(intface) syslog(LOG_ERR, "<%s> mobile-ip6 configuration without " "proper command line option", - __FUNCTION__); + __func__); exit(1); } } else { @@ -268,7 +268,7 @@ getconfig(intface) if (tmp->hatime <= 0) { syslog(LOG_ERR, "<%s> home agent lifetime must be greater than 0", - __FUNCTION__); + __func__); exit(1); } } @@ -291,7 +291,7 @@ getconfig(intface) syslog(LOG_ERR, "<%s> conflicting prefix configuration for %s: " "automatic and manual config at the same time", - __FUNCTION__, intface); + __func__, intface); exit(1); } get_prefix(tmp); @@ -307,7 +307,7 @@ getconfig(intface) if ((pfx = malloc(sizeof(struct prefix))) == NULL) { syslog(LOG_ERR, "<%s> can't allocate enough memory", - __FUNCTION__); + __func__); exit(1); } memset(pfx, 0, sizeof(*pfx)); @@ -324,7 +324,7 @@ getconfig(intface) if (val < 0 || val > 128) { syslog(LOG_ERR, "<%s> prefixlen out of range", - __FUNCTION__); + __func__); exit(1); } pfx->prefixlen = (int)val; @@ -354,7 +354,7 @@ getconfig(intface) if (val64 < 0 || val64 > 0xffffffff) { syslog(LOG_ERR, "<%s> vltime out of range", - __FUNCTION__); + __func__); exit(1); } pfx->validlifetime = (u_int32_t)val64; @@ -373,7 +373,7 @@ getconfig(intface) if (val64 < 0 || val64 > 0xffffffff) { syslog(LOG_ERR, "<%s> pltime out of range", - __FUNCTION__); + __func__); exit(1); } pfx->preflifetime = (u_int32_t)val64; @@ -393,35 +393,35 @@ getconfig(intface) syslog(LOG_ERR, "<%s> need %s as an prefix for " "interface %s", - __FUNCTION__, entbuf, intface); + __func__, entbuf, intface); exit(1); } if (inet_pton(AF_INET6, addr, &pfx->prefix) != 1) { syslog(LOG_ERR, "<%s> inet_pton failed for %s", - __FUNCTION__, addr); + __func__, addr); exit(1); } if (IN6_IS_ADDR_MULTICAST(&pfx->prefix)) { syslog(LOG_ERR, "<%s> multicast prefix(%s) must " "not be advertised (IF=%s)", - __FUNCTION__, addr, intface); + __func__, addr, intface); exit(1); } if (IN6_IS_ADDR_LINKLOCAL(&pfx->prefix)) syslog(LOG_NOTICE, "<%s> link-local prefix(%s) will be" " advertised on %s", - __FUNCTION__, addr, intface); + __func__, addr, intface); } } MAYHAVE(val, "mtu", 0); if (val < 0 || val > 0xffffffff) { syslog(LOG_ERR, - "<%s> mtu out of range", __FUNCTION__); + "<%s> mtu out of range", __func__); exit(1); } tmp->linkmtu = (u_int32_t)val; @@ -436,7 +436,7 @@ getconfig(intface) syslog(LOG_ERR, "<%s> advertised link mtu must be between" " least MTU and physical link MTU", - __FUNCTION__); + __func__); exit(1); } @@ -445,7 +445,7 @@ getconfig(intface) MAYHAVE(val, "routes", 0); if (val < 0 || val > 0xffffffff) { syslog(LOG_ERR, - "<%s> number of route information improper", __FUNCTION__); + "<%s> number of route information improper", __func__); exit(1); } tmp->routes = val; @@ -458,7 +458,7 @@ getconfig(intface) if ((rti = malloc(sizeof(struct rtinfo))) == NULL) { syslog(LOG_ERR, "<%s> can't allocate enough memory", - __FUNCTION__); + __func__); exit(1); } memset(rti, 0, sizeof(*rti)); @@ -471,7 +471,7 @@ getconfig(intface) if (val < 0 || val > 128) { syslog(LOG_ERR, "<%s> prefixlen out of range", - __FUNCTION__); + __func__); exit(1); } rti->prefixlen = (int)val; @@ -481,7 +481,7 @@ getconfig(intface) rti->rtpref = val & ND_RA_FLAG_RTPREF_MASK; if (rti->rtpref == ND_RA_FLAG_RTPREF_RSV) { syslog(LOG_ERR, "<%s> invalid route preference", - __FUNCTION__); + __func__); exit(1); } @@ -496,7 +496,7 @@ getconfig(intface) if (val64 < 0 || val64 > 0xffffffff) { syslog(LOG_ERR, "<%s> rtrltime out of range", - __FUNCTION__); + __func__); exit(1); } rti->ltime = (u_int32_t)val64; @@ -507,13 +507,13 @@ getconfig(intface) syslog(LOG_ERR, "<%s> need %s as an route for " "interface %s", - __FUNCTION__, entbuf, intface); + __func__, entbuf, intface); exit(1); } if (inet_pton(AF_INET6, addr, &rti->prefix) != 1) { syslog(LOG_ERR, "<%s> inet_pton failed for %s", - __FUNCTION__, addr); + __func__, addr); exit(1); } #if 0 @@ -527,14 +527,14 @@ getconfig(intface) syslog(LOG_ERR, "<%s> multicast route (%s) must " "not be advertised (IF=%s)", - __FUNCTION__, addr, intface); + __func__, addr, intface); exit(1); } if (IN6_IS_ADDR_LINKLOCAL(&rti->prefix)) { syslog(LOG_NOTICE, "<%s> link-local route (%s) must " "not be advertised on %s", - __FUNCTION__, addr, intface); + __func__, addr, intface); exit(1); } #endif @@ -566,7 +566,7 @@ get_prefix(struct rainfo *rai) if (getifaddrs(&ifap) < 0) { syslog(LOG_ERR, "<%s> can't get interface addresses", - __FUNCTION__); + __func__); exit(1); } for (ifa = ifap; ifa; ifa = ifa->ifa_next) { @@ -587,7 +587,7 @@ get_prefix(struct rainfo *rai) if (plen < 0 || plen > 128) { syslog(LOG_ERR, "<%s> failed to get prefixlen " "or prefix is invalid", - __FUNCTION__); + __func__); exit(1); } if (find_prefix(rai, a, plen)) { @@ -599,7 +599,7 @@ get_prefix(struct rainfo *rai) if ((pp = malloc(sizeof(*pp))) == NULL) { syslog(LOG_ERR, "<%s> can't get allocate buffer for prefix", - __FUNCTION__); + __func__); exit(1); } memset(pp, 0, sizeof(*pp)); @@ -616,12 +616,12 @@ get_prefix(struct rainfo *rai) if (!inet_ntop(AF_INET6, &pp->prefix, ntopbuf, sizeof(ntopbuf))) { - syslog(LOG_ERR, "<%s> inet_ntop failed", __FUNCTION__); + syslog(LOG_ERR, "<%s> inet_ntop failed", __func__); exit(1); } syslog(LOG_DEBUG, "<%s> add %s/%d to prefix list on %s", - __FUNCTION__, ntopbuf, pp->prefixlen, rai->ifname); + __func__, ntopbuf, pp->prefixlen, rai->ifname); /* set other fields with protocol defaults */ pp->validlifetime = DEF_ADVVALIDLIFETIME; @@ -674,7 +674,7 @@ add_prefix(struct rainfo *rai, struct in6_prefixreq *ipr) if ((prefix = malloc(sizeof(*prefix))) == NULL) { syslog(LOG_ERR, "<%s> memory allocation failed", - __FUNCTION__); + __func__); return; /* XXX: error or exit? */ } memset(prefix, 0, sizeof(*prefix)); @@ -690,7 +690,7 @@ add_prefix(struct rainfo *rai, struct in6_prefixreq *ipr) prefix->rainfo = rai; syslog(LOG_DEBUG, "<%s> new prefix %s/%d was added on %s", - __FUNCTION__, inet_ntop(AF_INET6, &ipr->ipr_prefix.sin6_addr, + __func__, inet_ntop(AF_INET6, &ipr->ipr_prefix.sin6_addr, ntopbuf, INET6_ADDRSTRLEN), ipr->ipr_plen, rai->ifname); @@ -723,7 +723,7 @@ delete_prefix(struct prefix *prefix) remque(prefix); syslog(LOG_DEBUG, "<%s> prefix %s/%d was deleted on %s", - __FUNCTION__, inet_ntop(AF_INET6, &prefix->prefix, + __func__, inet_ntop(AF_INET6, &prefix->prefix, ntopbuf, INET6_ADDRSTRLEN), prefix->prefixlen, rai->ifname); if (prefix->timer) @@ -742,12 +742,12 @@ invalidate_prefix(struct prefix *prefix) if (prefix->timer) { /* sanity check */ syslog(LOG_ERR, "<%s> assumption failure: timer already exists", - __FUNCTION__); + __func__); exit(1); } syslog(LOG_DEBUG, "<%s> prefix %s/%d was invalidated on %s, " - "will expire in %ld seconds", __FUNCTION__, + "will expire in %ld seconds", __func__, inet_ntop(AF_INET6, &prefix->prefix, ntopbuf, INET6_ADDRSTRLEN), prefix->prefixlen, rai->ifname, (long)prefix_timo); @@ -755,7 +755,7 @@ invalidate_prefix(struct prefix *prefix) prefix->timer = rtadvd_add_timer(prefix_timeout, NULL, prefix, NULL); if (prefix->timer == NULL) { syslog(LOG_ERR, "<%s> failed to add a timer for a prefix. " - "remove the prefix", __FUNCTION__); + "remove the prefix", __func__); delete_prefix(prefix); } timo.tv_sec = prefix_timo; @@ -782,12 +782,12 @@ update_prefix(struct prefix * prefix) if (prefix->timer == NULL) { /* sanity check */ syslog(LOG_ERR, "<%s> assumption failure: timer does not exist", - __FUNCTION__); + __func__); exit(1); } syslog(LOG_DEBUG, "<%s> prefix %s/%d was re-enabled on %s", - __FUNCTION__, inet_ntop(AF_INET6, &prefix->prefix, ntopbuf, + __func__, inet_ntop(AF_INET6, &prefix->prefix, ntopbuf, INET6_ADDRSTRLEN), prefix->prefixlen, rai->ifname); /* stop the expiration timer */ @@ -806,13 +806,13 @@ init_prefix(struct in6_prefixreq *ipr) int s; if ((s = socket(AF_INET6, SOCK_DGRAM, 0)) < 0) { - syslog(LOG_ERR, "<%s> socket: %s", __FUNCTION__, + syslog(LOG_ERR, "<%s> socket: %s", __func__, strerror(errno)); exit(1); } if (ioctl(s, SIOCGIFPREFIX_IN6, (caddr_t)ipr) < 0) { - syslog(LOG_INFO, "<%s> ioctl:SIOCGIFPREFIX %s", __FUNCTION__, + syslog(LOG_INFO, "<%s> ioctl:SIOCGIFPREFIX %s", __func__, strerror(errno)); ipr->ipr_vltime = DEF_ADVVALIDLIFETIME; @@ -826,7 +826,7 @@ init_prefix(struct in6_prefixreq *ipr) syslog(LOG_WARNING, "<%s> Added prefix(%s)'s origin %d is" "lower than PR_ORIG_RR(router renumbering)." - "This should not happen if I am router", __FUNCTION__, + "This should not happen if I am router", __func__, inet_ntop(AF_INET6, &ipr->ipr_prefix.sin6_addr, ntopbuf, sizeof(ntopbuf)), ipr->ipr_origin); close(s); @@ -852,7 +852,7 @@ make_prefix(struct rainfo *rai, int ifindex, struct in6_addr *addr, int plen) memset(&ipr, 0, sizeof(ipr)); if (if_indextoname(ifindex, ipr.ipr_name) == NULL) { syslog(LOG_ERR, "<%s> Prefix added interface No.%d doesn't" - "exist. This should not happen! %s", __FUNCTION__, + "exist. This should not happen! %s", __func__, ifindex, strerror(errno)); exit(1); } @@ -890,7 +890,7 @@ make_packet(struct rainfo *rainfo) "<%s> link-layer address option has" " null length on %s." " Treat as not included.", - __FUNCTION__, rainfo->ifname); + __func__, rainfo->ifname); rainfo->advlinkopt = 0; } packlen += lladdroptlen; @@ -915,7 +915,7 @@ make_packet(struct rainfo *rainfo) if ((buf = malloc(packlen)) == NULL) { syslog(LOG_ERR, "<%s> can't get enough memory for an RA packet", - __FUNCTION__); + __func__); exit(1); } if (rainfo->ra_data) { @@ -1078,7 +1078,7 @@ getinet6sysctl(int code) if (sysctl(mib, sizeof(mib)/sizeof(mib[0]), &value, &size, NULL, 0) < 0) { syslog(LOG_ERR, "<%s>: failed to get ip6 sysctl(%d): %s", - __FUNCTION__, code, + __func__, code, strerror(errno)); return(-1); } diff --git a/usr.sbin/rtadvd/dump.c b/usr.sbin/rtadvd/dump.c index b896e7f7b7..58cd357c59 100644 --- a/usr.sbin/rtadvd/dump.c +++ b/usr.sbin/rtadvd/dump.c @@ -29,7 +29,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/usr.sbin/rtadvd/dump.c,v 1.1.2.3 2002/06/29 18:59:53 ume Exp $ - * $DragonFly: src/usr.sbin/rtadvd/dump.c,v 1.4 2004/02/10 02:59:43 rob Exp $ + * $DragonFly: src/usr.sbin/rtadvd/dump.c,v 1.5 2005/02/17 14:00:10 joerg Exp $ */ #include #include @@ -243,7 +243,7 @@ rtadvd_dump_file(dumpfile) { if ((fp = fopen(dumpfile, "w")) == NULL) { syslog(LOG_WARNING, "<%s> open a dump file(%s)", - __FUNCTION__, dumpfile); + __func__, dumpfile); return; } diff --git a/usr.sbin/rtadvd/if.c b/usr.sbin/rtadvd/if.c index 1705872d00..0266177544 100644 --- a/usr.sbin/rtadvd/if.c +++ b/usr.sbin/rtadvd/if.c @@ -29,7 +29,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/usr.sbin/rtadvd/if.c,v 1.2.2.3 2001/07/03 11:02:14 ume Exp $ - * $DragonFly: src/usr.sbin/rtadvd/if.c,v 1.4 2004/02/10 02:59:43 rob Exp $ + * $DragonFly: src/usr.sbin/rtadvd/if.c,v 1.5 2005/02/17 14:00:10 joerg Exp $ */ #include @@ -197,7 +197,7 @@ if_getflags(int ifindex, int oifflags) int s; if ((s = socket(AF_INET6, SOCK_DGRAM, 0)) < 0) { - syslog(LOG_ERR, "<%s> socket: %s", __FUNCTION__, + syslog(LOG_ERR, "<%s> socket: %s", __func__, strerror(errno)); return (oifflags & ~IFF_UP); } @@ -205,7 +205,7 @@ if_getflags(int ifindex, int oifflags) if_indextoname(ifindex, ifr.ifr_name); if (ioctl(s, SIOCGIFFLAGS, (caddr_t)&ifr) < 0) { syslog(LOG_ERR, "<%s> ioctl:SIOCGIFFLAGS: failed for %s", - __FUNCTION__, ifr.ifr_name); + __func__, ifr.ifr_name); close(s); return (oifflags & ~IFF_UP); } @@ -241,7 +241,7 @@ lladdropt_fill(struct sockaddr_dl *sdl, struct nd_opt_hdr *ndopt) default: syslog(LOG_ERR, "<%s> unsupported link type(%d)", - __FUNCTION__, sdl->sdl_type); + __func__, sdl->sdl_type); exit(1); } @@ -278,7 +278,7 @@ get_next_msg(char *buf, char *lim, int ifindex, size_t *lenp, int filter) /* just for safety */ if (!rtm->rtm_msglen) { syslog(LOG_WARNING, "<%s> rtm_msglen is 0 " - "(buf=%p lim=%p rtm=%p)", __FUNCTION__, + "(buf=%p lim=%p rtm=%p)", __func__, buf, lim, rtm); break; } @@ -497,16 +497,16 @@ get_iflist(char **buf, size_t *size) if (sysctl(mib, 6, NULL, size, NULL, 0) < 0) { syslog(LOG_ERR, "<%s> sysctl: iflist size get failed", - __FUNCTION__); + __func__); exit(1); } if ((*buf = malloc(*size)) == NULL) { - syslog(LOG_ERR, "<%s> malloc failed", __FUNCTION__); + syslog(LOG_ERR, "<%s> malloc failed", __func__); exit(1); } if (sysctl(mib, 6, *buf, size, NULL, 0) < 0) { syslog(LOG_ERR, "<%s> sysctl: iflist get failed", - __FUNCTION__); + __func__); exit(1); } return; @@ -532,7 +532,7 @@ parse_iflist(struct if_msghdr ***ifmlist_p, char *buf, size_t bufsize) /* roughly estimate max list size of pointers to each if_msghdr */ malloc_size = (bufsize/iflentry_size) * sizeof(size_t); if ((*ifmlist_p = (struct if_msghdr **)malloc(malloc_size)) == NULL) { - syslog(LOG_ERR, "<%s> malloc failed", __FUNCTION__); + syslog(LOG_ERR, "<%s> malloc failed", __func__); exit(1); } @@ -540,7 +540,7 @@ parse_iflist(struct if_msghdr ***ifmlist_p, char *buf, size_t bufsize) for (ifm = (struct if_msghdr *)buf; ifm < (struct if_msghdr *)lim;) { if (ifm->ifm_msglen == 0) { syslog(LOG_WARNING, "<%s> ifm_msglen is 0 " - "(buf=%p lim=%p ifm=%p)", __FUNCTION__, + "(buf=%p lim=%p ifm=%p)", __func__, buf, lim, ifm); return; } @@ -563,7 +563,7 @@ parse_iflist(struct if_msghdr ***ifmlist_p, char *buf, size_t bufsize) /* just for safety */ if (!ifam->ifam_msglen) { syslog(LOG_WARNING, "<%s> ifa_msglen is 0 " - "(buf=%p lim=%p ifam=%p)", __FUNCTION__, + "(buf=%p lim=%p ifam=%p)", __func__, buf, lim, ifam); return; } diff --git a/usr.sbin/rtadvd/rrenum.c b/usr.sbin/rtadvd/rrenum.c index 79796736af..6db9c7ab87 100644 --- a/usr.sbin/rtadvd/rrenum.c +++ b/usr.sbin/rtadvd/rrenum.c @@ -29,7 +29,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/usr.sbin/rtadvd/rrenum.c,v 1.2.2.2 2001/07/03 11:02:14 ume Exp $ - * $DragonFly: src/usr.sbin/rtadvd/rrenum.c,v 1.3 2004/02/10 02:59:43 rob Exp $ + * $DragonFly: src/usr.sbin/rtadvd/rrenum.c,v 1.4 2005/02/17 14:00:10 joerg Exp $ */ #include #include @@ -90,7 +90,7 @@ rr_pco_check(int len, struct rr_pco_match *rpm) if ((rpm->rpm_len - 3) < 0 || /* must be at least 3 */ (rpm->rpm_len - 3) & 0x3) { /* must be multiple of 4 */ syslog(LOG_WARNING, "<%s> rpm_len %d is not 4N * 3", - __FUNCTION__, rpm->rpm_len); + __func__, rpm->rpm_len); return 1; } /* rpm->rpm_code must be valid value */ @@ -100,14 +100,14 @@ rr_pco_check(int len, struct rr_pco_match *rpm) case RPM_PCO_SETGLOBAL: break; default: - syslog(LOG_WARNING, "<%s> unknown rpm_code %d", __FUNCTION__, + syslog(LOG_WARNING, "<%s> unknown rpm_code %d", __func__, rpm->rpm_code); return 1; } /* rpm->rpm_matchlen must be 0 to 128 inclusive */ if (rpm->rpm_matchlen > 128) { syslog(LOG_WARNING, "<%s> rpm_matchlen %d is over 128", - __FUNCTION__, rpm->rpm_matchlen); + __func__, rpm->rpm_matchlen); return 1; } @@ -131,7 +131,7 @@ rr_pco_check(int len, struct rr_pco_match *rpm) if (checklen > 128) { syslog(LOG_WARNING, "<%s> sum of rpu_uselen %d and" " rpu_keeplen %d is %d(over 128)", - __FUNCTION__, rpu->rpu_uselen, + __func__, rpu->rpu_uselen, rpu->rpu_keeplen, rpu->rpu_uselen + rpu->rpu_keeplen); return 1; @@ -167,7 +167,7 @@ do_use_prefix(int len, struct rr_pco_match *rpm, irr->irr_useprefix.sin6_addr = in6addr_any; if (ioctl(s, rrcmd2pco[rpm->rpm_code], (caddr_t)irr) < 0 && errno != EADDRNOTAVAIL) - syslog(LOG_ERR, "<%s> ioctl: %s", __FUNCTION__, + syslog(LOG_ERR, "<%s> ioctl: %s", __func__, strerror(errno)); return; } @@ -199,7 +199,7 @@ do_use_prefix(int len, struct rr_pco_match *rpm, if (ioctl(s, rrcmd2pco[rpm->rpm_code], (caddr_t)irr) < 0 && errno != EADDRNOTAVAIL) - syslog(LOG_ERR, "<%s> ioctl: %s", __FUNCTION__, + syslog(LOG_ERR, "<%s> ioctl: %s", __func__, strerror(errno)); /* very adhoc: should be rewritten */ @@ -252,7 +252,7 @@ do_pco(struct icmp6_router_renum *rr, int len, struct rr_pco_match *rpm) return 1; if (s == -1 && (s = socket(AF_INET6, SOCK_DGRAM, 0)) < 0) { - syslog(LOG_ERR, "<%s> socket: %s", __FUNCTION__, + syslog(LOG_ERR, "<%s> socket: %s", __func__, strerror(errno)); exit(1); } @@ -280,7 +280,7 @@ do_pco(struct icmp6_router_renum *rr, int len, struct rr_pco_match *rpm) if (errno == ENXIO) return 0; else if (errno) { - syslog(LOG_ERR, "<%s> if_indextoname: %s", __FUNCTION__, + syslog(LOG_ERR, "<%s> if_indextoname: %s", __func__, strerror(errno)); return 1; } @@ -312,7 +312,7 @@ do_rr(int len, struct icmp6_router_renum *rr) if (len < sizeof(struct rr_pco_match)) { tooshort: syslog(LOG_ERR, "<%s> pkt too short. left len = %d. " - "gabage at end of pkt?", __FUNCTION__, len); + "gabage at end of pkt?", __func__, len); return 1; } rpmlen = rpm->rpm_len << 3; @@ -320,7 +320,7 @@ do_rr(int len, struct icmp6_router_renum *rr) goto tooshort; if (do_pco(rr, rpmlen, rpm)) { - syslog(LOG_WARNING, "<%s> invalid PCO", __FUNCTION__); + syslog(LOG_WARNING, "<%s> invalid PCO", __func__); goto next; } @@ -347,7 +347,7 @@ rr_command_check(int len, struct icmp6_router_renum *rr, struct in6_addr *from, if (len < (sizeof(struct icmp6_router_renum) + sizeof(struct rr_pco_match))) { syslog(LOG_ERR, "<%s> rr_command len %d is too short", - __FUNCTION__, len); + __func__, len); return 1; } @@ -355,7 +355,7 @@ rr_command_check(int len, struct icmp6_router_renum *rr, struct in6_addr *from, if (IN6_IS_ADDR_MULTICAST(dst) && !IN6_IS_ADDR_MC_LINKLOCAL(dst) && !IN6_IS_ADDR_MC_SITELOCAL(dst)) { syslog(LOG_ERR, "<%s> dst mcast addr %s is illegal", - __FUNCTION__, + __func__, inet_ntop(AF_INET6, dst, ntopbuf, INET6_ADDRSTRLEN)); return 1; } @@ -364,7 +364,7 @@ rr_command_check(int len, struct icmp6_router_renum *rr, struct in6_addr *from, if (rro.rro_seqnum > rr->rr_seqnum) { syslog(LOG_WARNING, "<%s> rcvd old seqnum %d from %s", - __FUNCTION__, (u_int32_t)ntohl(rr->rr_seqnum), + __func__, (u_int32_t)ntohl(rr->rr_seqnum), inet_ntop(AF_INET6, from, ntopbuf, INET6_ADDRSTRLEN)); return 1; } @@ -374,7 +374,7 @@ rr_command_check(int len, struct icmp6_router_renum *rr, struct in6_addr *from, if ((rr->rr_flags & ICMP6_RR_FLAGS_REQRESULT) != 0) syslog(LOG_WARNING, "<%s> rcvd duped segnum %d from %s", - __FUNCTION__, rr->rr_segnum, + __func__, rr->rr_segnum, inet_ntop(AF_INET6, from, ntopbuf, INET6_ADDRSTRLEN)); return 0; @@ -415,7 +415,7 @@ rr_command_input(int len, struct icmp6_router_renum *rr, return; failed: - syslog(LOG_ERR, "<%s> received RR was invalid", __FUNCTION__); + syslog(LOG_ERR, "<%s> received RR was invalid", __func__); return; } @@ -427,7 +427,7 @@ rr_input(int len, struct icmp6_router_renum *rr, struct in6_pktinfo *pi, syslog(LOG_DEBUG, "<%s> RR received from %s to %s on %s", - __FUNCTION__, + __func__, inet_ntop(AF_INET6, &from->sin6_addr, ntopbuf[0], INET6_ADDRSTRLEN), inet_ntop(AF_INET6, &dst, ntopbuf[1], INET6_ADDRSTRLEN), @@ -437,7 +437,7 @@ rr_input(int len, struct icmp6_router_renum *rr, struct in6_pktinfo *pi, if (len < sizeof(struct icmp6_router_renum)) { syslog(LOG_NOTICE, "<%s>: RR short message (size %d) from %s to %s on %s", - __FUNCTION__, len, + __func__, len, inet_ntop(AF_INET6, &from->sin6_addr, ntopbuf[0], INET6_ADDRSTRLEN), inet_ntop(AF_INET6, &dst, ntopbuf[1], INET6_ADDRSTRLEN), @@ -458,7 +458,7 @@ rr_input(int len, struct icmp6_router_renum *rr, struct in6_pktinfo *pi, syslog(LOG_NOTICE, "<%s>: RR message with invalid destination (%s) " "from %s on %s", - __FUNCTION__, + __func__, inet_ntop(AF_INET6, &dst, ntopbuf[0], INET6_ADDRSTRLEN), inet_ntop(AF_INET6, &from->sin6_addr, ntopbuf[1], INET6_ADDRSTRLEN), @@ -481,7 +481,7 @@ rr_input(int len, struct icmp6_router_renum *rr, struct in6_pktinfo *pi, break; default: syslog(LOG_ERR, "<%s> received unknown code %d", - __FUNCTION__, rr->rr_code); + __func__, rr->rr_code); break; } diff --git a/usr.sbin/rtadvd/rtadvd.c b/usr.sbin/rtadvd/rtadvd.c index 17fa7cad71..83c040f783 100644 --- a/usr.sbin/rtadvd/rtadvd.c +++ b/usr.sbin/rtadvd/rtadvd.c @@ -29,7 +29,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/usr.sbin/rtadvd/rtadvd.c,v 1.3.2.4 2003/04/05 10:31:58 ume Exp $ - * $DragonFly: src/usr.sbin/rtadvd/rtadvd.c,v 1.4 2004/12/18 22:48:14 swildner Exp $ + * $DragonFly: src/usr.sbin/rtadvd/rtadvd.c,v 1.5 2005/02/17 14:00:10 joerg Exp $ */ #include @@ -245,7 +245,7 @@ main(argc, argv) if ((pidfp = fopen(pidfilename, "w")) == NULL) { syslog(LOG_ERR, "<%s> failed to open a log file(%s), run anyway.", - __FUNCTION__, pidfilename); + __func__, pidfilename); } else { fprintf(pidfp, "%d\n", pid); fclose(pidfp); @@ -284,13 +284,13 @@ main(argc, argv) if (timeout != NULL) { syslog(LOG_DEBUG, "<%s> set timer to %ld:%ld. waiting for " - "inputs or timeout", __FUNCTION__, + "inputs or timeout", __func__, (long int)timeout->tv_sec, (long int)timeout->tv_usec); } else { syslog(LOG_DEBUG, "<%s> there's no timer. waiting for inputs", - __FUNCTION__); + __func__); } if ((i = select(maxfd + 1, &select_fd, @@ -298,7 +298,7 @@ main(argc, argv) /* EINTR would occur upon SIGUSR1 for status dump */ if (errno != EINTR) syslog(LOG_ERR, "<%s> select: %s", - __FUNCTION__, strerror(errno)); + __func__, strerror(errno)); continue; } if (i == 0) /* timeout */ @@ -333,7 +333,7 @@ die() if (dflag > 1) { syslog(LOG_DEBUG, "<%s> cease to be an advertising router\n", - __FUNCTION__); + __func__); } for (ra = ralist; ra; ra = ra->next) { @@ -364,7 +364,7 @@ rtmsg_input() n = read(rtsock, msg, sizeof(msg)); if (dflag > 1) { syslog(LOG_DEBUG, "<%s> received a routing message " - "(type = %d, len = %d)", __FUNCTION__, rtmsg_type(msg), n); + "(type = %d, len = %d)", __func__, rtmsg_type(msg), n); } if (n > rtmsg_len(msg)) { /* @@ -376,7 +376,7 @@ rtmsg_input() "<%s> received data length is larger than " "1st routing message len. multiple messages? " "read %d bytes, but 1st msg len = %d", - __FUNCTION__, n, rtmsg_len(msg)); + __func__, n, rtmsg_len(msg)); #if 0 /* adjust length */ n = rtmsg_len(msg); @@ -413,7 +413,7 @@ rtmsg_input() if (dflag > 1) { syslog(LOG_DEBUG, "<%s:%d> unknown rtmsg %d on %s", - __FUNCTION__, __LINE__, type, + __func__, __LINE__, type, if_indextoname(ifindex, ifname)); } continue; @@ -424,7 +424,7 @@ rtmsg_input() syslog(LOG_DEBUG, "<%s> route changed on " "non advertising interface(%s)", - __FUNCTION__, + __func__, if_indextoname(ifindex, ifname)); } continue; @@ -447,7 +447,7 @@ rtmsg_input() if (plen < 4 || plen > 127) { syslog(LOG_INFO, "<%s> new interface route's" "plen %d is invalid for a prefix", - __FUNCTION__, plen); + __func__, plen); break; } prefix = find_prefix(rai, addr, plen); @@ -463,7 +463,7 @@ rtmsg_input() "<%s> new prefix(%s/%d) " "added on %s, " "but it was already in list", - __FUNCTION__, + __func__, inet_ntop(AF_INET6, addr, (char *)addrbuf, INET6_ADDRSTRLEN), plen, rai->ifname); @@ -488,7 +488,7 @@ rtmsg_input() syslog(LOG_INFO, "<%s> deleted interface route's " "plen %d is invalid for a prefix", - __FUNCTION__, plen); + __func__, plen); break; } prefix = find_prefix(rai, addr, plen); @@ -498,7 +498,7 @@ rtmsg_input() "<%s> prefix(%s/%d) was " "deleted on %s, " "but it was not in list", - __FUNCTION__, + __func__, inet_ntop(AF_INET6, addr, (char *)addrbuf, INET6_ADDRSTRLEN), plen, rai->ifname); @@ -521,7 +521,7 @@ rtmsg_input() if (dflag > 1) { syslog(LOG_DEBUG, "<%s:%d> unknown rtmsg %d on %s", - __FUNCTION__, __LINE__, type, + __func__, __LINE__, type, if_indextoname(ifindex, ifname)); } return; @@ -532,13 +532,13 @@ rtmsg_input() (iflist[ifindex]->ifm_flags & IFF_UP) == 0) { syslog(LOG_INFO, "<%s> interface %s becomes down. stop timer.", - __FUNCTION__, rai->ifname); + __func__, rai->ifname); rtadvd_remove_timer(&rai->timer); } else if ((oldifflags & IFF_UP) == 0 && /* DOWN to UP */ (iflist[ifindex]->ifm_flags & IFF_UP) != 0) { syslog(LOG_INFO, "<%s> interface %s becomes up. restart timer.", - __FUNCTION__, rai->ifname); + __func__, rai->ifname); rai->initcounter = 0; /* reset the counter */ rai->waiting = 0; /* XXX */ @@ -595,13 +595,13 @@ rtadvd_input() if (ifindex == 0) { syslog(LOG_ERR, "<%s> failed to get receiving interface", - __FUNCTION__); + __func__); return; } if (hlimp == NULL) { syslog(LOG_ERR, "<%s> failed to get receiving hop limit", - __FUNCTION__); + __func__); return; } @@ -612,7 +612,7 @@ rtadvd_input() if ((iflist[pi->ipi6_ifindex]->ifm_flags & IFF_UP) == 0) { syslog(LOG_INFO, "<%s> received data on a disabled interface (%s)", - __FUNCTION__, + __func__, if_indextoname(pi->ipi6_ifindex, ifnamebuf)); return; } @@ -621,7 +621,7 @@ rtadvd_input() if (i < sizeof(struct ip6_hdr) + sizeof(struct icmp6_hdr)) { syslog(LOG_ERR, "<%s> packet size(%d) is too short", - __FUNCTION__, i); + __func__, i); return; } @@ -631,7 +631,7 @@ rtadvd_input() if (i < sizeof(struct icmp6_hdr)) { syslog(LOG_ERR, "<%s> packet size(%d) is too short", - __FUNCTION__, i); + __func__, i); return; } @@ -649,7 +649,7 @@ rtadvd_input() syslog(LOG_NOTICE, "<%s> RS with invalid hop limit(%d) " "received from %s on %s", - __FUNCTION__, *hlimp, + __func__, *hlimp, inet_ntop(AF_INET6, &from.sin6_addr, ntopbuf, INET6_ADDRSTRLEN), if_indextoname(pi->ipi6_ifindex, ifnamebuf)); @@ -659,7 +659,7 @@ rtadvd_input() syslog(LOG_NOTICE, "<%s> RS with invalid ICMP6 code(%d) " "received from %s on %s", - __FUNCTION__, icp->icmp6_code, + __func__, icp->icmp6_code, inet_ntop(AF_INET6, &from.sin6_addr, ntopbuf, INET6_ADDRSTRLEN), if_indextoname(pi->ipi6_ifindex, ifnamebuf)); @@ -669,7 +669,7 @@ rtadvd_input() syslog(LOG_NOTICE, "<%s> RS from %s on %s does not have enough " "length (len = %d)", - __FUNCTION__, + __func__, inet_ntop(AF_INET6, &from.sin6_addr, ntopbuf, INET6_ADDRSTRLEN), if_indextoname(pi->ipi6_ifindex, ifnamebuf), i); @@ -686,7 +686,7 @@ rtadvd_input() syslog(LOG_NOTICE, "<%s> RA with invalid hop limit(%d) " "received from %s on %s", - __FUNCTION__, *hlimp, + __func__, *hlimp, inet_ntop(AF_INET6, &from.sin6_addr, ntopbuf, INET6_ADDRSTRLEN), if_indextoname(pi->ipi6_ifindex, ifnamebuf)); @@ -696,7 +696,7 @@ rtadvd_input() syslog(LOG_NOTICE, "<%s> RA with invalid ICMP6 code(%d) " "received from %s on %s", - __FUNCTION__, icp->icmp6_code, + __func__, icp->icmp6_code, inet_ntop(AF_INET6, &from.sin6_addr, ntopbuf, INET6_ADDRSTRLEN), if_indextoname(pi->ipi6_ifindex, ifnamebuf)); @@ -706,7 +706,7 @@ rtadvd_input() syslog(LOG_NOTICE, "<%s> RA from %s on %s does not have enough " "length (len = %d)", - __FUNCTION__, + __func__, inet_ntop(AF_INET6, &from.sin6_addr, ntopbuf, INET6_ADDRSTRLEN), if_indextoname(pi->ipi6_ifindex, ifnamebuf), i); @@ -718,7 +718,7 @@ rtadvd_input() if (accept_rr == 0) { syslog(LOG_ERR, "<%s> received a router renumbering " "message, but not allowed to be accepted", - __FUNCTION__); + __func__); break; } rr_input(i, (struct icmp6_router_renum *)icp, pi, &from, @@ -732,7 +732,7 @@ rtadvd_input() * before setting ICMP6 type filter(see sock_open()). */ syslog(LOG_ERR, "<%s> invalid icmp type(%d)", - __FUNCTION__, icp->icmp6_type); + __func__, icp->icmp6_type); return; } @@ -749,7 +749,7 @@ rs_input(int len, struct nd_router_solicit *rs, syslog(LOG_DEBUG, "<%s> RS received from %s on %s", - __FUNCTION__, + __func__, inet_ntop(AF_INET6, &from->sin6_addr, ntopbuf, INET6_ADDRSTRLEN), if_indextoname(pi->ipi6_ifindex, ifnamebuf)); @@ -761,7 +761,7 @@ rs_input(int len, struct nd_router_solicit *rs, &ndopts, NDOPT_FLAG_SRCLINKADDR)) { syslog(LOG_DEBUG, "<%s> ND option check failed for an RS from %s on %s", - __FUNCTION__, + __func__, inet_ntop(AF_INET6, &from->sin6_addr, ntopbuf, INET6_ADDRSTRLEN), if_indextoname(pi->ipi6_ifindex, ifnamebuf)); @@ -778,7 +778,7 @@ rs_input(int len, struct nd_router_solicit *rs, syslog(LOG_ERR, "<%s> RS from unspecified src on %s has a link-layer" " address option", - __FUNCTION__, + __func__, if_indextoname(pi->ipi6_ifindex, ifnamebuf)); goto done; } @@ -792,7 +792,7 @@ rs_input(int len, struct nd_router_solicit *rs, if (ra == NULL) { syslog(LOG_INFO, "<%s> RS received on non advertising interface(%s)", - __FUNCTION__, + __func__, if_indextoname(pi->ipi6_ifindex, ifnamebuf)); goto done; } @@ -842,7 +842,7 @@ rs_input(int len, struct nd_router_solicit *rs, syslog(LOG_DEBUG, "<%s> random delay is larger than " "the rest of normal timer", - __FUNCTION__); + __func__); interval = *rest; } @@ -883,7 +883,7 @@ ra_input(int len, struct nd_router_advert *ra, syslog(LOG_DEBUG, "<%s> RA received from %s on %s", - __FUNCTION__, + __func__, inet_ntop(AF_INET6, &from->sin6_addr, ntopbuf, INET6_ADDRSTRLEN), if_indextoname(pi->ipi6_ifindex, ifnamebuf)); @@ -896,7 +896,7 @@ ra_input(int len, struct nd_router_advert *ra, NDOPT_FLAG_PREFIXINFO | NDOPT_FLAG_MTU)) { syslog(LOG_ERR, "<%s> ND option check failed for an RA from %s on %s", - __FUNCTION__, + __func__, inet_ntop(AF_INET6, &from->sin6_addr, ntopbuf, INET6_ADDRSTRLEN), if_indextoname(pi->ipi6_ifindex, ifnamebuf)); @@ -910,7 +910,7 @@ ra_input(int len, struct nd_router_advert *ra, syslog(LOG_INFO, "<%s> received RA from %s on non-advertising" " interface(%s)", - __FUNCTION__, + __func__, inet_ntop(AF_INET6, &from->sin6_addr, ntopbuf, INET6_ADDRSTRLEN), if_indextoname(pi->ipi6_ifindex, ifnamebuf)); @@ -924,7 +924,7 @@ ra_input(int len, struct nd_router_advert *ra, syslog(LOG_INFO, "<%s> CurHopLimit inconsistent on %s:" " %d from %s, %d from us", - __FUNCTION__, + __func__, rai->ifname, ra->nd_ra_curhoplimit, inet_ntop(AF_INET6, &from->sin6_addr, @@ -938,7 +938,7 @@ ra_input(int len, struct nd_router_advert *ra, syslog(LOG_INFO, "<%s> M flag inconsistent on %s:" " %s from %s, %s from us", - __FUNCTION__, + __func__, rai->ifname, on_off[!rai->managedflg], inet_ntop(AF_INET6, &from->sin6_addr, @@ -952,7 +952,7 @@ ra_input(int len, struct nd_router_advert *ra, syslog(LOG_INFO, "<%s> O flag inconsistent on %s:" " %s from %s, %s from us", - __FUNCTION__, + __func__, rai->ifname, on_off[!rai->otherflg], inet_ntop(AF_INET6, &from->sin6_addr, @@ -967,7 +967,7 @@ ra_input(int len, struct nd_router_advert *ra, syslog(LOG_INFO, "<%s> ReachableTime inconsistent on %s:" " %d from %s, %d from us", - __FUNCTION__, + __func__, rai->ifname, reachabletime, inet_ntop(AF_INET6, &from->sin6_addr, @@ -982,7 +982,7 @@ ra_input(int len, struct nd_router_advert *ra, syslog(LOG_INFO, "<%s> RetranceTimer inconsistent on %s:" " %d from %s, %d from us", - __FUNCTION__, + __func__, rai->ifname, retranstimer, inet_ntop(AF_INET6, &from->sin6_addr, @@ -997,7 +997,7 @@ ra_input(int len, struct nd_router_advert *ra, syslog(LOG_INFO, "<%s> MTU option value inconsistent on %s:" " %d from %s, %d from us", - __FUNCTION__, + __func__, rai->ifname, mtu, inet_ntop(AF_INET6, &from->sin6_addr, ntopbuf, INET6_ADDRSTRLEN), @@ -1052,7 +1052,7 @@ prefix_check(struct nd_opt_prefix_info *pinfo, syslog(LOG_INFO, "<%s> link-local prefix %s/%d is advertised " "from %s on %s", - __FUNCTION__, + __func__, inet_ntop(AF_INET6, &pinfo->nd_opt_pi_prefix, prefixbuf, INET6_ADDRSTRLEN), pinfo->nd_opt_pi_prefix_len, @@ -1065,7 +1065,7 @@ prefix_check(struct nd_opt_prefix_info *pinfo, pinfo->nd_opt_pi_prefix_len)) == NULL) { syslog(LOG_INFO, "<%s> prefix %s/%d from %s on %s is not in our list", - __FUNCTION__, + __func__, inet_ntop(AF_INET6, &pinfo->nd_opt_pi_prefix, prefixbuf, INET6_ADDRSTRLEN), pinfo->nd_opt_pi_prefix_len, @@ -1093,7 +1093,7 @@ prefix_check(struct nd_opt_prefix_info *pinfo, "<%s> prefeerred lifetime for %s/%d" " (decr. in real time) inconsistent on %s:" " %d from %s, %ld from us", - __FUNCTION__, + __func__, inet_ntop(AF_INET6, &pinfo->nd_opt_pi_prefix, prefixbuf, INET6_ADDRSTRLEN), pinfo->nd_opt_pi_prefix_len, @@ -1108,7 +1108,7 @@ prefix_check(struct nd_opt_prefix_info *pinfo, "<%s> prefeerred lifetime for %s/%d" " inconsistent on %s:" " %d from %s, %d from us", - __FUNCTION__, + __func__, inet_ntop(AF_INET6, &pinfo->nd_opt_pi_prefix, prefixbuf, INET6_ADDRSTRLEN), pinfo->nd_opt_pi_prefix_len, @@ -1129,7 +1129,7 @@ prefix_check(struct nd_opt_prefix_info *pinfo, "<%s> valid lifetime for %s/%d" " (decr. in real time) inconsistent on %s:" " %d from %s, %ld from us", - __FUNCTION__, + __func__, inet_ntop(AF_INET6, &pinfo->nd_opt_pi_prefix, prefixbuf, INET6_ADDRSTRLEN), pinfo->nd_opt_pi_prefix_len, @@ -1144,7 +1144,7 @@ prefix_check(struct nd_opt_prefix_info *pinfo, "<%s> valid lifetime for %s/%d" " inconsistent on %s:" " %d from %s, %d from us", - __FUNCTION__, + __func__, inet_ntop(AF_INET6, &pinfo->nd_opt_pi_prefix, prefixbuf, INET6_ADDRSTRLEN), pinfo->nd_opt_pi_prefix_len, @@ -1207,7 +1207,7 @@ nd6_options(struct nd_opt_hdr *hdr, int limit, for (; limit > 0; limit -= optlen) { if (limit < sizeof(struct nd_opt_hdr)) { - syslog(LOG_INFO, "<%s> short option header", __FUNCTION__); + syslog(LOG_INFO, "<%s> short option header", __func__); goto bad; } @@ -1215,26 +1215,26 @@ nd6_options(struct nd_opt_hdr *hdr, int limit, if (hdr->nd_opt_len == 0) { syslog(LOG_INFO, "<%s> bad ND option length(0) (type = %d)", - __FUNCTION__, hdr->nd_opt_type); + __func__, hdr->nd_opt_type); goto bad; } optlen = hdr->nd_opt_len << 3; if (optlen > limit) { - syslog(LOG_INFO, "<%s> short option", __FUNCTION__); + syslog(LOG_INFO, "<%s> short option", __func__); goto bad; } if (hdr->nd_opt_type > ND_OPT_MTU) { syslog(LOG_INFO, "<%s> unknown ND option(type %d)", - __FUNCTION__, hdr->nd_opt_type); + __func__, hdr->nd_opt_type); continue; } if ((ndopt_flags[hdr->nd_opt_type] & optflags) == 0) { syslog(LOG_INFO, "<%s> unexpected ND option(type %d)", - __FUNCTION__, hdr->nd_opt_type); + __func__, hdr->nd_opt_type); continue; } @@ -1247,7 +1247,7 @@ nd6_options(struct nd_opt_hdr *hdr, int limit, ((hdr->nd_opt_type == ND_OPT_PREFIX_INFORMATION && optlen != sizeof(struct nd_opt_prefix_info)))) { syslog(LOG_INFO, "<%s> invalid option length", - __FUNCTION__); + __func__); continue; } @@ -1260,7 +1260,7 @@ nd6_options(struct nd_opt_hdr *hdr, int limit, if (ndopts->nd_opt_array[hdr->nd_opt_type]) { syslog(LOG_INFO, "<%s> duplicated ND option (type = %d)", - __FUNCTION__, hdr->nd_opt_type); + __func__, hdr->nd_opt_type); } ndopts->nd_opt_array[hdr->nd_opt_type] = hdr; break; @@ -1275,7 +1275,7 @@ nd6_options(struct nd_opt_hdr *hdr, int limit, } if ((pfxlist = malloc(sizeof(*pfxlist))) == NULL) { syslog(LOG_ERR, "<%s> can't allocate memory", - __FUNCTION__); + __func__); goto bad; } pfxlist->next = ndopts->nd_opts_list; @@ -1323,7 +1323,7 @@ sock_open() CMSG_SPACE(sizeof(int)); rcvcmsgbuf = (u_char *)malloc(rcvcmsgbuflen); if (rcvcmsgbuf == NULL) { - syslog(LOG_ERR, "<%s> not enough core", __FUNCTION__); + syslog(LOG_ERR, "<%s> not enough core", __func__); exit(1); } @@ -1331,12 +1331,12 @@ sock_open() CMSG_SPACE(sizeof(int)); sndcmsgbuf = (u_char *)malloc(sndcmsgbuflen); if (sndcmsgbuf == NULL) { - syslog(LOG_ERR, "<%s> not enough core", __FUNCTION__); + syslog(LOG_ERR, "<%s> not enough core", __func__); exit(1); } if ((sock = socket(AF_INET6, SOCK_RAW, IPPROTO_ICMPV6)) < 0) { - syslog(LOG_ERR, "<%s> socket: %s", __FUNCTION__, + syslog(LOG_ERR, "<%s> socket: %s", __func__, strerror(errno)); exit(1); } @@ -1347,14 +1347,14 @@ sock_open() if (setsockopt(sock, IPPROTO_IPV6, IPV6_RECVPKTINFO, &on, sizeof(on)) < 0) { syslog(LOG_ERR, "<%s> IPV6_RECVPKTINFO: %s", - __FUNCTION__, strerror(errno)); + __func__, strerror(errno)); exit(1); } #else /* old adv. API */ if (setsockopt(sock, IPPROTO_IPV6, IPV6_PKTINFO, &on, sizeof(on)) < 0) { syslog(LOG_ERR, "<%s> IPV6_PKTINFO: %s", - __FUNCTION__, strerror(errno)); + __func__, strerror(errno)); exit(1); } #endif @@ -1365,14 +1365,14 @@ sock_open() if (setsockopt(sock, IPPROTO_IPV6, IPV6_RECVHOPLIMIT, &on, sizeof(on)) < 0) { syslog(LOG_ERR, "<%s> IPV6_RECVHOPLIMIT: %s", - __FUNCTION__, strerror(errno)); + __func__, strerror(errno)); exit(1); } #else /* old adv. API */ if (setsockopt(sock, IPPROTO_IPV6, IPV6_HOPLIMIT, &on, sizeof(on)) < 0) { syslog(LOG_ERR, "<%s> IPV6_HOPLIMIT: %s", - __FUNCTION__, strerror(errno)); + __func__, strerror(errno)); exit(1); } #endif @@ -1385,7 +1385,7 @@ sock_open() if (setsockopt(sock, IPPROTO_ICMPV6, ICMP6_FILTER, &filt, sizeof(filt)) < 0) { syslog(LOG_ERR, "<%s> IICMP6_FILTER: %s", - __FUNCTION__, strerror(errno)); + __func__, strerror(errno)); exit(1); } @@ -1396,7 +1396,7 @@ sock_open() &mreq.ipv6mr_multiaddr.s6_addr) != 1) { syslog(LOG_ERR, "<%s> inet_pton failed(library bug?)", - __FUNCTION__); + __func__); exit(1); } while (ra) { @@ -1404,7 +1404,7 @@ sock_open() if (setsockopt(sock, IPPROTO_IPV6, IPV6_JOIN_GROUP, &mreq, sizeof(mreq)) < 0) { syslog(LOG_ERR, "<%s> IPV6_JOIN_GROUP(link) on %s: %s", - __FUNCTION__, ra->ifname, strerror(errno)); + __func__, ra->ifname, strerror(errno)); exit(1); } ra = ra->next; @@ -1418,7 +1418,7 @@ sock_open() if (inet_pton(AF_INET6, ALLROUTERS_SITE, &in6a_site_allrouters) != 1) { syslog(LOG_ERR, "<%s> inet_pton failed(library bug?)", - __FUNCTION__); + __func__); exit(1); } mreq.ipv6mr_multiaddr = in6a_site_allrouters; @@ -1427,7 +1427,7 @@ sock_open() == 0) { syslog(LOG_ERR, "<%s> invalid interface: %s", - __FUNCTION__, mcastif); + __func__, mcastif); exit(1); } } else @@ -1436,7 +1436,7 @@ sock_open() &mreq, sizeof(mreq)) < 0) { syslog(LOG_ERR, "<%s> IPV6_JOIN_GROUP(site) on %s: %s", - __FUNCTION__, + __func__, mcastif ? mcastif : ralist->ifname, strerror(errno)); exit(1); @@ -1469,7 +1469,7 @@ rtsock_open() { if ((rtsock = socket(PF_ROUTE, SOCK_RAW, 0)) < 0) { syslog(LOG_ERR, - "<%s> socket: %s", __FUNCTION__, strerror(errno)); + "<%s> socket: %s", __func__, strerror(errno)); exit(1); } } @@ -1498,7 +1498,7 @@ struct rainfo *rainfo; if ((iflist[rainfo->ifindex]->ifm_flags & IFF_UP) == 0) { syslog(LOG_DEBUG, "<%s> %s is not up, skip sending RA", - __FUNCTION__, rainfo->ifname); + __func__, rainfo->ifname); return; } @@ -1530,14 +1530,14 @@ struct rainfo *rainfo; syslog(LOG_DEBUG, "<%s> send RA on %s, # of waitings = %d", - __FUNCTION__, rainfo->ifname, rainfo->waiting); + __func__, rainfo->ifname, rainfo->waiting); i = sendmsg(sock, &sndmhdr, 0); if (i < 0 || i != rainfo->ra_datalen) { if (i < 0) { syslog(LOG_ERR, "<%s> sendmsg on %s: %s", - __FUNCTION__, rainfo->ifname, + __func__, rainfo->ifname, strerror(errno)); } } @@ -1557,7 +1557,7 @@ struct rainfo *rainfo; if (i < 0) { syslog(LOG_ERR, "<%s> unicast sendmsg on %s: %s", - __FUNCTION__, rainfo->ifname, + __func__, rainfo->ifname, strerror(errno)); } } @@ -1592,7 +1592,7 @@ ra_timeout(void *data) syslog(LOG_DEBUG, "<%s> RA timer on %s is expired", - __FUNCTION__, rai->ifname); + __func__, rai->ifname); ra_output(rai); @@ -1631,7 +1631,7 @@ ra_timer_update(void *data, struct timeval *tm) syslog(LOG_DEBUG, "<%s> RA timer on %s is set to %ld:%ld", - __FUNCTION__, rai->ifname, + __func__, rai->ifname, (long int)tm->tv_sec, (long int)tm->tv_usec); return; diff --git a/usr.sbin/rtadvd/timer.c b/usr.sbin/rtadvd/timer.c index d0335b34db..a0672cadbe 100644 --- a/usr.sbin/rtadvd/timer.c +++ b/usr.sbin/rtadvd/timer.c @@ -29,7 +29,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/usr.sbin/rtadvd/timer.c,v 1.1.2.3 2002/06/29 18:59:53 ume Exp $ - * $DragonFly: src/usr.sbin/rtadvd/timer.c,v 1.3 2003/11/03 19:31:42 eirikn Exp $ + * $DragonFly: src/usr.sbin/rtadvd/timer.c,v 1.4 2005/02/17 14:00:10 joerg Exp $ */ #include @@ -69,7 +69,7 @@ rtadvd_add_timer(struct rtadvd_timer *(*timeout)(void *), if ((newtimer = malloc(sizeof(*newtimer))) == NULL) { syslog(LOG_ERR, - "<%s> can't allocate memory", __FUNCTION__); + "<%s> can't allocate memory", __func__); exit(1); } @@ -77,7 +77,7 @@ rtadvd_add_timer(struct rtadvd_timer *(*timeout)(void *), if (timeout == NULL) { syslog(LOG_ERR, - "<%s> timeout function unspecfied", __FUNCTION__); + "<%s> timeout function unspecfied", __func__); exit(1); } newtimer->expire = timeout; @@ -170,7 +170,7 @@ rtadvd_timer_rest(struct rtadvd_timer *timer) if (TIMEVAL_LEQ(timer->tm, now)) { syslog(LOG_DEBUG, "<%s> a timer must be expired, but not yet", - __FUNCTION__); + __func__); returnval.tv_sec = returnval.tv_usec = 0; } else diff --git a/usr.sbin/rtsold/dump.c b/usr.sbin/rtsold/dump.c index 59e601ac29..804501e326 100644 --- a/usr.sbin/rtsold/dump.c +++ b/usr.sbin/rtsold/dump.c @@ -29,7 +29,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/usr.sbin/rtsold/dump.c,v 1.1.2.3 2001/07/03 11:02:16 ume Exp $ - * $DragonFly: src/usr.sbin/rtsold/dump.c,v 1.4 2005/02/15 00:26:00 cpressey Exp $ + * $DragonFly: src/usr.sbin/rtsold/dump.c,v 1.5 2005/02/17 14:00:10 joerg Exp $ */ #include @@ -100,7 +100,7 @@ void rtsold_dump_file(const char *dumpfile) { if ((fp = fopen(dumpfile, "w")) == NULL) { - warnmsg(LOG_WARNING, __FUNCTION__, "open a dump file(%s): %s", + warnmsg(LOG_WARNING, __func__, "open a dump file(%s): %s", dumpfile, strerror(errno)); return; } diff --git a/usr.sbin/rtsold/if.c b/usr.sbin/rtsold/if.c index b435661663..8334528939 100644 --- a/usr.sbin/rtsold/if.c +++ b/usr.sbin/rtsold/if.c @@ -29,7 +29,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/usr.sbin/rtsold/if.c,v 1.2.2.3 2001/07/03 11:02:16 ume Exp $ - * $DragonFly: src/usr.sbin/rtsold/if.c,v 1.4 2004/02/04 00:52:55 rob Exp $ + * $DragonFly: src/usr.sbin/rtsold/if.c,v 1.5 2005/02/17 14:00:10 joerg Exp $ */ #include @@ -102,40 +102,40 @@ interface_up(char *name) strncpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); if (ioctl(ifsock, SIOCGIFFLAGS, (caddr_t)&ifr) < 0) { - warnmsg(LOG_WARNING, __FUNCTION__, "ioctl(SIOCGIFFLAGS): %s", + warnmsg(LOG_WARNING, __func__, "ioctl(SIOCGIFFLAGS): %s", strerror(errno)); return(-1); } if (!(ifr.ifr_flags & IFF_UP)) { ifr.ifr_flags |= IFF_UP; if (ioctl(ifsock, SIOCSIFFLAGS, (caddr_t)&ifr) < 0) { - warnmsg(LOG_ERR, __FUNCTION__, + warnmsg(LOG_ERR, __func__, "ioctl(SIOCSIFFLAGS): %s", strerror(errno)); } return(-1); } - warnmsg(LOG_DEBUG, __FUNCTION__, "checking if %s is ready...", name); + warnmsg(LOG_DEBUG, __func__, "checking if %s is ready...", name); llflag = get_llflag(name); if (llflag < 0) { - warnmsg(LOG_WARNING, __FUNCTION__, + warnmsg(LOG_WARNING, __func__, "get_llflag() failed, anyway I'll try"); return 0; } if (!(llflag & IN6_IFF_NOTREADY)) { - warnmsg(LOG_DEBUG, __FUNCTION__, + warnmsg(LOG_DEBUG, __func__, "%s is ready", name); return(0); } else { if (llflag & IN6_IFF_TENTATIVE) { - warnmsg(LOG_DEBUG, __FUNCTION__, "%s is tentative", + warnmsg(LOG_DEBUG, __func__, "%s is tentative", name); return IFS_TENTATIVE; } if (llflag & IN6_IFF_DUPLICATED) - warnmsg(LOG_DEBUG, __FUNCTION__, "%s is duplicated", + warnmsg(LOG_DEBUG, __func__, "%s is duplicated", name); return -1; } @@ -152,7 +152,7 @@ interface_status(struct ifinfo *ifinfo) memset(&ifr, 0, sizeof(ifr)); strncpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name)); if (ioctl(ifsock, SIOCGIFFLAGS, &ifr) < 0) { - warnmsg(LOG_ERR, __FUNCTION__, "ioctl(SIOCGIFFLAGS) on %s: %s", + warnmsg(LOG_ERR, __func__, "ioctl(SIOCGIFFLAGS) on %s: %s", ifname, strerror(errno)); return(-1); } @@ -172,7 +172,7 @@ interface_status(struct ifinfo *ifinfo) if (ioctl(ifsock, SIOCGIFMEDIA, (caddr_t)&ifmr) < 0) { if (errno != EINVAL) { - warnmsg(LOG_DEBUG, __FUNCTION__, + warnmsg(LOG_DEBUG, __func__, "ioctl(SIOCGIFMEDIA) on %s: %s", ifname, strerror(errno)); return(-1); @@ -245,7 +245,7 @@ lladdropt_fill(struct sockaddr_dl *sdl, struct nd_opt_hdr *ndopt) memcpy(addr, LLADDR(sdl), ETHER_ADDR_LEN); break; default: - warnmsg(LOG_ERR, __FUNCTION__, + warnmsg(LOG_ERR, __func__, "unsupported link type(%d)", sdl->sdl_type); exit(1); } @@ -334,12 +334,12 @@ get_llflag(const char *name) int s; if ((s = socket(PF_INET6, SOCK_DGRAM, 0)) < 0) { - warnmsg(LOG_ERR, __FUNCTION__, "socket(SOCK_DGRAM): %s", + warnmsg(LOG_ERR, __func__, "socket(SOCK_DGRAM): %s", strerror(errno)); exit(1); } if (getifaddrs(&ifap) != 0) { - warnmsg(LOG_ERR, __FUNCTION__, "etifaddrs: %s", + warnmsg(LOG_ERR, __func__, "etifaddrs: %s", strerror(errno)); exit(1); } @@ -358,7 +358,7 @@ get_llflag(const char *name) strcpy(ifr6.ifr_name, name); memcpy(&ifr6.ifr_ifru.ifru_addr, sin6, sin6->sin6_len); if (ioctl(s, SIOCGIFAFLAG_IN6, &ifr6) < 0) { - warnmsg(LOG_ERR, __FUNCTION__, + warnmsg(LOG_ERR, __func__, "ioctl(SIOCGIFAFLAG_IN6): %s", strerror(errno)); exit(1); } @@ -383,12 +383,12 @@ get_llflag(const char *name) maxif = if_maxindex() + 1; iflist = (struct ifreq *)malloc(maxif * BUFSIZ); /* XXX */ if (iflist == NULL) { - warnmsg(LOG_ERR, __FUNCTION__, "not enough core"); + warnmsg(LOG_ERR, __func__, "not enough core"); exit(1); } if ((s = socket(PF_INET6, SOCK_DGRAM, 0)) < 0) { - warnmsg(LOG_ERR, __FUNCTION__, "socket(SOCK_DGRAM): %s", + warnmsg(LOG_ERR, __func__, "socket(SOCK_DGRAM): %s", strerror(errno)); exit(1); } @@ -396,7 +396,7 @@ get_llflag(const char *name) ifconf.ifc_req = iflist; ifconf.ifc_len = maxif * BUFSIZ; /* XXX */ if (ioctl(s, SIOCGIFCONF, &ifconf) < 0) { - warnmsg(LOG_ERR, __FUNCTION__, "ioctl(SIOCGIFCONF): %s", + warnmsg(LOG_ERR, __func__, "ioctl(SIOCGIFCONF): %s", strerror(errno)); exit(1); } @@ -420,7 +420,7 @@ get_llflag(const char *name) strcpy(ifr6.ifr_name, name); memcpy(&ifr6.ifr_ifru.ifru_addr, sin6, sin6->sin6_len); if (ioctl(s, SIOCGIFAFLAG_IN6, &ifr6) < 0) { - warnmsg(LOG_ERR, __FUNCTION__, + warnmsg(LOG_ERR, __func__, "ioctl(SIOCGIFAFLAG_IN6): %s", strerror(errno)); exit(1); } diff --git a/usr.sbin/rtsold/probe.c b/usr.sbin/rtsold/probe.c index f03daaa416..2e4d89f6df 100644 --- a/usr.sbin/rtsold/probe.c +++ b/usr.sbin/rtsold/probe.c @@ -29,7 +29,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/usr.sbin/rtsold/probe.c,v 1.2.2.3 2001/07/03 11:02:16 ume Exp $ - * $DragonFly: src/usr.sbin/rtsold/probe.c,v 1.4 2004/02/04 00:52:55 rob Exp $ + * $DragonFly: src/usr.sbin/rtsold/probe.c,v 1.5 2005/02/17 14:00:10 joerg Exp $ */ #include @@ -74,18 +74,18 @@ probe_init() if (sndcmsgbuf == NULL && (sndcmsgbuf = (u_char *)malloc(scmsglen)) == NULL) { - warnmsg(LOG_ERR, __FUNCTION__, "malloc failed"); + warnmsg(LOG_ERR, __func__, "malloc failed"); return(-1); } if ((probesock = socket(AF_INET6, SOCK_RAW, IPPROTO_NONE)) < 0) { - warnmsg(LOG_ERR, __FUNCTION__, "socket: %s", strerror(errno)); + warnmsg(LOG_ERR, __func__, "socket: %s", strerror(errno)); return(-1); } /* make the socket send-only */ if (shutdown(probesock, 0)) { - warnmsg(LOG_ERR, __FUNCTION__, "shutdown: %s", strerror(errno)); + warnmsg(LOG_ERR, __func__, "shutdown: %s", strerror(errno)); return(-1); } @@ -110,13 +110,13 @@ defrouter_probe(int ifindex) u_char ntopbuf[INET6_ADDRSTRLEN]; if ((s = socket(AF_INET6, SOCK_DGRAM, 0)) < 0) { - warnmsg(LOG_ERR, __FUNCTION__, "socket: %s", strerror(errno)); + warnmsg(LOG_ERR, __func__, "socket: %s", strerror(errno)); return; } bzero(&dr, sizeof(dr)); strcpy(dr.ifname, "lo0"); /* dummy interface */ if (ioctl(s, SIOCGDRLST_IN6, (caddr_t)&dr) < 0) { - warnmsg(LOG_ERR, __FUNCTION__, "ioctl(SIOCGDRLST_IN6): %s", + warnmsg(LOG_ERR, __func__, "ioctl(SIOCGDRLST_IN6): %s", strerror(errno)); goto closeandend; } @@ -125,7 +125,7 @@ defrouter_probe(int ifindex) if (ifindex && dr.defrouter[i].if_index == ifindex) { /* sanity check */ if (!IN6_IS_ADDR_LINKLOCAL(&dr.defrouter[i].rtaddr)) { - warnmsg(LOG_ERR, __FUNCTION__, + warnmsg(LOG_ERR, __func__, "default router list contains a " "non-linklocal address(%s)", inet_ntop(AF_INET6, @@ -180,12 +180,12 @@ sendprobe(struct in6_addr *addr, int ifindex) memcpy(CMSG_DATA(cm), &hoplimit, sizeof(int)); } - warnmsg(LOG_DEBUG, __FUNCTION__, "probe a router %s on %s", + warnmsg(LOG_DEBUG, __func__, "probe a router %s on %s", inet_ntop(AF_INET6, addr, ntopbuf, INET6_ADDRSTRLEN), if_indextoname(ifindex, ifnamebuf)); if (sendmsg(probesock, &sndmhdr, 0)) - warnmsg(LOG_ERR, __FUNCTION__, "sendmsg on %s: %s", + warnmsg(LOG_ERR, __func__, "sendmsg on %s: %s", if_indextoname(ifindex, ifnamebuf), strerror(errno)); return; diff --git a/usr.sbin/rtsold/rtsock.c b/usr.sbin/rtsold/rtsock.c index 4d3586913a..fafa8c4720 100644 --- a/usr.sbin/rtsold/rtsock.c +++ b/usr.sbin/rtsold/rtsock.c @@ -1,6 +1,6 @@ /* $KAME: rtsock.c,v 1.3 2000/10/10 08:46:45 itojun Exp $ */ /* $FreeBSD: src/usr.sbin/rtsold/rtsock.c,v 1.1.2.1 2001/07/03 11:02:16 ume Exp $ */ -/* $DragonFly: src/usr.sbin/rtsold/rtsock.c,v 1.4 2005/02/15 00:26:00 cpressey Exp $ */ +/* $DragonFly: src/usr.sbin/rtsold/rtsock.c,v 1.5 2005/02/17 14:00:10 joerg Exp $ */ /* * Copyright (C) 2000 WIDE Project. @@ -113,7 +113,7 @@ rtsock_input(s) break; if (dflag > 1) { - warnmsg(LOG_INFO, __FUNCTION__, + warnmsg(LOG_INFO, __func__, "rtmsg type %d, len=%lu", rtm->rtm_type, (u_long)len); } @@ -122,7 +122,7 @@ rtsock_input(s) if (rtm->rtm_type != rtsock_dispatch[idx].type) continue; if (rtm->rtm_msglen < rtsock_dispatch[idx].minlen) { - warnmsg(LOG_INFO, __FUNCTION__, + warnmsg(LOG_INFO, __func__, "rtmsg type %d too short!", rtm->rtm_type); continue; } @@ -154,16 +154,16 @@ rtsock_input_ifannounce(int s __unused, struct rt_msghdr *rtm, char *lim) * we may be able to do a name-based interface match, * and call ifreconfig() to enable the interface again. */ - warnmsg(LOG_INFO, __FUNCTION__, + warnmsg(LOG_INFO, __func__, "interface %s inserted", ifan->ifan_name); break; case IFAN_DEPARTURE: - warnmsg(LOG_WARNING, __FUNCTION__, + warnmsg(LOG_WARNING, __func__, "interface %s removed", ifan->ifan_name); ifinfo = find_ifinfo(ifan->ifan_index); if (ifinfo) { if (dflag > 1) { - warnmsg(LOG_INFO, __FUNCTION__, + warnmsg(LOG_INFO, __func__, "bring interface %s to DOWN state", ifan->ifan_name); } diff --git a/usr.sbin/rtsold/rtsol.c b/usr.sbin/rtsold/rtsol.c index f00599d051..cd4fae2e33 100644 --- a/usr.sbin/rtsold/rtsol.c +++ b/usr.sbin/rtsold/rtsol.c @@ -29,7 +29,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/usr.sbin/rtsold/rtsol.c,v 1.1.2.4 2002/04/24 10:22:30 suz Exp $ - * $DragonFly: src/usr.sbin/rtsold/rtsol.c,v 1.3 2005/02/15 00:26:00 cpressey Exp $ + * $DragonFly: src/usr.sbin/rtsold/rtsol.c,v 1.4 2005/02/17 14:00:10 joerg Exp $ */ #include @@ -90,12 +90,12 @@ sockopen() sndcmsglen = rcvcmsglen = CMSG_SPACE(sizeof(struct in6_pktinfo)) + CMSG_SPACE(sizeof(int)); if (rcvcmsgbuf == NULL && (rcvcmsgbuf = malloc(rcvcmsglen)) == NULL) { - warnmsg(LOG_ERR, __FUNCTION__, + warnmsg(LOG_ERR, __func__, "malloc for receive msghdr failed"); return(-1); } if (sndcmsgbuf == NULL && (sndcmsgbuf = malloc(sndcmsglen)) == NULL) { - warnmsg(LOG_ERR, __FUNCTION__, + warnmsg(LOG_ERR, __func__, "malloc for send msghdr failed"); return(-1); } @@ -104,13 +104,13 @@ sockopen() sin6_allrouters.sin6_len = sizeof(sin6_allrouters); if (inet_pton(AF_INET6, ALLROUTER, &sin6_allrouters.sin6_addr.s6_addr) != 1) { - warnmsg(LOG_ERR, __FUNCTION__, "inet_pton failed for %s", + warnmsg(LOG_ERR, __func__, "inet_pton failed for %s", ALLROUTER); return(-1); } if ((rssock = socket(AF_INET6, SOCK_RAW, IPPROTO_ICMPV6)) < 0) { - warnmsg(LOG_ERR, __FUNCTION__, "socket: %s", strerror(errno)); + warnmsg(LOG_ERR, __func__, "socket: %s", strerror(errno)); return(-1); } @@ -119,14 +119,14 @@ sockopen() #ifdef IPV6_RECVPKTINFO if (setsockopt(rssock, IPPROTO_IPV6, IPV6_RECVPKTINFO, &on, sizeof(on)) < 0) { - warnmsg(LOG_ERR, __FUNCTION__, "IPV6_RECVPKTINFO: %s", + warnmsg(LOG_ERR, __func__, "IPV6_RECVPKTINFO: %s", strerror(errno)); exit(1); } #else /* old adv. API */ if (setsockopt(rssock, IPPROTO_IPV6, IPV6_PKTINFO, &on, sizeof(on)) < 0) { - warnmsg(LOG_ERR, __FUNCTION__, "IPV6_PKTINFO: %s", + warnmsg(LOG_ERR, __func__, "IPV6_PKTINFO: %s", strerror(errno)); exit(1); } @@ -137,14 +137,14 @@ sockopen() #ifdef IPV6_RECVHOPLIMIT if (setsockopt(rssock, IPPROTO_IPV6, IPV6_RECVHOPLIMIT, &on, sizeof(on)) < 0) { - warnmsg(LOG_ERR, __FUNCTION__, "IPV6_RECVHOPLIMIT: %s", + warnmsg(LOG_ERR, __func__, "IPV6_RECVHOPLIMIT: %s", strerror(errno)); exit(1); } #else /* old adv. API */ if (setsockopt(rssock, IPPROTO_IPV6, IPV6_HOPLIMIT, &on, sizeof(on)) < 0) { - warnmsg(LOG_ERR, __FUNCTION__, "IPV6_HOPLIMIT: %s", + warnmsg(LOG_ERR, __func__, "IPV6_HOPLIMIT: %s", strerror(errno)); exit(1); } @@ -155,7 +155,7 @@ sockopen() ICMP6_FILTER_SETPASS(ND_ROUTER_ADVERT, &filt); if (setsockopt(rssock, IPPROTO_ICMPV6, ICMP6_FILTER, &filt, sizeof(filt)) == -1) { - warnmsg(LOG_ERR, __FUNCTION__, "setsockopt(ICMP6_FILTER): %s", + warnmsg(LOG_ERR, __func__, "setsockopt(ICMP6_FILTER): %s", strerror(errno)); return(-1); } @@ -212,7 +212,7 @@ sendpacket(struct ifinfo *ifinfo) } warnmsg(LOG_DEBUG, - __FUNCTION__, "send RS on %s, whose state is %d", + __func__, "send RS on %s, whose state is %d", ifinfo->ifname, ifinfo->state); i = sendmsg(rssock, &sndmhdr, 0); @@ -223,7 +223,7 @@ sendpacket(struct ifinfo *ifinfo) * network cards on a mobile node. We ignore it. */ if (errno != ENETDOWN || dflag > 0) - warnmsg(LOG_ERR, __FUNCTION__, "sendmsg on %s: %s", + warnmsg(LOG_ERR, __func__, "sendmsg on %s: %s", ifinfo->ifname, strerror(errno)); } @@ -245,7 +245,7 @@ rtsol_input(int s) /* get message */ if ((i = recvmsg(s, &rcvmhdr, 0)) < 0) { - warnmsg(LOG_ERR, __FUNCTION__, "recvmsg: %s", strerror(errno)); + warnmsg(LOG_ERR, __func__, "recvmsg: %s", strerror(errno)); return; } @@ -267,25 +267,25 @@ rtsol_input(int s) if (ifindex == 0) { warnmsg(LOG_ERR, - __FUNCTION__, "failed to get receiving interface"); + __func__, "failed to get receiving interface"); return; } if (hlimp == NULL) { warnmsg(LOG_ERR, - __FUNCTION__, "failed to get receiving hop limit"); + __func__, "failed to get receiving hop limit"); return; } if ((size_t)i < sizeof(struct nd_router_advert)) { warnmsg(LOG_ERR, - __FUNCTION__, "packet size(%d) is too short", i); + __func__, "packet size(%d) is too short", i); return; } icp = (struct icmp6_hdr *)rcvmhdr.msg_iov[0].iov_base; if (icp->icmp6_type != ND_ROUTER_ADVERT) { - warnmsg(LOG_ERR, __FUNCTION__, + warnmsg(LOG_ERR, __func__, "invalid icmp type(%d) from %s on %s", icp->icmp6_type, inet_ntop(AF_INET6, &from.sin6_addr, ntopbuf, INET6_ADDRSTRLEN), @@ -294,7 +294,7 @@ rtsol_input(int s) } if (icp->icmp6_code != 0) { - warnmsg(LOG_ERR, __FUNCTION__, + warnmsg(LOG_ERR, __func__, "invalid icmp code(%d) from %s on %s", icp->icmp6_code, inet_ntop(AF_INET6, &from.sin6_addr, ntopbuf, INET6_ADDRSTRLEN), @@ -303,7 +303,7 @@ rtsol_input(int s) } if (*hlimp != 255) { - warnmsg(LOG_NOTICE, __FUNCTION__, + warnmsg(LOG_NOTICE, __func__, "invalid RA with hop limit(%d) from %s on %s", *hlimp, inet_ntop(AF_INET6, &from.sin6_addr, ntopbuf, @@ -313,7 +313,7 @@ rtsol_input(int s) } if (pi && !IN6_IS_ADDR_LINKLOCAL(&from.sin6_addr)) { - warnmsg(LOG_NOTICE, __FUNCTION__, + warnmsg(LOG_NOTICE, __func__, "invalid RA with non link-local source from %s on %s", inet_ntop(AF_INET6, &from.sin6_addr, ntopbuf, INET6_ADDRSTRLEN), @@ -324,7 +324,7 @@ rtsol_input(int s) /* xxx: more validation? */ if ((ifi = find_ifinfo(pi->ipi6_ifindex)) == NULL) { - warnmsg(LOG_NOTICE, __FUNCTION__, + warnmsg(LOG_NOTICE, __func__, "received RA from %s on an unexpeced IF(%s)", inet_ntop(AF_INET6, &from.sin6_addr, ntopbuf, INET6_ADDRSTRLEN), @@ -332,7 +332,7 @@ rtsol_input(int s) return; } - warnmsg(LOG_DEBUG, __FUNCTION__, + warnmsg(LOG_DEBUG, __func__, "received RA from %s on %s, state is %d", inet_ntop(AF_INET6, &from.sin6_addr, ntopbuf, INET6_ADDRSTRLEN), diff --git a/usr.sbin/rtsold/rtsold.c b/usr.sbin/rtsold/rtsold.c index 75a3acb056..2001bca158 100644 --- a/usr.sbin/rtsold/rtsold.c +++ b/usr.sbin/rtsold/rtsold.c @@ -29,7 +29,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/usr.sbin/rtsold/rtsold.c,v 1.1.2.4 2002/04/04 11:07:19 ume Exp $ - * $DragonFly: src/usr.sbin/rtsold/rtsold.c,v 1.5 2005/02/15 00:26:00 cpressey Exp $ + * $DragonFly: src/usr.sbin/rtsold/rtsold.c,v 1.6 2005/02/17 14:00:10 joerg Exp $ */ #include @@ -263,7 +263,7 @@ main(argc, argv) FILE *fp; if ((fp = fopen(pidfilename, "w")) == NULL) - warnmsg(LOG_ERR, __FUNCTION__, + warnmsg(LOG_ERR, __func__, "failed to open a log file(%s): %s", pidfilename, strerror(errno)); else { @@ -304,7 +304,7 @@ main(argc, argv) e = select(maxfd + 1, &select_fd, NULL, NULL, timeout); if (e < 1) { if (e < 0 && errno != EINTR) { - warnmsg(LOG_ERR, __FUNCTION__, "select: %s", + warnmsg(LOG_ERR, __func__, "select: %s", strerror(errno)); } continue; @@ -329,19 +329,19 @@ ifconfig(char *ifname) int flags; if ((sdl = if_nametosdl(ifname)) == NULL) { - warnmsg(LOG_ERR, __FUNCTION__, + warnmsg(LOG_ERR, __func__, "failed to get link layer information for %s", ifname); return(-1); } if (find_ifinfo(sdl->sdl_index)) { - warnmsg(LOG_ERR, __FUNCTION__, + warnmsg(LOG_ERR, __func__, "interface %s was already configured", ifname); free(sdl); return(-1); } if ((ifinfo = malloc(sizeof(*ifinfo))) == NULL) { - warnmsg(LOG_ERR, __FUNCTION__, "memory allocation failed"); + warnmsg(LOG_ERR, __func__, "memory allocation failed"); free(sdl); return(-1); } @@ -439,7 +439,7 @@ make_packet(struct ifinfo *ifinfo) size_t packlen = sizeof(struct nd_router_solicit), lladdroptlen = 0; if ((lladdroptlen = lladdropt_length(ifinfo->sdl)) == 0) { - warnmsg(LOG_INFO, __FUNCTION__, + warnmsg(LOG_INFO, __func__, "link-layer address option has null length" " on %s. Treat as not included.", ifinfo->ifname); } @@ -448,7 +448,7 @@ make_packet(struct ifinfo *ifinfo) /* allocate buffer */ if ((buf = malloc(packlen)) == NULL) { - warnmsg(LOG_ERR, __FUNCTION__, + warnmsg(LOG_ERR, __func__, "memory allocation failed for %s", ifinfo->ifname); return(-1); } @@ -484,7 +484,7 @@ rtsol_check_timer() for (ifinfo = iflist; ifinfo; ifinfo = ifinfo->next) { if (TIMEVAL_LEQ(ifinfo->expire, now)) { if (dflag > 1) - warnmsg(LOG_DEBUG, __FUNCTION__, + warnmsg(LOG_DEBUG, __func__, "timer expiration on %s, " "state = %d", ifinfo->ifname, ifinfo->state); @@ -510,7 +510,7 @@ rtsol_check_timer() interface_status(ifinfo); if (oldstatus != ifinfo->active) { - warnmsg(LOG_DEBUG, __FUNCTION__, + warnmsg(LOG_DEBUG, __func__, "%s status is changed" " from %d to %d", ifinfo->ifname, @@ -540,7 +540,7 @@ rtsol_check_timer() if (ifinfo->probes < MAX_RTR_SOLICITATIONS) sendpacket(ifinfo); else { - warnmsg(LOG_INFO, __FUNCTION__, + warnmsg(LOG_INFO, __func__, "No answer " "after sending %d RSs", ifinfo->probes); @@ -557,7 +557,7 @@ rtsol_check_timer() } if (TIMEVAL_EQ(rtsol_timer, tm_max)) { - warnmsg(LOG_DEBUG, __FUNCTION__, "there is no timer"); + warnmsg(LOG_DEBUG, __func__, "there is no timer"); return(NULL); } else if (TIMEVAL_LT(rtsol_timer, now)) @@ -567,7 +567,7 @@ rtsol_check_timer() TIMEVAL_SUB(&rtsol_timer, &now, &returnval); if (dflag > 1) - warnmsg(LOG_DEBUG, __FUNCTION__, "New timer is %ld:%08ld", + warnmsg(LOG_DEBUG, __func__, "New timer is %ld:%08ld", (long)returnval.tv_sec, (long)returnval.tv_usec); return(&returnval); @@ -625,7 +625,7 @@ rtsol_timer_update(struct ifinfo *ifinfo) } break; default: - warnmsg(LOG_ERR, __FUNCTION__, + warnmsg(LOG_ERR, __func__, "illegal interface state(%d) on %s", ifinfo->state, ifinfo->ifname); return; @@ -634,7 +634,7 @@ rtsol_timer_update(struct ifinfo *ifinfo) /* reset the timer */ if (TIMEVAL_EQ(ifinfo->timer, tm_max)) { ifinfo->expire = tm_max; - warnmsg(LOG_DEBUG, __FUNCTION__, + warnmsg(LOG_DEBUG, __func__, "stop timer for %s", ifinfo->ifname); } else { @@ -642,7 +642,7 @@ rtsol_timer_update(struct ifinfo *ifinfo) TIMEVAL_ADD(&now, &ifinfo->timer, &ifinfo->expire); if (dflag > 1) - warnmsg(LOG_DEBUG, __FUNCTION__, + warnmsg(LOG_DEBUG, __func__, "set timer for %s to %d:%d", ifinfo->ifname, (int)ifinfo->timer.tv_sec, (int)ifinfo->timer.tv_usec); -- 2.41.0