diff options
author | Mikhail Gusarov <dottedmag@dottedmag.net> | 2010-06-06 15:28:30 +0700 |
---|---|---|
committer | Mikhail Gusarov <dottedmag@dottedmag.net> | 2010-06-06 20:27:18 +0700 |
commit | 0a4d8cbdcd7b25313fb29ccdb498044af95f7de6 (patch) | |
tree | 3534c9035180b7e0d2ebbbf0202a370cb61f8e8d /hw/dmx/input | |
parent | 5a0fc0ad21d562612676ef88ef2d533b2391810a (diff) |
Remove more superfluous if(p) checks around free(p)
This patch has been generated by the following Coccinelle semantic patch:
@@
expression E;
@@
-if(E) { free(E); }
+free(E);
Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Reviewed-by: Julien Cristau <jcristau@debian.org>
Reviewed-by: Fernando Carrijo <fcarrijo@yahoo.com.br>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Diffstat (limited to 'hw/dmx/input')
-rw-r--r-- | hw/dmx/input/dmxbackend.c | 2 | ||||
-rw-r--r-- | hw/dmx/input/dmxconsole.c | 2 | ||||
-rw-r--r-- | hw/dmx/input/dmxinputinit.c | 12 | ||||
-rw-r--r-- | hw/dmx/input/lnx-keyboard.c | 2 | ||||
-rw-r--r-- | hw/dmx/input/lnx-ms.c | 2 | ||||
-rw-r--r-- | hw/dmx/input/lnx-ps2.c | 2 | ||||
-rw-r--r-- | hw/dmx/input/usb-common.c | 2 |
7 files changed, 12 insertions, 12 deletions
diff --git a/hw/dmx/input/dmxbackend.c b/hw/dmx/input/dmxbackend.c index 55615cf39..e917a5c42 100644 --- a/hw/dmx/input/dmxbackend.c +++ b/hw/dmx/input/dmxbackend.c @@ -114,7 +114,7 @@ pointer dmxBackendCreatePrivate(DeviceIntPtr pDevice) * #dmxBackendCreatePrivate. */ void dmxBackendDestroyPrivate(pointer private) { - if (private) free(private); + free(private); } static void *dmxBackendTestScreen(DMXScreenInfo *dmxScreen, void *closure) diff --git a/hw/dmx/input/dmxconsole.c b/hw/dmx/input/dmxconsole.c index 80df0649e..7ec209df0 100644 --- a/hw/dmx/input/dmxconsole.c +++ b/hw/dmx/input/dmxconsole.c @@ -148,7 +148,7 @@ pointer dmxConsoleCreatePrivate(DeviceIntPtr pDevice) /** If \a private is non-NULL, free its associated memory. */ void dmxConsoleDestroyPrivate(pointer private) { - if (private) free(private); + free(private); } static void dmxConsoleDrawFineCursor(myPrivate *priv, XRectangle *rect) diff --git a/hw/dmx/input/dmxinputinit.c b/hw/dmx/input/dmxinputinit.c index 814fc1a89..b2e16fba4 100644 --- a/hw/dmx/input/dmxinputinit.c +++ b/hw/dmx/input/dmxinputinit.c @@ -1084,9 +1084,9 @@ static void dmxInputFreeLocal(DMXLocalInputInfoRec *local) if (local->isCore && local->type == DMX_LOCAL_KEYBOARD) dmxLocalCoreKeyboard = NULL; if (local->destroy_private) local->destroy_private(local->private); - if (local->history) free(local->history); - if (local->valuators) free(local->valuators); - if (local->deviceName) free(local->deviceName); + free(local->history); + free(local->valuators); + free(local->deviceName); local->private = NULL; local->history = NULL; local->deviceName = NULL; @@ -1100,9 +1100,9 @@ void dmxInputFree(DMXInputInfo *dmxInput) if (!dmxInput) return; - if (dmxInput->keycodes) free(dmxInput->keycodes); - if (dmxInput->symbols) free(dmxInput->symbols); - if (dmxInput->geometry) free(dmxInput->geometry); + free(dmxInput->keycodes); + free(dmxInput->symbols); + free(dmxInput->geometry); for (i = 0; i < dmxInput->numDevs; i++) { dmxInputFreeLocal(dmxInput->devs[i]); diff --git a/hw/dmx/input/lnx-keyboard.c b/hw/dmx/input/lnx-keyboard.c index 050c80ebf..5bfb8813c 100644 --- a/hw/dmx/input/lnx-keyboard.c +++ b/hw/dmx/input/lnx-keyboard.c @@ -368,7 +368,7 @@ pointer kbdLinuxCreatePrivate(DeviceIntPtr pKeyboard) /** Destroy a private structure. */ void kbdLinuxDestroyPrivate(pointer priv) { - if (priv) free(priv); + free(priv); } /** Ring the bell. diff --git a/hw/dmx/input/lnx-ms.c b/hw/dmx/input/lnx-ms.c index 549df46e2..ee187072c 100644 --- a/hw/dmx/input/lnx-ms.c +++ b/hw/dmx/input/lnx-ms.c @@ -301,7 +301,7 @@ pointer msLinuxCreatePrivate(DeviceIntPtr pMouse) /** Destroy a private structure. */ void msLinuxDestroyPrivate(pointer priv) { - if (priv) free(priv); + free(priv); } /** Fill the \a info structure with information needed to initialize \a diff --git a/hw/dmx/input/lnx-ps2.c b/hw/dmx/input/lnx-ps2.c index 70918eef4..3a220cf01 100644 --- a/hw/dmx/input/lnx-ps2.c +++ b/hw/dmx/input/lnx-ps2.c @@ -269,7 +269,7 @@ pointer ps2LinuxCreatePrivate(DeviceIntPtr pMouse) /** Destroy a private structure. */ void ps2LinuxDestroyPrivate(pointer priv) { - if (priv) free(priv); + free(priv); } /** Fill the \a info structure with information needed to initialize \a diff --git a/hw/dmx/input/usb-common.c b/hw/dmx/input/usb-common.c index 95c00b839..25479aea6 100644 --- a/hw/dmx/input/usb-common.c +++ b/hw/dmx/input/usb-common.c @@ -377,5 +377,5 @@ pointer usbCreatePrivate(DeviceIntPtr pDevice) /** Destroy a private structure. */ void usbDestroyPrivate(pointer priv) { - if (priv) free(priv); + free(priv); } |