hal: fix compilation error

Add type casts to avoid operations with mismatched types

CRs-Fixed: 2129300
Change-Id: I6d96a87561f802d8b9d8e37cd2f8148c1ed945aa
1 file changed