gateway: simplify gw_default_calc_threshold