Skip to content

Commit 214a000

Browse files
SamuelZOUvinodkoul
authored andcommitted
dmaengine: ti: k3-udma: Use PTR_ERR_OR_ZERO() to simplify code
Fixes coccicheck warnings: drivers/dma/ti/k3-udma.c:1294:1-3: WARNING: PTR_ERR_OR_ZERO can be used drivers/dma/ti/k3-udma.c:1311:1-3: WARNING: PTR_ERR_OR_ZERO can be used drivers/dma/ti/k3-udma.c:1376:1-3: WARNING: PTR_ERR_OR_ZERO can be used Reported-by: Hulk Robot <[email protected]> Signed-off-by: Samuel Zou <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Vinod Koul <[email protected]>
1 parent c794f7e commit 214a000

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

drivers/dma/ti/k3-udma.c

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1291,10 +1291,8 @@ static int udma_get_tchan(struct udma_chan *uc)
12911291
}
12921292

12931293
uc->tchan = __udma_reserve_tchan(ud, uc->config.channel_tpl, -1);
1294-
if (IS_ERR(uc->tchan))
1295-
return PTR_ERR(uc->tchan);
12961294

1297-
return 0;
1295+
return PTR_ERR_OR_ZERO(uc->tchan);
12981296
}
12991297

13001298
static int udma_get_rchan(struct udma_chan *uc)
@@ -1308,10 +1306,8 @@ static int udma_get_rchan(struct udma_chan *uc)
13081306
}
13091307

13101308
uc->rchan = __udma_reserve_rchan(ud, uc->config.channel_tpl, -1);
1311-
if (IS_ERR(uc->rchan))
1312-
return PTR_ERR(uc->rchan);
13131309

1314-
return 0;
1310+
return PTR_ERR_OR_ZERO(uc->rchan);
13151311
}
13161312

13171313
static int udma_get_chan_pair(struct udma_chan *uc)
@@ -1373,10 +1369,8 @@ static int udma_get_rflow(struct udma_chan *uc, int flow_id)
13731369
}
13741370

13751371
uc->rflow = __udma_get_rflow(ud, flow_id);
1376-
if (IS_ERR(uc->rflow))
1377-
return PTR_ERR(uc->rflow);
13781372

1379-
return 0;
1373+
return PTR_ERR_OR_ZERO(uc->rflow);
13801374
}
13811375

13821376
static void udma_put_rchan(struct udma_chan *uc)

0 commit comments

Comments
 (0)