[PATCH] Remove devPrivates init and delete callback lists.

Jamey Sharp jamey at minilop.net
Thu May 13 13:54:08 PDT 2010


I thought I'd check both master and everything in xorg/driver, and I
don't see any uses of these functions left. So:

Reviewed-by: Jamey Sharp <jamey at minilop.net>

On Thu, May 13, 2010 at 10:34 AM, Keith Packard <keithp at keithp.com> wrote:
> XSELinux was the only consumer of these interfaces and it no longer
> needs them.
>
> Signed-off-by: Keith Packard <keithp at keithp.com>
> ---
>  dix/privates.c     |   40 ----------------------------------------
>  include/privates.h |   28 +---------------------------
>  2 files changed, 1 insertions(+), 67 deletions(-)
>
> diff --git a/dix/privates.c b/dix/privates.c
> index 27694cb..4a8a186 100644
> --- a/dix/privates.c
> +++ b/dix/privates.c
> @@ -47,8 +47,6 @@ struct _Private {
>  typedef struct _PrivateDesc {
>     DevPrivateKey key;
>     unsigned size;
> -    CallbackListPtr initfuncs;
> -    CallbackListPtr deletefuncs;
>  } PrivateDescRec;
>
>  #define PRIV_MAX 256
> @@ -102,7 +100,6 @@ pointer *
>  dixAllocatePrivate(PrivateRec **privates, const DevPrivateKey key)
>  {
>     PrivateDescRec *item = findItem(key);
> -    PrivateCallbackRec calldata;
>     PrivateRec *ptr;
>     pointer value;
>     int oldsize, newsize;
> @@ -144,10 +141,6 @@ dixAllocatePrivate(PrivateRec **privates, const DevPrivateKey key)
>        ptr->value = value;
>     }
>
> -    calldata.key = key;
> -    calldata.value = &ptr->value;
> -    CallCallbacks(&item->initfuncs, &calldata);
> -
>     return &ptr->value;
>  }
>
> @@ -202,16 +195,10 @@ void
>  dixFreePrivates(PrivateRec *privates)
>  {
>     int i;
> -    PrivateCallbackRec calldata;
>
>     if (privates)
>        for (i = 1; i < privates->state; i++)
>            if (privates[i].state) {
> -               /* call the delete callbacks */
> -               calldata.key = items[i].key;
> -               calldata.value = &privates[i].value;
> -               CallCallbacks(&items[i].deletefuncs, &calldata);
> -
>                /* free pre-allocated memory */
>                if (items[i].size)
>                    free(privates[i].value);
> @@ -220,31 +207,6 @@ dixFreePrivates(PrivateRec *privates)
>     free(privates);
>  }
>
> -/*
> - * Callback registration
> - */
> -int
> -dixRegisterPrivateInitFunc(const DevPrivateKey key,
> -                          CallbackProcPtr callback, pointer data)
> -{
> -    PrivateDescRec *item = findItem(key);
> -    if (!item)
> -       return FALSE;
> -
> -    return AddCallback(&item->initfuncs, callback, data);
> -}
> -
> -int
> -dixRegisterPrivateDeleteFunc(const DevPrivateKey key,
> -                            CallbackProcPtr callback, pointer data)
> -{
> -    PrivateDescRec *item = findItem(key);
> -    if (!item)
> -       return FALSE;
> -
> -    return AddCallback(&item->deletefuncs, callback, data);
> -}
> -
>  /* Table of devPrivates offsets */
>  static const int offsetDefaults[] = {
>     -1,                                        /* RT_NONE */
> @@ -304,8 +266,6 @@ dixResetPrivates(void)
>     for (i = 1; i < nextPriv; i++) {
>        *items[i].key = 0;
>        items[i].size = 0;
> -       DeleteCallbackList(&items[i].initfuncs);
> -       DeleteCallbackList(&items[i].deletefuncs);
>     }
>     nextPriv = 1;
>
> diff --git a/include/privates.h b/include/privates.h
> index e6f788d..7850dea 100644
> --- a/include/privates.h
> +++ b/include/privates.h
> @@ -94,33 +94,7 @@ extern _X_EXPORT int
>  dixSetPrivate(PrivateRec **privates, const DevPrivateKey key, pointer val);
>
>  /*
> - * Register callbacks to be called on private allocation/freeing.
> - * The calldata argument to the callbacks is a PrivateCallbackPtr.
> - */
> -typedef struct _PrivateCallback {
> -    DevPrivateKey key; /* private registration key */
> -    pointer *value;    /* address of private pointer */
> -} PrivateCallbackRec;
> -
> -/*
> - * Register a function to be called when dixAllocPrivate successfully associates
> - * 'key' with a new PrivateRec.
> - */
> -extern _X_EXPORT int
> -dixRegisterPrivateInitFunc(const DevPrivateKey key,
> -                          CallbackProcPtr callback, pointer userdata);
> -
> -/*
> - * Register a function to be called when dixFreePrivates unassociates 'key' with
> - * a PrivateRec.
> - */
> -extern _X_EXPORT int
> -dixRegisterPrivateDeleteFunc(const DevPrivateKey key,
> -                            CallbackProcPtr callback, pointer userdata);
> -
> -/*
> - * Unassociates all keys from 'privates', calls the callbacks registered with
> - * dixRegisterPrivateDeleteFunc, and frees all private data automatically
> + * Unassociates all keys from 'privates' and frees all private data automatically
>  * allocated via dixRequestPrivate.
>  */
>  extern _X_EXPORT void
> --
> 1.7.1
>
> _______________________________________________
> xorg-devel at lists.x.org: X.Org development
> Archives: http://lists.x.org/archives/xorg-devel
> Info: http://lists.x.org/mailman/listinfo/xorg-devel
>


More information about the xorg-devel mailing list