git: 204a9e96741e - main - devinfo: Put expression into variable in prep for libxo
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 06 May 2025 22:02:15 UTC
The branch main has been updated by imp:
URL: https://cgit.FreeBSD.org/src/commit/?id=204a9e96741ef22061cc2c8b0192208b66ab3c80
commit 204a9e96741ef22061cc2c8b0192208b66ab3c80
Author: ktullavik <ktullavik@gmail.com>
AuthorDate: 2024-10-17 17:55:49 +0000
Commit: Warner Losh <imp@FreeBSD.org>
CommitDate: 2025-05-06 22:01:46 +0000
devinfo: Put expression into variable in prep for libxo
We'll need it twice when libxo is added.
No functional change intended.
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1480
---
usr.sbin/devinfo/devinfo.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/usr.sbin/devinfo/devinfo.c b/usr.sbin/devinfo/devinfo.c
index b639dbf89a97..a4fa6892981f 100644
--- a/usr.sbin/devinfo/devinfo.c
+++ b/usr.sbin/devinfo/devinfo.c
@@ -183,8 +183,10 @@ print_device(struct devinfo_dev *dev, void *arg)
{
struct indent_arg ia;
int indent;
+ bool printit = vflag || (dev->dd_name[0] != 0 &&
+ dev->dd_state >= DS_ATTACHED);
- if (vflag || (dev->dd_name[0] != 0 && dev->dd_state >= DS_ATTACHED)) {
+ if (printit) {
indent = (int)(intptr_t)arg;
print_indent(indent);
print_dev(dev);