As git-grep shows, open_softirq() is always called with the last argument being NULL block/blk-core.c: open_softirq(BLOCK_SOFTIRQ, blk_done_softirq, NULL); kernel/hrtimer.c: open_softirq(HRTIMER_SOFTIRQ, run_hrtimer_softirq, NULL); kernel/rcuclassic.c: open_softirq(RCU_SOFTIRQ, rcu_process_callbacks, NULL); kernel/rcupreempt.c: open_softirq(RCU_SOFTIRQ, rcu_process_callbacks, NULL); kernel/sched.c: open_softirq(SCHED_SOFTIRQ, run_rebalance_domains, NULL); kernel/softirq.c: open_softirq(TASKLET_SOFTIRQ, tasklet_action, NULL); kernel/softirq.c: open_softirq(HI_SOFTIRQ, tasklet_hi_action, NULL); kernel/timer.c: open_softirq(TIMER_SOFTIRQ, run_timer_softirq, NULL); net/core/dev.c: open_softirq(NET_TX_SOFTIRQ, net_tx_action, NULL); net/core/dev.c: open_softirq(NET_RX_SOFTIRQ, net_rx_action, NULL); This observation has already been made by Matthew Wilcox in June 2002 (http://www.cs.helsinki.fi/linux/linux-kernel/2002-25/0687.html) "I notice that none of the current softirq routines use the data element passed to them." and the situation hasn't changed since them. So it appears we can safely remove that extra argument to save 128 (54) bytes of kernel data (text).
Unified · Split
| @@ -2048,7 +2048,7 @@ int __init blk_dev_init(void) · 2047 unmodified lines | ||
| 2048 | 2048 | for_each_possible_cpu(i) |
| 2049 | 2049 | INIT_LIST_HEAD(&per_cpu(blk_cpu_done, i)); |
| 2050 | 2050 | |
| 2051 | − open_softirq(BLOCK_SOFTIRQ, blk_done_softirq, NULL); | |
| 2051 | + open_softirq(BLOCK_SOFTIRQ, blk_done_softirq); | |
| 2052 | 2052 | register_hotcpu_notifier(&blk_cpu_notifier); |
| 2053 | 2053 | |
| 2054 | 2054 | return 0; |
| @@ -285,12 +285,11 @@ enum · 284 unmodified lines | ||
| 285 | 285 | struct softirq_action |
| 286 | 286 | { |
| 287 | 287 | void (*action)(struct softirq_action *); |
| 288 | − void *data; | |
| 289 | 288 | }; |
| 290 | 289 | |
| 291 | 290 | asmlinkage void do_softirq(void); |
| 292 | 291 | asmlinkage void __do_softirq(void); |
| 293 | −extern void open_softirq(int nr, void (*action)(struct softirq_action*), void *data); | |
| 292 | +extern void open_softirq(int nr, void (*action)(struct softirq_action *)); | |
| 294 | 293 | extern void softirq_init(void); |
| 295 | 294 | #define __raise_softirq_irqoff(nr) do { or_softirq_pending(1UL << (nr)); } while (0) |
| 296 | 295 | extern void raise_softirq_irqoff(unsigned int nr); |
| @@ -1669,7 +1669,7 @@ void __init hrtimers_init(void) · 1668 unmodified lines | ||
| 1669 | 1669 | (void *)(long)smp_processor_id()); |
| 1670 | 1670 | register_cpu_notifier(&hrtimers_nb); |
| 1671 | 1671 | #ifdef CONFIG_HIGH_RES_TIMERS |
| 1672 | − open_softirq(HRTIMER_SOFTIRQ, run_hrtimer_softirq, NULL); | |
| 1672 | + open_softirq(HRTIMER_SOFTIRQ, run_hrtimer_softirq); | |
| 1673 | 1673 | #endif |
| 1674 | 1674 | } |
| 1675 | 1675 | |
| @@ -529,7 +529,7 @@ static void __cpuinit rcu_online_cpu(int cpu) · 528 unmodified lines | ||
| 529 | 529 | |
| 530 | 530 | rcu_init_percpu_data(cpu, &rcu_ctrlblk, rdp); |
| 531 | 531 | rcu_init_percpu_data(cpu, &rcu_bh_ctrlblk, bh_rdp); |
| 532 | − open_softirq(RCU_SOFTIRQ, rcu_process_callbacks, NULL); | |
| 532 | + open_softirq(RCU_SOFTIRQ, rcu_process_callbacks); | |
| 533 | 533 | } |
| 534 | 534 | |
| 535 | 535 | static int __cpuinit rcu_cpu_notify(struct notifier_block *self, |
| @@ -1125,7 +1125,7 @@ void __init __rcu_init(void) · 1124 unmodified lines | ||
| 1125 | 1125 | for_each_online_cpu(cpu) |
| 1126 | 1126 | rcu_cpu_notify(&rcu_nb, CPU_UP_PREPARE, (void *)(long) cpu); |
| 1127 | 1127 | |
| 1128 | − open_softirq(RCU_SOFTIRQ, rcu_process_callbacks, NULL); | |
| 1128 | + open_softirq(RCU_SOFTIRQ, rcu_process_callbacks); | |
| 1129 | 1129 | } |
| 1130 | 1130 | |
| 1131 | 1131 | /* |
| @@ -8154,7 +8154,7 @@ void __init sched_init(void) · 8153 unmodified lines | ||
| 8154 | 8154 | #endif |
| 8155 | 8155 | |
| 8156 | 8156 | #ifdef CONFIG_SMP |
| 8157 | − open_softirq(SCHED_SOFTIRQ, run_rebalance_domains, NULL); | |
| 8157 | + open_softirq(SCHED_SOFTIRQ, run_rebalance_domains); | |
| 8158 | 8158 | #endif |
| 8159 | 8159 | |
| 8160 | 8160 | #ifdef CONFIG_RT_MUTEXES |
| @@ -347,9 +347,8 @@ void raise_softirq(unsigned int nr) · 346 unmodified lines | ||
| 347 | 347 | local_irq_restore(flags); |
| 348 | 348 | } |
| 349 | 349 | |
| 350 | −void open_softirq(int nr, void (*action)(struct softirq_action*), void *data) | |
| 350 | +void open_softirq(int nr, void (*action)(struct softirq_action *)) | |
| 351 | 351 | { |
| 352 | − softirq_vec[nr].data = data; | |
| 353 | 352 | softirq_vec[nr].action = action; |
| 354 | 353 | } |
| 355 | 354 | |
| @@ -503,8 +502,8 @@ void __init softirq_init(void) · 147 unmodified lines | ||
| 503 | 502 | &per_cpu(tasklet_hi_vec, cpu).head; |
| 504 | 503 | } |
| 505 | 504 | |
| 506 | − open_softirq(TASKLET_SOFTIRQ, tasklet_action, NULL); | |
| 507 | − open_softirq(HI_SOFTIRQ, tasklet_hi_action, NULL); | |
| 505 | + open_softirq(TASKLET_SOFTIRQ, tasklet_action); | |
| 506 | + open_softirq(HI_SOFTIRQ, tasklet_hi_action); | |
| 508 | 507 | } |
| 509 | 508 | |
| 510 | 509 | static int ksoftirqd(void * __bind_cpu) |
| @@ -1502,7 +1502,7 @@ void __init init_timers(void) · 1501 unmodified lines | ||
| 1502 | 1502 | |
| 1503 | 1503 | BUG_ON(err == NOTIFY_BAD); |
| 1504 | 1504 | register_cpu_notifier(&timers_nb); |
| 1505 | − open_softirq(TIMER_SOFTIRQ, run_timer_softirq, NULL); | |
| 1505 | + open_softirq(TIMER_SOFTIRQ, run_timer_softirq); | |
| 1506 | 1506 | } |
| 1507 | 1507 | |
| 1508 | 1508 | /** |
| @@ -4563,8 +4563,8 @@ static int __init net_dev_init(void) · 4562 unmodified lines | ||
| 4563 | 4563 | |
| 4564 | 4564 | dev_boot_phase = 0; |
| 4565 | 4565 | |
| 4566 | − open_softirq(NET_TX_SOFTIRQ, net_tx_action, NULL); | |
| 4567 | − open_softirq(NET_RX_SOFTIRQ, net_rx_action, NULL); | |
| 4566 | + open_softirq(NET_TX_SOFTIRQ, net_tx_action); | |
| 4567 | + open_softirq(NET_RX_SOFTIRQ, net_rx_action); | |
| 4568 | 4568 | |
| 4569 | 4569 | hotcpu_notifier(dev_cpu_callback, 0); |
| 4570 | 4570 | dst_init(); |