Skip to content

Commit

Permalink
dmaengine: Save few bytes and increase readability of dma_request_chan()
Browse files Browse the repository at this point in the history
Split IS_ERR_OR_NULL() check followed by additional conditional
to two simple conditionals. This increases readability and saves memory:

Function                                     old     new   delta
dma_request_chan                             700     697      -3
Total: Before=10224, After=10221, chg -0.03%

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20200828144519.14483-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
  • Loading branch information
Andy Shevchenko authored and Vinod Koul committed Sep 3, 2020
1 parent 7547dbd commit 5d7e816
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/dma/dmaengine.c
Original file line number Diff line number Diff line change
Expand Up @@ -847,8 +847,10 @@ struct dma_chan *dma_request_chan(struct device *dev, const char *name)
}
mutex_unlock(&dma_list_mutex);

if (IS_ERR_OR_NULL(chan))
return chan ? chan : ERR_PTR(-EPROBE_DEFER);
if (IS_ERR(chan))
return chan;
if (!chan)
return ERR_PTR(-EPROBE_DEFER);

found:
#ifdef CONFIG_DEBUG_FS
Expand Down

0 comments on commit 5d7e816

Please sign in to comment.