[PATCH:xf86-input-mouse 1/2] No need to merge NULL options list with existing options

Peter Hutterer peter.hutterer at who-t.net
Tue Jul 26 01:26:19 PDT 2011


On Mon, Jul 25, 2011 at 10:15:13PM -0700, Alan Coopersmith wrote:
> Appending NULL to an existing options list simply walks the entire
> existing list before returning it unchanged, so if we aren't creating
> a new list to merge, don't bother merging it either.
> 
> Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>
> ---
>  src/mouse.c |    8 ++++----
>  1 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/src/mouse.c b/src/mouse.c
> index 238d7f7..d883b82 100644
> --- a/src/mouse.c
> +++ b/src/mouse.c
> @@ -2431,13 +2431,13 @@ SetupMouse(InputInfoPtr pInfo)
>       * for the new protocol.
>       */
>      if (pMse->oldProtocolID != pMse->protocolID) {
> -	pointer tmp = NULL;
>  	if ((pMse->protocolID >= 0)
>  	    && (pMse->protocolID < PROT_NUMPROTOS)
> -	    && mouseProtocols[pMse->protocolID].defaults)
> -	    tmp = xf86OptionListCreate(
> +	    && mouseProtocols[pMse->protocolID].defaults) {
> +	    pointer tmp = xf86OptionListCreate(
>  		mouseProtocols[pMse->protocolID].defaults, -1, 0);
> -	pInfo->options = xf86OptionListMerge(pInfo->options, tmp);
> +	    pInfo->options = xf86OptionListMerge(pInfo->options, tmp);
> +	}
>  	/*
>  	 * If baudrate is set write it back to the option
>  	 * list so that the serial interface code can access
> -- 
> 1.7.3.2

Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>

ack for the other one,

Cheers,
  Peter


More information about the xorg-devel mailing list