Commit 1c106eb
net: ipv{6,4}: Remove the now superfluous sentinel elements from ctl_table array
This commit comes at the tail end of a greater effort to remove the
empty elements at the end of the ctl_table arrays (sentinels) which
will reduce the overall build time size of the kernel and run time
memory bloat by ~64 bytes per sentinel (further information Link :
https://lore.kernel.org/all/ZO5Yx5JFogGi%2FcBo@bombadil.infradead.org/)
* Remove sentinel element from ctl_table structs.
* Remove the zeroing out of an array element (to make it look like a
sentinel) in sysctl_route_net_init And ipv6_route_sysctl_init.
This is not longer needed and is safe after commit c899710
("networking: Update to register_net_sysctl_sz") added the array size
to the ctl_table registration.
* Remove extra sentinel element in the declaration of devinet_vars.
* Removed the "-1" in __devinet_sysctl_register, sysctl_route_net_init,
ipv6_sysctl_net_init and ipv4_sysctl_init_net that adjusted for having
an extra empty element when looping over ctl_table arrays
* Replace the for loop stop condition in __addrconf_sysctl_register that
tests for procname == NULL with one that depends on array size
* Removing the unprivileged user check in ipv6_route_sysctl_init is
safe as it is replaced by calling ipv6_route_sysctl_table_size;
introduced in commit c899710 ("networking: Update to
register_net_sysctl_sz")
* Use a table_size variable to keep the value of ARRAY_SIZE
Signed-off-by: Joel Granados <j.granados@samsung.com>
Signed-off-by: David S. Miller <davem@davemloft.net>1 parent ce21871 commit 1c106eb
11 files changed
Lines changed: 13 additions & 35 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2520 | 2520 | | |
2521 | 2521 | | |
2522 | 2522 | | |
2523 | | - | |
| 2523 | + | |
2524 | 2524 | | |
2525 | 2525 | | |
2526 | 2526 | | |
| |||
2583 | 2583 | | |
2584 | 2584 | | |
2585 | 2585 | | |
2586 | | - | |
| 2586 | + | |
2587 | 2587 | | |
2588 | 2588 | | |
2589 | 2589 | | |
| |||
2657 | 2657 | | |
2658 | 2658 | | |
2659 | 2659 | | |
2660 | | - | |
2661 | 2660 | | |
2662 | 2661 | | |
2663 | 2662 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
580 | 580 | | |
581 | 581 | | |
582 | 582 | | |
583 | | - | |
584 | 583 | | |
585 | 584 | | |
586 | 585 | | |
| |||
593 | 592 | | |
594 | 593 | | |
595 | 594 | | |
596 | | - | |
597 | 595 | | |
598 | 596 | | |
599 | 597 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3496 | 3496 | | |
3497 | 3497 | | |
3498 | 3498 | | |
3499 | | - | |
3500 | 3499 | | |
3501 | 3500 | | |
3502 | 3501 | | |
| |||
3530 | 3529 | | |
3531 | 3530 | | |
3532 | 3531 | | |
3533 | | - | |
3534 | 3532 | | |
3535 | 3533 | | |
3536 | 3534 | | |
| |||
3548 | 3546 | | |
3549 | 3547 | | |
3550 | 3548 | | |
3551 | | - | |
3552 | | - | |
| 3549 | + | |
3553 | 3550 | | |
3554 | | - | |
3555 | 3551 | | |
3556 | 3552 | | |
3557 | 3553 | | |
3558 | 3554 | | |
3559 | 3555 | | |
3560 | | - | |
| 3556 | + | |
3561 | 3557 | | |
3562 | 3558 | | |
3563 | 3559 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
575 | 575 | | |
576 | 576 | | |
577 | 577 | | |
578 | | - | |
579 | 578 | | |
580 | 579 | | |
581 | 580 | | |
| |||
1502 | 1501 | | |
1503 | 1502 | | |
1504 | 1503 | | |
1505 | | - | |
1506 | 1504 | | |
1507 | 1505 | | |
1508 | 1506 | | |
1509 | 1507 | | |
| 1508 | + | |
1510 | 1509 | | |
1511 | 1510 | | |
1512 | 1511 | | |
| |||
1517 | 1516 | | |
1518 | 1517 | | |
1519 | 1518 | | |
1520 | | - | |
| 1519 | + | |
1521 | 1520 | | |
1522 | 1521 | | |
1523 | 1522 | | |
| |||
1533 | 1532 | | |
1534 | 1533 | | |
1535 | 1534 | | |
1536 | | - | |
| 1535 | + | |
1537 | 1536 | | |
1538 | 1537 | | |
1539 | 1538 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
152 | 152 | | |
153 | 153 | | |
154 | 154 | | |
155 | | - | |
156 | 155 | | |
157 | 156 | | |
158 | 157 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7184 | 7184 | | |
7185 | 7185 | | |
7186 | 7186 | | |
7187 | | - | |
7188 | | - | |
7189 | | - | |
7190 | 7187 | | |
7191 | 7188 | | |
7192 | 7189 | | |
7193 | 7190 | | |
7194 | 7191 | | |
| 7192 | + | |
7195 | 7193 | | |
7196 | 7194 | | |
7197 | 7195 | | |
| |||
7200 | 7198 | | |
7201 | 7199 | | |
7202 | 7200 | | |
7203 | | - | |
| 7201 | + | |
7204 | 7202 | | |
7205 | 7203 | | |
7206 | 7204 | | |
| |||
7215 | 7213 | | |
7216 | 7214 | | |
7217 | 7215 | | |
7218 | | - | |
| 7216 | + | |
7219 | 7217 | | |
7220 | 7218 | | |
7221 | 7219 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1206 | 1206 | | |
1207 | 1207 | | |
1208 | 1208 | | |
1209 | | - | |
1210 | 1209 | | |
1211 | 1210 | | |
1212 | 1211 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
436 | 436 | | |
437 | 437 | | |
438 | 438 | | |
439 | | - | |
440 | 439 | | |
441 | 440 | | |
442 | 441 | | |
| |||
449 | 448 | | |
450 | 449 | | |
451 | 450 | | |
452 | | - | |
453 | 451 | | |
454 | 452 | | |
455 | 453 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6428 | 6428 | | |
6429 | 6429 | | |
6430 | 6430 | | |
6431 | | - | |
6432 | 6431 | | |
6433 | 6432 | | |
6434 | 6433 | | |
| |||
6452 | 6451 | | |
6453 | 6452 | | |
6454 | 6453 | | |
6455 | | - | |
6456 | | - | |
6457 | | - | |
6458 | | - | |
6459 | 6454 | | |
6460 | 6455 | | |
6461 | 6456 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
213 | 213 | | |
214 | 214 | | |
215 | 215 | | |
216 | | - | |
217 | 216 | | |
218 | 217 | | |
219 | 218 | | |
| |||
248 | 247 | | |
249 | 248 | | |
250 | 249 | | |
251 | | - | |
252 | 250 | | |
253 | 251 | | |
254 | 252 | | |
255 | 253 | | |
| 254 | + | |
256 | 255 | | |
257 | 256 | | |
258 | 257 | | |
| |||
264 | 263 | | |
265 | 264 | | |
266 | 265 | | |
267 | | - | |
| 266 | + | |
268 | 267 | | |
269 | 268 | | |
270 | 269 | | |
| |||
276 | 275 | | |
277 | 276 | | |
278 | 277 | | |
279 | | - | |
280 | | - | |
| 278 | + | |
281 | 279 | | |
282 | 280 | | |
283 | 281 | | |
| |||
0 commit comments