Author: scottph
Date: Mon Aug 19 17:51:06 2019
New Revision: 351225
URL: https://svnweb.freebsd.org/changeset/base/351225

Log:
  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

Modified:
  head/sys/dev/acpica/acpi.c
  head/sys/dev/nvdimm/nvdimm.c

Modified: head/sys/dev/acpica/acpi.c
==============================================================================
--- head/sys/dev/acpica/acpi.c  Mon Aug 19 17:28:12 2019        (r351224)
+++ head/sys/dev/acpica/acpi.c  Mon Aug 19 17:51:06 2019        (r351225)
@@ -866,7 +866,7 @@ acpi_child_location_str_method(device_t cbdev, device_
                 strlcat(buf, buf2, buflen);
         }
     } else {
-        snprintf(buf, buflen, "unknown");
+        snprintf(buf, buflen, "");
     }
     return (0);
 }

Modified: head/sys/dev/nvdimm/nvdimm.c
==============================================================================
--- head/sys/dev/nvdimm/nvdimm.c        Mon Aug 19 17:28:12 2019        
(r351224)
+++ head/sys/dev/nvdimm/nvdimm.c        Mon Aug 19 17:51:06 2019        
(r351225)
@@ -571,7 +571,7 @@ nvdimm_root_child_location_str(device_t dev, device_t 
        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);
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to