From: Andy Shevchenko Date: Fri, 28 Aug 2020 14:45:19 +0000 (+0300) Subject: dmaengine: Save few bytes and increase readability of dma_request_chan() X-Git-Tag: v5.15~2669^2~46 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5d7e816e444569c9fdd901ecf0e3933a6ed9a501;p=platform%2Fkernel%2Flinux-starfive.git dmaengine: Save few bytes and increase readability of dma_request_chan() 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 Link: https://lore.kernel.org/r/20200828144519.14483-1-andriy.shevchenko@linux.intel.com Signed-off-by: Vinod Koul --- diff --git a/drivers/dma/dmaengine.c b/drivers/dma/dmaengine.c index ac8ef6c..7974fa0 100644 --- a/drivers/dma/dmaengine.c +++ b/drivers/dma/dmaengine.c @@ -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