Deductions & credits

If you have a HDHP plan with HSA that ended on the prior calendar year and contributed funds to that HSA until April/tax filing date of next calendar year, what is the appropriate way to file for this scenario? Technically the plan ended in the prior calendar year and one was not covered in the plan from Jan - April of following year - how does one account for this without being penalized since contributing up until April is allowed. Thank you so much!