Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

i2c: stm32: Omit two variable reassignments in stm32_i2c_dma_request()

An error code was assigned to a variable and checked accordingly.
This value was passed to a dev_err_probe() call in an if branch.
This function is documented in the way that the same value is returned.
Thus delete two redundant variable reassignments.

The source code was transformed by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
Link: https://lore.kernel.org/r/f7e0c023-d2d1-40ba-badb-74a7e9c23684@web.de

authored by

Markus Elfring and committed by
Andi Shyti
b4cc8180 acff9f26

+3 -4
+3 -4
drivers/i2c/busses/i2c-stm32.c
··· 27 27 if (IS_ERR(dma->chan_tx)) { 28 28 ret = PTR_ERR(dma->chan_tx); 29 29 if (ret != -ENODEV) 30 - ret = dev_err_probe(dev, ret, 31 - "can't request DMA tx channel\n"); 30 + dev_err_probe(dev, ret, "can't request DMA tx channel\n"); 31 + 32 32 goto fail_al; 33 33 } 34 34 ··· 48 48 if (IS_ERR(dma->chan_rx)) { 49 49 ret = PTR_ERR(dma->chan_rx); 50 50 if (ret != -ENODEV) 51 - ret = dev_err_probe(dev, ret, 52 - "can't request DMA rx channel\n"); 51 + dev_err_probe(dev, ret, "can't request DMA rx channel\n"); 53 52 54 53 goto fail_tx; 55 54 }