From 5effdf708100fd5eeeaa8c7bbbed3b90cbb70cf5 Mon Sep 17 00:00:00 2001 From: H Hartley Sweeten Date: Wed, 4 Mar 2015 12:15:33 -0700 Subject: [PATCH] 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 --- drivers/staging/comedi/drivers/mite.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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; } -- 2.30.2