Commit 0bb17fd
tty: sunsu: Simplify device_node cleanup by using __free
Add `__free` function attribute to `ap` and `match` pointer
initialisations which ensure that the pointers are freed as soon as they
go out of scope, thus removing the need to manually free them using
`of_node_put`.
This also removes the need for the `goto` statement and the `rc`
variable.
Suggested-by: Julia Lawall <julia.lawall@inria.fr>
Signed-off-by: Shresth Prasad <shresthprasad7@gmail.com>
Link: https://lore.kernel.org/r/20240518114051.18125-3-shresthprasad7@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>1 parent c3f38fa commit 0bb17fd
1 file changed
Lines changed: 11 additions & 26 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1382 | 1382 | | |
1383 | 1383 | | |
1384 | 1384 | | |
1385 | | - | |
1386 | | - | |
| 1385 | + | |
| 1386 | + | |
1387 | 1387 | | |
1388 | 1388 | | |
1389 | 1389 | | |
1390 | 1390 | | |
1391 | | - | |
1392 | 1391 | | |
1393 | 1392 | | |
1394 | | - | |
| 1393 | + | |
| 1394 | + | |
1395 | 1395 | | |
1396 | | - | |
1397 | | - | |
1398 | | - | |
1399 | | - | |
1400 | | - | |
1401 | | - | |
1402 | | - | |
1403 | | - | |
1404 | | - | |
1405 | | - | |
1406 | | - | |
| 1396 | + | |
| 1397 | + | |
1407 | 1398 | | |
1408 | 1399 | | |
1409 | | - | |
| 1400 | + | |
| 1401 | + | |
1410 | 1402 | | |
1411 | | - | |
1412 | | - | |
1413 | | - | |
1414 | | - | |
1415 | | - | |
1416 | | - | |
| 1403 | + | |
| 1404 | + | |
1417 | 1405 | | |
1418 | 1406 | | |
1419 | | - | |
1420 | | - | |
1421 | | - | |
1422 | | - | |
| 1407 | + | |
1423 | 1408 | | |
1424 | 1409 | | |
1425 | 1410 | | |
| |||
0 commit comments