Doing anything now won't fix the situation.
You said that you don't regret it - I urge you not do it again. He is very young.
When I was younger - late primary school years and early high school years, I was pretty fucked up. Someone who deserved to get run over by a bus. I hurt people - in fucked up emotional ways. Way worse than that 5 year old did to annoy you.
Kids are kids. They are idiots. Don't traumatize him. Do your best to avoid him or tell his parent, but people really do change a lot - especially with people who support them. A child is does not represent themselves as a person until they grow older.
Don't continue to smack him or he will become a bad person growing up.