From: H Hartley Sweeten Date: Wed, 4 Mar 2015 19:15:33 +0000 (-0700) Subject: staging: comedi: mite: (!foo) preferred over (foo == NULL) X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=5effdf708100fd5eeeaa8c7bbbed3b90cbb70cf5;p=linux-beck.git staging: comedi: mite: (!foo) preferred over (foo == NULL) Also, clarify the 'ring' allocation failure by returning NULL instead of 'ring' (which would be NULL). Signed-off-by: H Hartley Sweeten Reviewed-by: Ian Abbott Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/comedi/drivers/mite.c b/drivers/staging/comedi/drivers/mite.c index 1e537a5cf862..79b5597db1a1 100644 --- a/drivers/staging/comedi/drivers/mite.c +++ b/drivers/staging/comedi/drivers/mite.c @@ -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; }