From owner-dev-commits-src-main@freebsd.org Wed Jul 28 15:27:53 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CC6D965D45E; Wed, 28 Jul 2021 15:27:53 +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 4GZcx55466z3LRl; Wed, 28 Jul 2021 15:27:53 +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 8DB48206E5; Wed, 28 Jul 2021 15:27:53 +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 16SFRrpF087956; Wed, 28 Jul 2021 15:27:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16SFRrs2087955; Wed, 28 Jul 2021 15:27:53 GMT (envelope-from git) Date: Wed, 28 Jul 2021 15:27:53 GMT Message-Id: <202107281527.16SFRrs2087955@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: =?utf-8?Q?Roger Pau Monn=C3=A9?= Subject: git: 9976c5a540c1 - main - xen/intr: use __func__ instead of function names MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: royger X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9976c5a540c1e140151e3d59bc4a0e0bdeef0cda Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Jul 2021 15:27:53 -0000 The branch main has been updated by royger: URL: https://cgit.FreeBSD.org/src/commit/?id=9976c5a540c1e140151e3d59bc4a0e0bdeef0cda commit 9976c5a540c1e140151e3d59bc4a0e0bdeef0cda Author: Elliott Mitchell AuthorDate: 2021-04-06 13:46:46 +0000 Commit: Roger Pau Monné CommitDate: 2021-07-28 15:27:03 +0000 xen/intr: use __func__ instead of function names Functions tend to get renamed and unless the developer is careful often debugging messages are missed. As such using func is far superior. Replace several instances of hard-coded function names. Reviewed by: royger Differential revision: https://reviews.freebsd.org/D29499 --- sys/x86/xen/xen_intr.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/sys/x86/xen/xen_intr.c b/sys/x86/xen/xen_intr.c index ebbae25c2d9e..646c9b4728fc 100644 --- a/sys/x86/xen/xen_intr.c +++ b/sys/x86/xen/xen_intr.c @@ -316,7 +316,7 @@ xen_intr_alloc_isrc(enum evtchn_type type) if (xen_intr_auto_vector_count > NR_EVENT_CHANNELS) { if (!warned) { warned = 1; - printf("xen_intr_alloc: Event channels exhausted.\n"); + printf("%s: Event channels exhausted.\n", __func__); } return (NULL); } @@ -406,8 +406,7 @@ xen_intr_bind_isrc(struct xenisrc **isrcp, evtchn_port_t local_port, *isrcp = NULL; if (port_handlep == NULL) { - printf("%s: xen_intr_bind_isrc: Bad event handle\n", - intr_owner); + printf("%s: %s: Bad event handle\n", intr_owner, __func__); return (EINVAL); } @@ -1217,7 +1216,7 @@ xen_intr_unbind(xen_intr_handle_t *port_handlep) struct xenisrc *isrc; KASSERT(port_handlep != NULL, - ("NULL xen_intr_handle_t passed to xen_intr_unbind")); + ("NULL xen_intr_handle_t passed to %s", __func__)); isrc = xen_intr_isrc_from_handle(*port_handlep); *port_handlep = NULL; @@ -1277,11 +1276,9 @@ xen_intr_add_handler(const char *name, driver_filter_t filter, error = intr_add_handler(name, isrc->xi_vector,filter, handler, arg, flags|INTR_EXCL, &isrc->xi_cookie, 0); - if (error != 0) { - printf( - "%s: xen_intr_add_handler: intr_add_handler failed: %d\n", - name, error); - } + if (error != 0) + printf("%s: %s: add handler failed: %d\n", name, __func__, + error); return (error); }