Commit 69f6555
libbpf: Simplify the find_elf_sec_sz() function
The check in the last return statement is unnecessary, we can just return
the ret variable.
But we can simplify the function further by returning 0 immediately if we
find the section size and -ENOENT otherwise.
Thus we can also remove the ret variable.
Signed-off-by: Yuntao Wang <ytcoode@gmail.com>1 parent 3094b33 commit 69f6555
1 file changed
+2
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1374 | 1374 | | |
1375 | 1375 | | |
1376 | 1376 | | |
1377 | | - | |
1378 | 1377 | | |
1379 | 1378 | | |
1380 | 1379 | | |
1381 | | - | |
1382 | 1380 | | |
1383 | 1381 | | |
1384 | 1382 | | |
1385 | 1383 | | |
1386 | 1384 | | |
1387 | 1385 | | |
1388 | | - | |
1389 | 1386 | | |
| 1387 | + | |
1390 | 1388 | | |
1391 | 1389 | | |
1392 | | - | |
| 1390 | + | |
1393 | 1391 | | |
1394 | 1392 | | |
1395 | 1393 | | |
| |||
0 commit comments