Module Name:    src
Committed By:   thorpej
Date:           Sun Aug 15 22:08:01 UTC 2021

Modified Files:
        src/sys/sys: device.h

Log Message:
Define a constant for the size of device_t::dv_xname, rather than just
using 16.


To generate a diff of this commit:
cvs rdiff -u -r1.173 -r1.174 src/sys/sys/device.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/sys/device.h
diff -u src/sys/sys/device.h:1.173 src/sys/sys/device.h:1.174
--- src/sys/sys/device.h:1.173	Sat Aug  7 18:16:42 2021
+++ src/sys/sys/device.h	Sun Aug 15 22:08:01 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: device.h,v 1.173 2021/08/07 18:16:42 thorpej Exp $ */
+/* $NetBSD: device.h,v 1.174 2021/08/15 22:08:01 thorpej Exp $ */
 
 /*
  * Copyright (c) 2021 The NetBSD Foundation, Inc.
@@ -252,6 +252,9 @@ struct devhandle_impl {
 					    const char *, devhandle_t *);
 };
 
+/* Max size of a device external name (including terminating NUL) */
+#define	DEVICE_XNAME_SIZE	16
+
 struct device {
 	devhandle_t	dv_handle;	/* this device's handle;
 					   new device_t's get INVALID */
@@ -262,7 +265,8 @@ struct device {
 	cfdriver_t	dv_cfdriver;	/* our cfdriver */
 	cfattach_t	dv_cfattach;	/* our cfattach */
 	int		dv_unit;	/* device unit number */
-	char		dv_xname[16];	/* external name (name + unit) */
+					/* external name (name + unit) */
+	char		dv_xname[DEVICE_XNAME_SIZE];
 	device_t	dv_parent;	/* pointer to parent device
 					   (NULL if pseudo- or root node) */
 	int		dv_depth;	/* number of parents until root */

Reply via email to