These are extra CR line endings usually because of a using a file on mixed UNIX/DOS systems.
Possible the shortest answer to remove a single ^M from the end of each line, and what I use, is:
:%s/\r
which is equivalent to:
:%s/\r//
but the end slashes aren't required (they're assumed).