From ee4693d4dac855f136a62ca3d43b7c289185856d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roger=20Pau=20Monn=C3=A9?= Date: Thu, 26 Nov 2020 09:57:47 +0100 Subject: [PATCH] xen/xenstore: remove unused functions Those helpers are not used, so remove them. No functional change. Sponsored by: Citrix Systems R&D MFC after: 3 days (cherry picked from commit 2ae75536d370c238f77ad09e5e994d2b8bdf010c) (cherry picked from commit af4ed05c3dd25c957b657f92f953bd9f00f818a8) Approved by: so --- sys/xen/xenbus/xenbus.c | 42 ---------------------------- sys/xen/xenbus/xenbusvar.h | 56 -------------------------------------- 2 files changed, 98 deletions(-) diff --git a/sys/xen/xenbus/xenbus.c b/sys/xen/xenbus/xenbus.c index c59d4aec453..415279ec231 100644 --- a/sys/xen/xenbus/xenbus.c +++ b/sys/xen/xenbus/xenbus.c @@ -102,48 +102,6 @@ xenbus_strstate(XenbusState state) return ((state < (XenbusStateClosed + 1)) ? name[state] : "INVALID"); } -int -xenbus_watch_path(device_t dev, char *path, struct xs_watch *watch, - xs_watch_cb_t *callback, uintptr_t callback_data) -{ - int error; - - watch->node = path; - watch->callback = callback; - watch->callback_data = callback_data; - - error = xs_register_watch(watch); - - if (error) { - watch->node = NULL; - watch->callback = NULL; - xenbus_dev_fatal(dev, error, "adding watch on %s", path); - } - - return (error); -} - -int -xenbus_watch_path2(device_t dev, const char *path, - const char *path2, struct xs_watch *watch, - xs_watch_cb_t *callback, uintptr_t callback_data) -{ - int error; - char *state = malloc(strlen(path) + 1 + strlen(path2) + 1, - M_XENBUS, M_WAITOK); - - strcpy(state, path); - strcat(state, "/"); - strcat(state, path2); - - error = xenbus_watch_path(dev, state, watch, callback, callback_data); - if (error) { - free(state,M_XENBUS); - } - - return (error); -} - void xenbus_dev_verror(device_t dev, int err, const char *fmt, va_list ap) { diff --git a/sys/xen/xenbus/xenbusvar.h b/sys/xen/xenbus/xenbusvar.h index 377d60c0159..bea65fff8e5 100644 --- a/sys/xen/xenbus/xenbusvar.h +++ b/sys/xen/xenbus/xenbusvar.h @@ -123,62 +123,6 @@ xenbus_get_otherend_state(device_t dev) return (xenbus_read_driver_state(xenbus_get_otherend_path(dev))); } -/** - * Initialize and register a watch on the given path (client suplied storage). - * - * \param dev The XenBus device requesting the watch service. - * \param path The XenStore path of the object to be watched. The - * storage for this string must be stable for the lifetime - * of the watch. - * \param watch The watch object to use for this request. This object - * must be stable for the lifetime of the watch. - * \param callback The function to call when XenStore objects at or below - * path are modified. - * \param cb_data Client data that can be retrieved from the watch object - * during the callback. - * - * \return On success, 0. Otherwise an errno value indicating the - * type of failure. - * - * \note On error, the device 'dev' will be switched to the XenbusStateClosing - * state and the returned error is saved in the per-device error node - * for dev in the XenStore. - */ -int xenbus_watch_path(device_t dev, char *path, - struct xs_watch *watch, - xs_watch_cb_t *callback, - uintptr_t cb_data); - -/** - * Initialize and register a watch at path/path2 in the XenStore. - * - * \param dev The XenBus device requesting the watch service. - * \param path The base XenStore path of the object to be watched. - * \param path2 The tail XenStore path of the object to be watched. - * \param watch The watch object to use for this request. This object - * must be stable for the lifetime of the watch. - * \param callback The function to call when XenStore objects at or below - * path are modified. - * \param cb_data Client data that can be retrieved from the watch object - * during the callback. - * - * \return On success, 0. Otherwise an errno value indicating the - * type of failure. - * - * \note On error, \a dev will be switched to the XenbusStateClosing - * state and the returned error is saved in the per-device error node - * for \a dev in the XenStore. - * - * Similar to xenbus_watch_path, however the storage for the path to the - * watched object is allocated from the heap and filled with "path '/' path2". - * Should a call to this function succeed, it is the callers responsibility - * to free watch->node using the M_XENBUS malloc type. - */ -int xenbus_watch_path2(device_t dev, const char *path, - const char *path2, struct xs_watch *watch, - xs_watch_cb_t *callback, - uintptr_t cb_data); - /** * Grant access to the given ring_mfn to the peer of the given device. * -- 2.45.0