From nobody Tue May 21 23:56:20 2024 X-Original-To: dev-commits-src-main@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 4VkWYK2Qstz5L6NG; Tue, 21 May 2024 23:56:21 +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 4VkWYK15Jbz4jDl; Tue, 21 May 2024 23:56:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716335781; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qrsnISRICuEHpHcLNQMjuAdlG4LZ2NbIJw3pj1KFhso=; b=srTHLw8suQAltnTJSOin81YShx4pBzBS4XCXvgY7Yrg5f2Cj1qu4qfCpA2Bk59sn8ueR46 uB771vQ6tBNqy4WoVJjMiaWgahxWsQTyvldvQtEuqnxmBiUwDdYsCpXTTR9V8+232kZLs/ 3ulxFY1OCXP65JsTyJc/6mcIBpLOHR0k5g8pQyd3ZoLeDzYvW4jqWd3QRG+AaTlXVVFjtz oix/CxrBx5JktorpZzuXrmG9caZAfxdHwciiAgCuXPJuUlwbQxXeTaxOursbywhN6eczKL NtHKc0n0lBKBvMu7el5Zq1FkPJ16e8fHKZGWfHXYCp30HqTaA/1Rkb0VG4HIbg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716335781; a=rsa-sha256; cv=none; b=bbU+1A9YTnVTyhgNKbmTMTLojX9mpLfLq7eO+tIrJii2xQV6mt3P4jRSzGOURIeWpsW31a lW0ReaY7rMFcyEm8vtMEcxS9p3HEcww2rIui1wcheryPWsICqwSW1b91A4nBrXR1w02A4Y KunBRTd0kNJnZF6B5IHQPF6L3oTGA76fJXNCzQ96IIEjf4sDKbvGNR2omzijkD2eXA1gcm VZPf2sZk1ApyDKOydHLlrTLz4s3Ri63jNzqScriGy5FQPg0ohEsoWHnZ8dmUhyjkw3nrjJ uMiXY1jbW9xVPYXQ7Bauzdy8K/U5sMJefln94B4Vvdty/pNndlKbQnvWMsQlVg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716335781; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qrsnISRICuEHpHcLNQMjuAdlG4LZ2NbIJw3pj1KFhso=; b=h2HDt0LwvbNJen3eZ7TiKia+GxhsegXBxLlAx1bzG+dNOnCTD3bcx+fDF5zJDcOJ/h702T Jw3/+Kb6BuP72Pi3wig8fscEsBxkh9eMLU2junhoN2Vvi9omJwJJQtwMvXKF9B4OItLOnw 3ScFS8RuHDYnreb72wLREivjz/ATiZ4Z9eCuGgl913Pc6NKgp3yeAa+ERWwpRK8lssEOAo /5jT8BWVG6exrVMWkVGYLpcSKiZQ37cW7qyf+tLPLk6ZNBBGU8hjb4lRtRJkUXXLnXkudY IJ/bCIIT0rCZ7gpvyvwlSjk7MwSh0G1MrEoCHHdOy2JHVL7NfIGt3toHfDDFbQ== 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 4VkWYJ74vVzjKB; Tue, 21 May 2024 23:56:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44LNuKTd032171; Tue, 21 May 2024 23:56:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44LNuKS8032168; Tue, 21 May 2024 23:56:20 GMT (envelope-from git) Date: Tue, 21 May 2024 23:56:20 GMT Message-Id: <202405212356.44LNuKS8032168@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: beb1165a018d - main - kern/rman: update debugging lines in subr_rman.c List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: beb1165a018d32f243c331a427dc212cf3b7febd Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=beb1165a018d32f243c331a427dc212cf3b7febd commit beb1165a018d32f243c331a427dc212cf3b7febd Author: Elliott Mitchell AuthorDate: 2024-05-09 04:15:53 +0000 Commit: Warner Losh CommitDate: 2024-05-21 23:52:21 +0000 kern/rman: update debugging lines in subr_rman.c Rather than hard-code the function name, use __func__ instead. Apply some style and adjust indentation as appropriate. Remove the no longer required braces. Reviewed by: imp,jhb Pull Request: https://github.com/freebsd/freebsd-src/pull/1224 --- sys/kern/subr_rman.c | 29 +++++++++++++---------------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/sys/kern/subr_rman.c b/sys/kern/subr_rman.c index ffd8def66b5c..d4da67b2f16f 100644 --- a/sys/kern/subr_rman.c +++ b/sys/kern/subr_rman.c @@ -154,7 +154,7 @@ rman_manage_region(struct rman *rm, rman_res_t start, rman_res_t end) struct resource_i *r, *s, *t; int rv = 0; - DPRINTF("rman_manage_region: <%s> request: start %#jx, end %#jx\n", + DPRINTF("%s: <%s> request: start %#jx, end %#jx\n", __func__, rm->rm_descr, start, end); if (start < rm->rm_start || end > rm->rm_end) return EINVAL; @@ -439,10 +439,9 @@ rman_reserve_resource_bound(struct rman *rm, rman_res_t start, rman_res_t end, rv = NULL; - DPRINTF("rman_reserve_resource_bound: <%s> request: [%#jx, %#jx], " - "length %#jx, flags %x, device %s\n", rm->rm_descr, start, end, - count, flags, - dev == NULL ? "" : device_get_nameunit(dev)); + DPRINTF("%s: <%s> request: [%#jx, %#jx], length %#jx, flags %x, " + "device %s\n", __func__, rm->rm_descr, start, end, count, flags, + dev == NULL ? "" : device_get_nameunit(dev)); KASSERT(count != 0, ("%s: attempted to allocate an empty range", __func__)); KASSERT((flags & RF_FIRSTSHARE) == 0, @@ -452,19 +451,17 @@ rman_reserve_resource_bound(struct rman *rm, rman_res_t start, rman_res_t end, mtx_lock(rm->rm_mtx); r = TAILQ_FIRST(&rm->rm_list); - if (r == NULL) { - DPRINTF("NULL list head\n"); - } else { - DPRINTF("rman_reserve_resource_bound: trying %#jx <%#jx,%#jx>\n", - r->r_end, start, count-1); - } + if (r == NULL) + DPRINTF("NULL list head\n"); + else + DPRINTF("%s: trying %#jx <%#jx,%#jx>\n", __func__, r->r_end, + start, count-1); + for (r = TAILQ_FIRST(&rm->rm_list); r && r->r_end < start + count - 1; - r = TAILQ_NEXT(r, r_link)) { - ; - DPRINTF("rman_reserve_resource_bound: tried %#jx <%#jx,%#jx>\n", - r->r_end, start, count-1); - } + r = TAILQ_NEXT(r, r_link)) + DPRINTF("%s: tried %#jx <%#jx,%#jx>\n", __func__, r->r_end, + start, count-1); if (r == NULL) { DPRINTF("could not find a region\n");