Etymology of making an adjective into a "Mc" name?

I’m putting this here because I’m pretty sure it came from a TV show. Anyone know where creating a “Mc” name from an adjective came from, e.g. Cranky McCrankerson? Just wondering…

Clearly it ultimately comes from the common Scottish surnames like McDonald, which is basically the equivalent of the English Donaldson.

Here’s on old discussion on it. Don’t think anything ever got resolved, but one of the early uses was in the W.C. Fields movie “The Bank Dick,” which had a characer Loudmouth McNasty.

Thanks. The search-foo is strong in you!