From ce6ed7885850c46eb8b229f267d919c605d52a81 Mon Sep 17 00:00:00 2001 From: sborrill Date: Wed, 1 Jul 2020 12:19:45 +0000 Subject: [PATCH] When using show subcommand, display node ID (nid) in hexadecimal to match the HD audio documentation. Diverge slightly by using 0xXX instead of XXh format for consistency with the list subcommand. --- usr.sbin/hdaudioctl/hdaudioctl.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/usr.sbin/hdaudioctl/hdaudioctl.c b/usr.sbin/hdaudioctl/hdaudioctl.c index 55470d97788f..a09312e5ea91 100644 --- a/usr.sbin/hdaudioctl/hdaudioctl.c +++ b/usr.sbin/hdaudioctl/hdaudioctl.c @@ -1,4 +1,4 @@ -/* $NetBSD: hdaudioctl.c,v 1.4 2020/06/15 20:29:29 riastradh Exp $ */ +/* $NetBSD: hdaudioctl.c,v 1.5 2020/07/01 12:19:45 sborrill Exp $ */ /* * Copyright (c) 2009 Precedence Technologies Ltd @@ -292,9 +292,9 @@ hdaudioctl_show(int fd, int argc, char *argv[]) array = prop_dictionary_get(response, "pin-config"); iter = prop_array_iterator(array); prop_object_iterator_reset(iter); - printf("nid Data As Seq Device Conn Jack " + printf("nid Data As Seq Device Conn Jack " "Location Color Misc\n"); - printf("=================================================" + printf("==================================================" "=======================\n"); while ((obj = prop_object_iterator_next(iter)) != NULL) { dict = (prop_dictionary_t)obj; @@ -305,7 +305,7 @@ hdaudioctl_show(int fd, int argc, char *argv[]) jack = pin_jacks[(config >> 16) & 0xf]; loc = pin_locations[(config >> 24) & 0x3f]; color = pin_colors[(config >> 12) & 0xf]; - printf("%3d %08X %2d %3d %-14s %-5s %-7s %-10s %-7s %4X\n", + printf("0x%2X %08X %2d %3d %-14s %-5s %-7s %-10s %-7s %4X\n", nid, config, ((config >> 4U) & 0xf), (config & 0xf), device, conn, jack, loc, color, ((config >> 8U) & 0xf)); }