  
      # Intention is to stop, switch to a different brake control until we stop
      elif self.long_control_state == LongCtrlState.stopping:
        # Keep applying brakes until the car is stopped
        if not CS.standstill or output_accel > CP.stopAccel:
          output_accel -= CP.stoppingDecelRate * DT_CTRL
        output_accel = clip(output_accel, accel_limits[0], accel_limits[1])
        self.reset(CS.vEgo)
  
      self.last_output_accel = output_accel
      final_accel = clip(output_accel, accel_limits[0], accel_limits[1])
 
</s> remove     self.long_control_state = long_control_state_trans(CP, active, self.long_control_state, CS.vEgo,
 </s> add     self.long_control_state = long_control_state_trans(self.CP, active, self.long_control_state, CS.vEgo, </s> remove       prevent_overshoot = not CP.stoppingControl and CS.vEgo < 1.5 and v_target_future < 0.7 and v_target_future < self.v_pid
      deadzone = interp(CS.vEgo, CP.longitudinalTuning.deadzoneBP, CP.longitudinalTuning.deadzoneV)
 </s> add       prevent_overshoot = not self.CP.stoppingControl and CS.vEgo < 1.5 and v_target_future < 0.7 and v_target_future < self.v_pid
      deadzone = interp(CS.vEgo, self.CP.longitudinalTuning.deadzoneBP, self.CP.longitudinalTuning.deadzoneV) </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       actuators.accel = self.LoC.update(CC.longActive, CS, self.CP, long_plan, pid_accel_limits, t_since_plan)
 </s> add       actuators.accel = self.LoC.update(CC.longActive, CS, long_plan, pid_accel_limits, t_since_plan)
      if not CS.standstill or output_accel > self.CP.stopAccel:
        output_accel -= self.CP.stoppingDecelRate * DT_CTRL
  
      # Intention is to stop, switch to a different brake control until we stop
      elif self.long_control_state == LongCtrlState.stopping:
        # Keep applying brakes until the car is stopped
      if not CS.standstill or output_accel > self.CP.stopAccel:
        output_accel -= self.CP.stoppingDecelRate * DT_CTRL
      if not CS.standstill or output_accel > self.CP.stopAccel:
        output_accel -= self.CP.stoppingDecelRate * DT_CTRL
        output_accel = clip(output_accel, accel_limits[0], accel_limits[1])
        self.reset(CS.vEgo)
  
      self.last_output_accel = output_accel
      final_accel = clip(output_accel, accel_limits[0], accel_limits[1])
keep keep keep keep replace replace keep keep keep keep keep
 Clean up controllers (#24340)

* clean up lat controllers

* pass CP once

* sort 
selfdrive/controls/lib/longcontrol.py