Skip to content
  • Simon Ser's avatar
    lib/intel_reg: fix shift undefined behaviour · cc9a60c0
    Simon Ser authored
    
    
    1<<31 (same as 2<<30) is undefined behaviour in C. When compiling with
    GCC and UBSan, it gives this error:
    
    ../tools/intel_reg_decode.c: In function ‘ivb_debug_port’:
    ../tools/intel_reg_decode.c:398:3: error: case label does not reduce to an integer constant
       case PORT_DBG_DRRS_HW_STATE_HIGH:
       ^~~~
    
    This happens because 1<<31 isn't representable as a signed int. Instead,
    use an unsigned int.
    
    Signed-off-by: default avatarSimon Ser <simon.ser@intel.com>
    Reviewed-by: default avatarPetri Latvala <petri.latvala@intel.com>
    cc9a60c0