git: 763ac7a34336 - main - devinfo: Turn '&&' into nested condition in prep for libxo

From: Warner Losh <imp_at_FreeBSD.org>
Date: Tue, 06 May 2025 22:02:14 UTC
The branch main has been updated by imp:

URL: https://cgit.FreeBSD.org/src/commit/?id=763ac7a343363a3edee5b3fc4012d159a4cd2baa

commit 763ac7a343363a3edee5b3fc4012d159a4cd2baa
Author:     ktullavik <ktullavik@gmail.com>
AuthorDate: 2024-10-17 17:42:20 +0000
Commit:     Warner Losh <imp@FreeBSD.org>
CommitDate: 2025-05-06 22:01:46 +0000

    devinfo: Turn '&&' into nested condition in prep for libxo
    
    No functional change intended.
    
    Reviewed by: imp
    Pull Request: https://github.com/freebsd/freebsd-src/pull/1480
---
 usr.sbin/devinfo/devinfo.c | 19 +++++++++++++------
 1 file changed, 13 insertions(+), 6 deletions(-)

diff --git a/usr.sbin/devinfo/devinfo.c b/usr.sbin/devinfo/devinfo.c
index 4343c7dd3457..b639dbf89a97 100644
--- a/usr.sbin/devinfo/devinfo.c
+++ b/usr.sbin/devinfo/devinfo.c
@@ -155,12 +155,19 @@ print_dev(struct devinfo_dev *dev)
 {
 
 	printf("%s", dev->dd_name[0] ? dev->dd_name : "unknown");
-	if (vflag && *dev->dd_desc)
-		printf(" <%s>", dev->dd_desc);
-	if (vflag && *dev->dd_pnpinfo)
-		printf(" pnpinfo %s", dev->dd_pnpinfo);
-	if (vflag && *dev->dd_location)
-		printf(" at %s", dev->dd_location);
+
+	if (vflag) {
+		if (*dev->dd_desc) {
+			printf(" <%s>", dev->dd_desc);
+		}
+		if (*dev->dd_pnpinfo) {
+			printf(" pnpinfo %s", dev->dd_pnpinfo);
+		}
+		if (*dev->dd_location) {
+			printf(" at %s", dev->dd_location);
+		}
+	}
+
 	if (!(dev->dd_flags & DF_ENABLED))
 		printf(" (disabled)");
 	else if (dev->dd_flags & DF_SUSPENDED)