From nobody Thu Apr 18 18:12:26 2024 X-Original-To: dev-commits-src-all@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 4VL5Tl1f9Hz5HK3j; Thu, 18 Apr 2024 18:12: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 4VL5Tk6VkLz3yvZ; Thu, 18 Apr 2024 18:12:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1713463946; 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=cFqbWD3irAuIcTbUvAVnW3UMOYmHUUUuTykO00UAHoY=; b=mY0neaPNBlLn3gC9Gs5jUzbBGlakTAo/jTUR7FJs85teXhsxLci9Zfs40vCbodHV4bVV8l 77xQifdXv1/izhdW1hLSWeRkjoD8/UYUNWK3kaL0aTsDSd0xOFSXGl9H99ohZDxXnXveqT ISmtPDBHLhtfotsNa0GTgbLTOHQSUS7WALkddIUusRkcwTx47qiqeKP3vxXJnQp+/Lk2N4 4Yx5tTtC/6gvM7NevAjIj7WYHMhjVuoZZw30I7Vh4bAnD8w3v6eA/DrsxUEJoWfnH7talz XdufZD+VF/v51w1BjqBSEwzoE9iImSaP2t+fW+s/Ph4cjjbnZwHJftugo9IOAw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1713463946; a=rsa-sha256; cv=none; b=djgJLV17zzRNDRd/fz/p+4VTWlxqQCjRubcn93vn5RjsDvYzT7BP10jVEV3+3Xzc+1z8A2 p+b7Ks5yeNShfBLm6xmD4wkOYdpCTPO6wcVYCHDgmoHMzAmRCU0N4pMjSpNY5zZaHyuMXd uL+6m55qD1i37luuNJrEZYtKRDerxUHFdL2f6CkA+1wqXjxbI+IsyB1H8NJgMbJtvvkNWm YPA1letOdLLVKtExgZEnXffA3IlGc3plGDszKX6sM8CXJTfeXSVfXsbhnqba3hQAGBHx7w bBPe3hUDAVASksW0k3L0nAtA9ufBwTzSXxoO8X5H9i8VS7I7gPFS03iIXR9CnQ== 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=1713463946; 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=cFqbWD3irAuIcTbUvAVnW3UMOYmHUUUuTykO00UAHoY=; b=FbonUj2b19Nmx1AonkT7TBshmbqboOSg2xCujOk3HlToCK52I35dt3DupbZvUUqD0QdSjQ N0DRzeZpgdxWmSEaHzC0S+Puw77KvCxW6i4j9Leh/STr1k8VUFuHPCecreamEh9GlGqM/O KWsLI2CwwB77cytqJqDZ6Nyc9HGzGuPoJOlrji0yX4YVrpgbVOMGBRvMqm1nZeQekw6jcI vM9Z9CPGxi5CqAZiIDpMkngGnRm5fhbF5CxxkODUOO5xFPUY09/ZTR8Cjn5z9W1NQGjYQz KD3mkktNd09Ft+jUQTEy48/SjetMosbn2SoRqXBYiZv2kgyAZwfzj4yZudzcUQ== 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 4VL5Tk66z8zL1G; Thu, 18 Apr 2024 18:12:26 +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 43IICQDv016198; Thu, 18 Apr 2024 18:12:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43IICQXL016195; Thu, 18 Apr 2024 18:12:26 GMT (envelope-from git) Date: Thu, 18 Apr 2024 18:12:26 GMT Message-Id: <202404181812.43IICQXL016195@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mitchell Horne Subject: git: 327987597bff - stable/14 - clkdom_dump(): improve output text List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 327987597bff4db5984d7704e7235647cc76c931 Auto-Submitted: auto-generated The branch stable/14 has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=327987597bff4db5984d7704e7235647cc76c931 commit 327987597bff4db5984d7704e7235647cc76c931 Author: Mitchell Horne AuthorDate: 2024-03-08 14:09:08 +0000 Commit: Mitchell Horne CommitDate: 2024-04-18 18:11:31 +0000 clkdom_dump(): improve output text If the call to clknode_get_freq() returns an error (unlikely), report this, rather than printing the error code as the clock frequency. If the clock has no parent (e.g. a fixed reference clock), print "none" rather than "(NULL)(-1)". This is a more human-legible presentation of the same information. Reviewed by: manu MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D44267 (cherry picked from commit 08635c51d1e34f8a3e42c7cf35dc7264a5b68118) --- sys/dev/extres/clk/clk.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/sys/dev/extres/clk/clk.c b/sys/dev/extres/clk/clk.c index c569b05b6189..46a1aaaf6fd9 100644 --- a/sys/dev/extres/clk/clk.c +++ b/sys/dev/extres/clk/clk.c @@ -512,10 +512,20 @@ clkdom_dump(struct clkdom * clkdom) CLK_TOPO_SLOCK(); TAILQ_FOREACH(clknode, &clkdom->clknode_list, clkdom_link) { rv = clknode_get_freq(clknode, &freq); - printf("Clock: %s, parent: %s(%d), freq: %ju\n", clknode->name, - clknode->parent == NULL ? "(NULL)" : clknode->parent->name, - clknode->parent_idx, - (uintmax_t)((rv == 0) ? freq: rv)); + if (rv != 0) { + printf("Clock: %s, error getting frequency: %d\n", + clknode->name, rv); + continue; + } + + if (clknode->parent != NULL) { + printf("Clock: %s, parent: %s(%d), freq: %ju\n", + clknode->name, clknode->parent->name, + clknode->parent_idx, (uintmax_t)freq); + } else { + printf("Clock: %s, parent: none, freq: %ju\n", + clknode->name, (uintmax_t)freq); + } } CLK_TOPO_UNLOCK(); }