ASoC: ti: davinci-mcasp: remove redundant assignment to variable ret
Subsystems (4)
PATCH 1/1 ASoC: ti: davinci-mcasp: remove redundant assignment to variable ret
From: Colin Ian King <[email protected]>
The assignment to ret is redundant as it is not used in the error return path and hence can be removed.
Addresses-Coverity: ("Unused value")
Signed-off-by Colin Ian King <[email protected]>
--- sound/soc/ti/davinci-mcasp.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
sound/soc/ti/davinci-mcasp.c +1 -3
@@ -1764,10 +1764,8 @@ static struct davinci_mcasp_pdata *davinci_mcasp_set_pdata_from_of( }else if (match) { pdata =devm_kmemdup (&pdev->dev, match->data,sizeof (*pdata),GFP_KERNEL ); -if (!pdata) { - ret = -ENOMEM ; +if (!pdata)return pdata; - } }else {/* control shouldn't reach here. something is wrong */ ret = -EINVAL ;
Signature · 1 line
2.25.0
Quoted 16 lines · Colin King
From: Colin Ian King <[email protected]>
The assignment to ret is redundant as it is not used in the error return path and hence can be removed.
Addresses-Coverity: ("Unused value")
Signed-off-by Colin Ian King <[email protected]>--- sound/soc/ti/davinci-mcasp.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)sound/soc/ti/davinci-mcasp.c +0
-0
sound/soc/ti/davinci-mcasp.c static struct davinci_mcasp_pdata *davinci_mcasp_set_pdata_from_of( · line 1768
Quoted 7 lines
sound/soc/ti/davinci-mcasp.c +1
-2@@ -1764,10 +1764,8 @@ static struct davinci_mcasp_pdata *davinci_mcasp_set_pdata_from_of( }else if (match) { pdata =devm_kmemdup (&pdev->dev, match->data,sizeof (*pdata),GFP_KERNEL ); -if (!pdata) { - ret = -ENOMEM ; +if (!pdata)return pdata;
Use a literal NULL for readability. "return NULL;".
regards,
dan carpenter