Merge "hal: fix unsigned int overflow"