The _4_state_model and GE_state_model enum definitions are declared as struct members but are never read or written. Only the enum constants they define (TX_IN_GAP_PERIOD, GOOD_STATE, etc.) are used. Move them to file scope as anonymous enums and remove the unused struct fields, saving 8 bytes per netem instance. Signed-off-by: Stephen Hemminger --- net/sched/sch_netem.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/net/sched/sch_netem.c b/net/sched/sch_netem.c index dd98778ebbec..1957a15f6d1a 100644 --- a/net/sched/sch_netem.c +++ b/net/sched/sch_netem.c @@ -81,6 +81,18 @@ struct disttable { s16 table[] __counted_by(size); }; +enum GE_state_model { + GOOD_STATE = 1, + BAD_STATE, +}; + +enum _4_state_model { + TX_IN_GAP_PERIOD = 1, + TX_IN_BURST_PERIOD, + LOST_IN_GAP_PERIOD, + LOST_IN_BURST_PERIOD, +}; + struct netem_sched_data { /* internal t(ime)fifo qdisc uses t_root and sch->limit */ struct rb_root t_root; @@ -131,18 +143,6 @@ struct netem_sched_data { CLG_GILB_ELL, } loss_model; - enum { - TX_IN_GAP_PERIOD = 1, - TX_IN_BURST_PERIOD, - LOST_IN_GAP_PERIOD, - LOST_IN_BURST_PERIOD, - } _4_state_model; - - enum { - GOOD_STATE = 1, - BAD_STATE, - } GE_state_model; - /* Correlated Loss Generation models */ struct clgstate { /* state of the Markov chain */ -- 2.51.0