For what processes is Mayer's formula applicable? I know that

$$C_p - C_V = R, \label{eqn:1}\tag{1}$$

but I have also seen

$$C_p - C_V = R/M \label{eqn:2}\tag{2}$$

being used in case of ideal gas.
In what cases \eqref{eqn:1} is used and in what cases \eqref{eqn:2} is used?
The former difference is for molar heat capacity in J/K/mol, the latter for specific heat capacity J/K/kg, or J/K/g, depending on M unit.