PCI: Use 'pci_channel_state_t' instead of 'enum pci_channel_state'
authorLuc Van Oostenryck <luc.vanoostenryck@gmail.com>
Thu, 2 Jul 2020 16:26:49 +0000 (18:26 +0200)
committerBjorn Helgaas <bhelgaas@google.com>
Tue, 7 Jul 2020 22:11:52 +0000 (17:11 -0500)
commit16d79cd4e23b1964d36c041ab027505ceacbbeeb
tree4c8ff0b08113aaafe4f55013a9843027535170be
parentb3a9e3b9622ae10064826dccb4f7a52bd88c7407
PCI: Use 'pci_channel_state_t' instead of 'enum pci_channel_state'

The method struct pci_error_handlers.error_detected() is defined and
documented as taking an 'enum pci_channel_state' for the second argument,
but most drivers use 'pci_channel_state_t' instead.

This 'pci_channel_state_t' is not a typedef for the enum but a typedef for
a bitwise type in order to have better/stricter typechecking.

Consolidate everything by using 'pci_channel_state_t' in the method's
definition, in the related helpers and in the drivers.

Enforce use of 'pci_channel_state_t' by replacing 'enum pci_channel_state'
with an anonymous 'enum'.

Note: Currently, from a typechecking point of view this patch changes
nothing because only the constants defined by the enum are bitwise, not the
enum itself (sparse doesn't have the notion of 'bitwise enum'). This may
change in some not too far future, hence the patch.

[bhelgaas: squash in
  https://lore.kernel.org/r/20200702162651.49526-3-luc.vanoostenryck@gmail.com
  https://lore.kernel.org/r/20200702162651.49526-4-luc.vanoostenryck@gmail.com]
Link: https://lore.kernel.org/r/20200702162651.49526-2-luc.vanoostenryck@gmail.com
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
18 files changed:
Documentation/PCI/pci-error-recovery.rst
arch/powerpc/kernel/eeh_driver.c
drivers/block/rsxx/core.c
drivers/dma/ioat/init.c
drivers/media/pci/ngene/ngene-cards.c
drivers/misc/genwqe/card_base.c
drivers/net/ethernet/intel/i40e/i40e_main.c
drivers/net/ethernet/intel/ice/ice_main.c
drivers/net/ethernet/intel/ixgb/ixgb_main.c
drivers/net/ethernet/sfc/efx.c
drivers/net/ethernet/sfc/falcon/efx.c
drivers/pci/pci.h
drivers/pci/pcie/err.c
drivers/pci/pcie/portdrv_pci.c
drivers/scsi/aacraid/linit.c
drivers/scsi/sym53c8xx_2/sym_glue.c
drivers/staging/qlge/qlge_main.c
include/linux/pci.h