Move cast around in kernel macro