From: Bjorn Helgaas <helgaas@kernel.org>
To: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Cc: Bjorn Helgaas <bhelgaas@google.com>,
linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] pci: consolidate typing of pci_error_handlers::error_detected()
Date: Mon, 29 Jun 2020 16:29:28 -0500 [thread overview]
Message-ID: <20200629212928.GA3296753@bjorn-Precision-5520> (raw)
In-Reply-To: <20200628161233.73079-1-luc.vanoostenryck@gmail.com>
On Sun, Jun 28, 2020 at 06:12:33PM +0200, Luc Van Oostenryck wrote:
> 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.
>
> So, consolidate everything by using the restricted type in the
> method's definition, in the documentation and in the drivers not
> using 'pci_channel_state_t'.
$ git grep "\<pci_channel_state\>"
Documentation/PCI/pci-error-recovery.rst: enum pci_channel_state {
Documentation/PCI/pci-error-recovery.rst:pci_channel_state value of pci_channel_io_perm_failure.
arch/powerpc/kernel/eeh_driver.c:static void eeh_set_channel_state(struct eeh_pe *root, enum pci_channel_state s)
drivers/net/ethernet/intel/ice/ice_main.c:ice_pci_err_detected(struct pci_dev *pdev, enum pci_channel_state err)
drivers/pci/pci.h: enum pci_channel_state state,
drivers/pci/pcie/err.c: enum pci_channel_state state,
drivers/pci/pcie/err.c: enum pci_channel_state state,
Should these be changed as well? If not, why not? Some of them look
analogous to the ones changed below.
> Note: Currently, from a typechecking point of view this patch change
> 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.
>
> Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
> ---
> Documentation/PCI/pci-error-recovery.rst | 2 +-
> drivers/block/rsxx/core.c | 2 +-
> drivers/dma/ioat/init.c | 2 +-
> drivers/media/pci/ngene/ngene-cards.c | 2 +-
> drivers/misc/genwqe/card_base.c | 2 +-
> drivers/net/ethernet/intel/i40e/i40e_main.c | 2 +-
> drivers/net/ethernet/intel/ixgb/ixgb_main.c | 4 ++--
> drivers/net/ethernet/sfc/efx.c | 2 +-
> drivers/net/ethernet/sfc/falcon/efx.c | 2 +-
> drivers/pci/pcie/portdrv_pci.c | 2 +-
> drivers/scsi/aacraid/linit.c | 2 +-
> drivers/scsi/sym53c8xx_2/sym_glue.c | 2 +-
> drivers/staging/qlge/qlge_main.c | 2 +-
> include/linux/pci.h | 2 +-
> 14 files changed, 15 insertions(+), 15 deletions(-)
next prev parent reply other threads:[~2020-06-29 21:29 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-28 16:12 Luc Van Oostenryck
2020-06-29 21:29 ` Bjorn Helgaas [this message]
2020-06-29 23:11 ` Luc Van Oostenryck
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200629212928.GA3296753@bjorn-Precision-5520 \
--to=helgaas@kernel.org \
--cc=bhelgaas@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=luc.vanoostenryck@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®