From nobody Fri Oct 08 16:09:20 2021 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 5674C17E979A; Fri, 8 Oct 2021 16:09:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HQtRp5tTZz4k0c; Fri, 8 Oct 2021 16:09:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AFB882198; Fri, 8 Oct 2021 16:09:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 198G9KBm002418; Fri, 8 Oct 2021 16:09:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 198G9K4D002417; Fri, 8 Oct 2021 16:09:20 GMT (envelope-from git) Date: Fri, 8 Oct 2021 16:09:20 GMT Message-Id: <202110081609.198G9K4D002417@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kyle Evans Subject: git: 34915d6871d0 - stable/12 - loader: dev_net.c should use __func__ with printf List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 34915d6871d09448bac6d2f66bfd56340ae16fd5 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=34915d6871d09448bac6d2f66bfd56340ae16fd5 commit 34915d6871d09448bac6d2f66bfd56340ae16fd5 Author: Toomas Soome AuthorDate: 2021-09-24 14:07:20 +0000 Commit: Kyle Evans CommitDate: 2021-10-08 08:16:56 +0000 loader: dev_net.c should use __func__ with printf We have printf calls with function name hardwired to string, sometimes wrong name. Use __func__ instead. MFC after: 1 week (cherry picked from commit 1a25c51e38a7c9f46ec195836233636616741f06) --- stand/common/dev_net.c | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/stand/common/dev_net.c b/stand/common/dev_net.c index 1fa955ac1cf1..db13e618e822 100644 --- a/stand/common/dev_net.c +++ b/stand/common/dev_net.c @@ -141,13 +141,14 @@ net_open(struct open_file *f, ...) if (netdev_sock < 0) { netdev_sock = netif_open(dev); if (netdev_sock < 0) { - printf("net_open: netif_open() failed\n"); + printf("%s: netif_open() failed\n", __func__); return (ENXIO); } netdev_name = strdup(devname); #ifdef NETIF_DEBUG if (debug) - printf("net_open: netif_open() succeeded\n"); + printf("%s: netif_open() succeeded\n", + __func__); #endif } /* @@ -202,7 +203,7 @@ net_close(struct open_file *f) #ifdef NETIF_DEBUG if (debug) - printf("net_close: opens=%d\n", netdev_opens); + printf("%s: opens=%d\n", __func__, netdev_opens); #endif f->f_devdata = NULL; @@ -217,7 +218,7 @@ net_cleanup(void) if (netdev_sock >= 0) { #ifdef NETIF_DEBUG if (debug) - printf("net_cleanup: calling netif_close()\n"); + printf("%s: calling netif_close()\n", __func__); #endif rootip.s_addr = 0; free(netdev_name); @@ -272,7 +273,7 @@ net_getparams(int sock) goto exit; #ifdef NETIF_DEBUG if (debug) - printf("net_open: BOOTP failed, trying RARP/RPC...\n"); + printf("%s: BOOTP failed, trying RARP/RPC...\n", __func__); #endif #endif @@ -281,19 +282,19 @@ net_getparams(int sock) * netmask to the "natural" default for our address. */ if (rarp_getipaddress(sock)) { - printf("net_open: RARP failed\n"); + printf("%s: RARP failed\n", __func__); return (EIO); } - printf("net_open: client addr: %s\n", inet_ntoa(myip)); + printf("%s: client addr: %s\n", __func__, inet_ntoa(myip)); /* Get our hostname, server IP address, gateway. */ if (bp_whoami(sock)) { - printf("net_open: bootparam/whoami RPC failed\n"); + printf("%s: bootparam/whoami RPC failed\n", __func__); return (EIO); } #ifdef NETIF_DEBUG if (debug) - printf("net_open: client name: %s\n", hostname); + printf("%s: client name: %s\n", __func__, hostname); #endif /* @@ -310,17 +311,18 @@ net_getparams(int sock) netmask = smask; #ifdef NETIF_DEBUG if (debug) - printf("net_open: subnet mask: %s\n", intoa(netmask)); + printf("%s: subnet mask: %s\n", __func__, + intoa(netmask)); #endif } #ifdef NETIF_DEBUG if (gateip.s_addr && debug) - printf("net_open: net gateway: %s\n", inet_ntoa(gateip)); + printf("%s: net gateway: %s\n", __func__, inet_ntoa(gateip)); #endif /* Get the root server and pathname. */ if (bp_getfile(sock, "root", &rootip, rootpath)) { - printf("net_open: bootparam/getfile RPC failed\n"); + printf("%s: bootparam/getfile RPC failed\n", __func__); return (EIO); } exit: @@ -329,8 +331,8 @@ exit: #ifdef NETIF_DEBUG if (debug) { - printf("net_open: server addr: %s\n", inet_ntoa(rootip)); - printf("net_open: server path: %s\n", rootpath); + printf("%s: server addr: %s\n", __func__, inet_ntoa(rootip)); + printf("%s: server path: %s\n", __func__, rootpath); } #endif