From 1974d7a40e0a56a01f05e03e22970bd4d042786a Mon Sep 17 00:00:00 2001 From: D Scott Phillips Date: Mon, 19 Aug 2019 17:51:06 +0000 Subject: [PATCH] Don't set the string "unknown" as a device's location_str Return an empty string when the location is unknown instead of the string "unknown". This ensures that all location entries are of the form key=val. Suggested by: imp Approved by: jhb (mentor) MFC after: 1 week Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D21326 --- sys/dev/acpica/acpi.c | 2 +- sys/dev/nvdimm/nvdimm.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/dev/acpica/acpi.c b/sys/dev/acpica/acpi.c index c6b0796de478..382d139617de 100644 --- a/sys/dev/acpica/acpi.c +++ b/sys/dev/acpica/acpi.c @@ -866,7 +866,7 @@ acpi_child_location_str_method(device_t cbdev, device_t child, char *buf, strlcat(buf, buf2, buflen); } } else { - snprintf(buf, buflen, "unknown"); + snprintf(buf, buflen, ""); } return (0); } diff --git a/sys/dev/nvdimm/nvdimm.c b/sys/dev/nvdimm/nvdimm.c index 5c6b6ee6dc72..e7d13cbf20f7 100644 --- a/sys/dev/nvdimm/nvdimm.c +++ b/sys/dev/nvdimm/nvdimm.c @@ -571,7 +571,7 @@ nvdimm_root_child_location_str(device_t dev, device_t child, char *buf, if (handle != NULL) res = snprintf(buf, buflen, "handle=%s", acpi_name(handle)); else - res = snprintf(buf, buflen, "unknown"); + res = snprintf(buf, buflen, ""); if (res >= buflen) return (EOVERFLOW);