      self.pid.pos_limit = accel_limits[1]
  
      # Update state machine
      output_accel = self.last_output_accel
      self.long_control_state = long_control_state_trans(CP, active, self.long_control_state, CS.vEgo,
                                                         v_target, v_target_future, CS.brakePressed,
                                                         CS.cruiseState.standstill)
  
      if self.long_control_state == LongCtrlState.off:
        self.reset(CS.vEgo)
 
</s> remove       if not CS.standstill or output_accel > CP.stopAccel:
        output_accel -= CP.stoppingDecelRate * DT_CTRL
 </s> add       if not CS.standstill or output_accel > self.CP.stopAccel:
        output_accel -= self.CP.stoppingDecelRate * DT_CTRL </s> remove   def update(self, active, CS, CP, long_plan, accel_limits, t_since_plan):
 </s> add   def update(self, active, CS, long_plan, accel_limits, t_since_plan): </s> remove                              k_f = CP.longitudinalTuning.kf, rate=1 / DT_CTRL)
 </s> add                              k_f=CP.longitudinalTuning.kf, rate=1 / DT_CTRL) </s> remove   def update(self, active, CS, CP, VM, params, last_actuators, desired_curvature, desired_curvature_rate, llk):
 </s> add   def update(self, active, CS, VM, params, last_actuators, desired_curvature, desired_curvature_rate, llk):
    self.long_control_state = long_control_state_trans(self.CP, active, self.long_control_state, CS.vEgo,
      self.pid.pos_limit = accel_limits[1]
  
      # Update state machine
      output_accel = self.last_output_accel
    self.long_control_state = long_control_state_trans(self.CP, active, self.long_control_state, CS.vEgo,
                                                         v_target, v_target_future, CS.brakePressed,
                                                         CS.cruiseState.standstill)
  
      if self.long_control_state == LongCtrlState.off:
        self.reset(CS.vEgo)
keep keep keep keep replace keep keep keep keep keep
 Clean up controllers (#24340)

* clean up lat controllers

* pass CP once

* sort 
selfdrive/controls/lib/longcontrol.py