This also avoids a UBsan warning of "left shift of negative values". Change-Id: Ifb8d74218b1c0bc7b924e752442de0ba1b50a869