diff options
author | Robert Mustacchi <rm@fingolfin.org> | 2020-04-08 09:46:12 +0000 |
---|---|---|
committer | Robert Mustacchi <rm@fingolfin.org> | 2020-04-22 01:57:10 -0700 |
commit | 6205b5c44bad9044e168b06aef439c2e7cdc8a89 (patch) | |
tree | c2771699197e70758ade3969a67665c370e09774 /usr/src | |
parent | e98dc02a871a9cd0498c8862434b16aa85e772d3 (diff) | |
download | illumos-joyent-6205b5c44bad9044e168b06aef439c2e7cdc8a89.tar.gz |
12508 ndi_devi_alloc() and friends could take const char * names
Reviewed by: Yuri Pankov <ypankov@fastmail.com>
Reviewed by: Patrick Mooney <pmooney@pfmooney.com>
Reviewed by: Toomas Soome <tsoome@me.com>
Approved by: Dan McDonald <danmcd@joyent.com>
Diffstat (limited to 'usr/src')
-rw-r--r-- | usr/src/uts/common/os/devcfg.c | 8 | ||||
-rw-r--r-- | usr/src/uts/common/sys/autoconf.h | 2 | ||||
-rw-r--r-- | usr/src/uts/common/sys/ddi_implfuncs.h | 2 | ||||
-rw-r--r-- | usr/src/uts/common/sys/sunndi.h | 62 |
4 files changed, 31 insertions, 43 deletions
diff --git a/usr/src/uts/common/os/devcfg.c b/usr/src/uts/common/os/devcfg.c index c82a8f86d9..ef2fb9b8a4 100644 --- a/usr/src/uts/common/os/devcfg.c +++ b/usr/src/uts/common/os/devcfg.c @@ -255,7 +255,7 @@ i_ddi_node_cache_init() * The allocated node has a reference count of 0. */ dev_info_t * -i_ddi_alloc_node(dev_info_t *pdip, char *node_name, pnode_t nodeid, +i_ddi_alloc_node(dev_info_t *pdip, const char *node_name, pnode_t nodeid, int instance, ddi_prop_t *sys_prop, int flag) { struct dev_info *devi; @@ -2046,7 +2046,7 @@ ndi_devi_tryenter(dev_info_t *dip, int *circular) * not allowed to sleep. */ int -ndi_devi_alloc(dev_info_t *parent, char *node_name, pnode_t nodeid, +ndi_devi_alloc(dev_info_t *parent, const char *node_name, pnode_t nodeid, dev_info_t **ret_dip) { ASSERT(node_name != NULL); @@ -2066,7 +2066,7 @@ ndi_devi_alloc(dev_info_t *parent, char *node_name, pnode_t nodeid, * This routine may sleep and should not be called at interrupt time */ void -ndi_devi_alloc_sleep(dev_info_t *parent, char *node_name, pnode_t nodeid, +ndi_devi_alloc_sleep(dev_info_t *parent, const char *node_name, pnode_t nodeid, dev_info_t **ret_dip) { ASSERT(node_name != NULL); @@ -2536,7 +2536,7 @@ i_ddi_get_exported_classes(dev_info_t *dip, char ***classes) * Helper functions, returns NULL if no memory. */ char * -i_ddi_strdup(char *str, uint_t flag) +i_ddi_strdup(const char *str, uint_t flag) { char *copy; diff --git a/usr/src/uts/common/sys/autoconf.h b/usr/src/uts/common/sys/autoconf.h index ee97f8d274..5a3ad7df60 100644 --- a/usr/src/uts/common/sys/autoconf.h +++ b/usr/src/uts/common/sys/autoconf.h @@ -274,7 +274,7 @@ extern int exclude_level(int); extern major_t path_to_major(char *); extern void i_ddi_node_cache_init(void); -extern dev_info_t *i_ddi_alloc_node(dev_info_t *, char *, pnode_t, int, +extern dev_info_t *i_ddi_alloc_node(dev_info_t *, const char *, pnode_t, int, ddi_prop_t *, int); extern void i_ddi_forceattach_drivers(void); extern int i_ddi_io_initialized(void); diff --git a/usr/src/uts/common/sys/ddi_implfuncs.h b/usr/src/uts/common/sys/ddi_implfuncs.h index 522366aa23..c5e84e576a 100644 --- a/usr/src/uts/common/sys/ddi_implfuncs.h +++ b/usr/src/uts/common/sys/ddi_implfuncs.h @@ -164,7 +164,7 @@ extern int peekpoke_mem(ddi_ctl_enum_t, peekpoke_ctlops_t *); /* * Helper functions */ -extern char *i_ddi_strdup(char *, uint_t); +extern char *i_ddi_strdup(const char *, uint_t); extern void i_ddi_prop_list_delete(ddi_prop_t *); extern ddi_prop_t *i_ddi_prop_list_dup(ddi_prop_t *, uint_t); extern int i_ddi_load_drvconf(major_t); diff --git a/usr/src/uts/common/sys/sunndi.h b/usr/src/uts/common/sys/sunndi.h index e6a998322d..94313a450e 100644 --- a/usr/src/uts/common/sys/sunndi.h +++ b/usr/src/uts/common/sys/sunndi.h @@ -118,11 +118,11 @@ ndi_prop_remove_all(dev_info_t *dip); * not allowed to sleep. */ int -ndi_devi_alloc(dev_info_t *parent, char *node_name, pnode_t nodeid, +ndi_devi_alloc(dev_info_t *parent, const char *node_name, pnode_t nodeid, dev_info_t **ret_dip); void -ndi_devi_alloc_sleep(dev_info_t *parent, char *node_name, pnode_t nodeid, +ndi_devi_alloc_sleep(dev_info_t *parent, const char *node_name, pnode_t nodeid, dev_info_t **ret_dip); /* @@ -174,7 +174,7 @@ ndi_devi_bind_driver_async(dev_info_t *dip, uint_t flags); */ int ndi_devctl_device_getstate(dev_info_t *parent, struct devctl_iocdata *dcp, - uint_t *state); + uint_t *state); /* * Transition the child addressed by "name@addr" to the online state. @@ -182,7 +182,7 @@ ndi_devctl_device_getstate(dev_info_t *parent, struct devctl_iocdata *dcp, */ int ndi_devctl_device_online(dev_info_t *dip, struct devctl_iocdata *dcp, - uint_t flags); + uint_t flags); /* * Transition the child addressed by "name@addr" to the offline state. @@ -190,7 +190,7 @@ ndi_devctl_device_online(dev_info_t *dip, struct devctl_iocdata *dcp, */ int ndi_devctl_device_offline(dev_info_t *dip, struct devctl_iocdata *dcp, - uint_t flags); + uint_t flags); /* * Remove the child addressed by name@addr. @@ -198,7 +198,7 @@ ndi_devctl_device_offline(dev_info_t *dip, struct devctl_iocdata *dcp, */ int ndi_devctl_device_remove(dev_info_t *dip, struct devctl_iocdata *dcp, - uint_t flags); + uint_t flags); /* * Bus get state @@ -206,7 +206,7 @@ ndi_devctl_device_remove(dev_info_t *dip, struct devctl_iocdata *dcp, */ int ndi_devctl_bus_getstate(dev_info_t *dip, struct devctl_iocdata *dcp, - uint_t *state); + uint_t *state); /* * Place the devinfo in the ONLINE state @@ -219,7 +219,7 @@ ndi_devi_online(dev_info_t *dip, uint_t flags); */ int ndi_devctl_ioctl(dev_info_t *dip, int cmd, intptr_t arg, int mode, - uint_t flags); + uint_t flags); /* * Asynchronous version of ndi_devi_online, callable from interrupt @@ -524,7 +524,7 @@ typedef struct ndi_event_set { */ int ndi_event_alloc_hdl(dev_info_t *dip, ddi_iblock_cookie_t cookie, - ndi_event_hdl_t *ndi_event_hdl, uint_t flag); + ndi_event_hdl_t *ndi_event_hdl, uint_t flag); /* * free the ndi event handle @@ -536,40 +536,28 @@ ndi_event_free_hdl(ndi_event_hdl_t handle); * bind or unbind a set of events to/from the event handle */ int -ndi_event_bind_set(ndi_event_hdl_t handle, - ndi_event_set_t *ndi_event_set, - uint_t flag); +ndi_event_bind_set(ndi_event_hdl_t handle, ndi_event_set_t *ndi_event_set, + uint_t flag); int -ndi_event_unbind_set(ndi_event_hdl_t handle, - ndi_event_set_t *ndi_event_set, - uint_t flag); +ndi_event_unbind_set(ndi_event_hdl_t handle, ndi_event_set_t *ndi_event_set, + uint_t flag); /* * get an event cookie */ int -ndi_event_retrieve_cookie(ndi_event_hdl_t handle, - dev_info_t *child_dip, - char *eventname, - ddi_eventcookie_t *cookiep, - uint_t flag); +ndi_event_retrieve_cookie(ndi_event_hdl_t handle, dev_info_t *child_dip, + char *eventname, ddi_eventcookie_t *cookiep, uint_t flag); /* * add an event callback info to the ndi event handle */ int -ndi_event_add_callback(ndi_event_hdl_t handle, - dev_info_t *child_dip, - ddi_eventcookie_t cookie, - void (*event_callback) - (dev_info_t *, - ddi_eventcookie_t, - void *arg, - void *impldata), - void *arg, - uint_t flag, - ddi_callback_id_t *cb_id); +ndi_event_add_callback(ndi_event_hdl_t handle, dev_info_t *child_dip, + ddi_eventcookie_t cookie, void (*event_callback)(dev_info_t *, + ddi_eventcookie_t, void *arg, void *impldata), void *arg, uint_t flag, + ddi_callback_id_t *cb_id); /* * remove an event callback registration from the ndi event handle @@ -588,7 +576,7 @@ ndi_event_run_callbacks(ndi_event_hdl_t handle, dev_info_t *child_dip, * do callback for just one child_dip, regardless of attributes */ int ndi_event_do_callback(ndi_event_hdl_t handle, dev_info_t *child_dip, - ddi_eventcookie_t cookie, void *bus_impldata); + ddi_eventcookie_t cookie, void *bus_impldata); /* * ndi_event_tag_to_cookie: utility function to find an event cookie @@ -603,7 +591,7 @@ ndi_event_tag_to_cookie(ndi_event_hdl_t handle, int event_tag); */ int ndi_event_cookie_to_tag(ndi_event_hdl_t handle, - ddi_eventcookie_t cookie); + ddi_eventcookie_t cookie); /* * ndi_event_cookie_to_name: utility function to find an event @@ -611,7 +599,7 @@ ndi_event_cookie_to_tag(ndi_event_hdl_t handle, */ char * ndi_event_cookie_to_name(ndi_event_hdl_t handle, - ddi_eventcookie_t cookie); + ddi_eventcookie_t cookie); /* * ndi_event_tag_to_name: utility function to find an event @@ -681,7 +669,7 @@ typedef struct ndi_ra_request { uint64_t ra_boundlen; /* Length of the area, starting */ /* from ra_boundbase, for the */ /* allocated resource to be */ - /* restricted to. */ + /* restricted to. */ uint64_t ra_align_mask; /* Alignment mask used for */ /* allocated base address */ @@ -743,11 +731,11 @@ ndi_ra_map_destroy(dev_info_t *dip, char *type); int ndi_ra_alloc(dev_info_t *dip, ndi_ra_request_t *req, uint64_t *basep, - uint64_t *lenp, char *type, uint_t flag); + uint64_t *lenp, char *type, uint_t flag); int ndi_ra_free(dev_info_t *dip, uint64_t base, uint64_t len, char *type, - uint_t flag); + uint_t flag); /* * ndi_dev_is_prom_node: Return non-zero if the node is a prom node |