usb: typec: tcpm: Fix undefined behavior due to shift overflowing the constant
authorBorislav Petkov <bp@suse.de>
Tue, 5 Apr 2022 15:15:13 +0000 (17:15 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 21 Apr 2022 16:33:56 +0000 (18:33 +0200)
commit8d084b2eae7fc5fcfc9f143cd7321a88e1cd76aa
treeb05ab9fd30581afcc9655289706976e4fc90c2df
parent9e3d68f872e4f5ce40dcc5baba7e37ab7961ed74
usb: typec: tcpm: Fix undefined behavior due to shift overflowing the constant

Fix:

  drivers/usb/typec/tcpm/tcpm.c: In function ‘run_state_machine’:
  drivers/usb/typec/tcpm/tcpm.c:4724:3: error: case label does not reduce to an integer constant
     case BDO_MODE_TESTDATA:
     ^~~~

See https://lore.kernel.org/r/YkwQ6%2BtIH8GQpuct@zn.tnic for the gory
details as to why it triggers with older gccs only.

Signed-off-by: Borislav Petkov <bp@suse.de>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-usb@vger.kernel.org
Link: https://lore.kernel.org/r/20220405151517.29753-8-bp@alien8.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
include/linux/usb/pd_bdo.h