Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/sys Define a constant for the size of device_t::dv_xname...



details:   https://anonhg.NetBSD.org/src/rev/d00f8327eead
branches:  trunk
changeset: 1022957:d00f8327eead
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Sun Aug 15 22:08:01 2021 +0000

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

diffstat:

 sys/sys/device.h |  8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diffs (29 lines):

diff -r 91e243cf418f -r d00f8327eead sys/sys/device.h
--- a/sys/sys/device.h  Sun Aug 15 21:51:56 2021 +0000
+++ b/sys/sys/device.h  Sun Aug 15 22:08:01 2021 +0000
@@ -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 @@
                                            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 @@
        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 */



Home | Main Index | Thread Index | Old Index