It is not illegal to "spank" your child but child abuse and child endangerment are illegal. Think of it this way; if you saw someone pat their child's rear end in a grocery store to encourage them to behave, would you call the police? No, probably not. On the other hand, if you saw someone wind up and crank their child across the face for crying, would you? Probably so. You will not find a "bright line" in any statute or law book about what is acceptable or not acceptable but I think reasonable people understand the difference. Just to be safe, you should consider an alternative form of disipline that does not involve hitting your child, If you do that, the answer to the question becomes irrelevant, at least with respect to you and your child.
It is not illegal to spank a child, however you should always be in control of your emotions, that is do not cross the line - don't exceed the physical act of discipline by causing additional harm. A simple smack on the bottom is a lot different from whipping a child with a wooden stick or placing glue on a child's eye lids (actual cases where the parent thought their acts were a form of discipline)