]> Git Repo - qemu.git/commitdiff
tpm: avoid clang shifting negative signed warning
authorStefan Hajnoczi <[email protected]>
Tue, 10 Nov 2015 15:57:34 +0000 (15:57 +0000)
committerStefan Hajnoczi <[email protected]>
Tue, 17 Nov 2015 10:35:56 +0000 (18:35 +0800)
clang 3.7.0 on x86_64 warns about the following:

  hw/tpm/tpm_tis.c:1000:36: warning: shifting a negative signed value is undefined [-Wshift-negative-value]
            tis->loc[c].iface_id = TPM_TIS_IFACE_ID_SUPPORTED_FLAGS1_3;
                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  hw/tpm/tpm_tis.c:144:10: note: expanded from macro 'TPM_TIS_IFACE_ID_SUPPORTED_FLAGS1_3'
     (~0 << 4)/* all of it is don't care */)
      ~~ ^

Signed-off-by: Stefan Hajnoczi <[email protected]>
hw/tpm/tpm_tis.c

index 0806b5f82e4c3b8b04f0d632762b21e161a063ac..ff073d501a7af67b4b1285b4e6c44e3d1af1dc0d 100644 (file)
 
 #define TPM_TIS_IFACE_ID_SUPPORTED_FLAGS1_3 \
     (TPM_TIS_IFACE_ID_INTERFACE_TIS1_3 | \
-     (~0 << 4)/* all of it is don't care */)
+     (~0u << 4)/* all of it is don't care */)
 
 /* if backend was a TPM 2.0: */
 #define TPM_TIS_IFACE_ID_SUPPORTED_FLAGS2_0 \
This page took 0.028297 seconds and 4 git commands to generate.