Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 19 Aug 2019 17:51:06 +0000 (UTC)
From:      D Scott Phillips <scottph@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r351225 - in head/sys/dev: acpica nvdimm
Message-ID:  <201908191751.x7JHp6Hi095523@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201908191751.x7JHp6Hi095523>