staging: comedi: mite: (!foo) preferred over (foo == NULL)
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Wed, 4 Mar 2015 19:15:33 +0000 (12:15 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 7 Mar 2015 00:01:28 +0000 (16:01 -0800)
Also, clarify the 'ring' allocation failure by returning NULL instead
of 'ring' (which would be NULL).

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/comedi/drivers/mite.c

index 1e537a5cf86286eeb646836f471968caaa2213fb..79b5597db1a16a4e9f12f909763236a2effe1f05 100644 (file)
@@ -186,10 +186,10 @@ struct mite_dma_descriptor_ring *mite_alloc_ring(struct mite_struct *mite)
        struct mite_dma_descriptor_ring *ring =
            kmalloc(sizeof(struct mite_dma_descriptor_ring), GFP_KERNEL);
 
-       if (ring == NULL)
-               return ring;
+       if (!ring)
+               return NULL;
        ring->hw_dev = get_device(&mite->pcidev->dev);
-       if (ring->hw_dev == NULL) {
+       if (!ring->hw_dev) {
                kfree(ring);
                return NULL;
        }
This page took 0.025088 seconds and 5 git commands to generate.