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 v2 0/3] pci: enforce usage of 'pci_channel_state_t'
Date: Tue, 7 Jul 2020 17:17:08 -0500 [thread overview]
Message-ID: <20200707221708.GA390968@bjorn-Precision-5520> (raw)
In-Reply-To: <20200702162651.49526-1-luc.vanoostenryck@gmail.com>
On Thu, Jul 02, 2020 at 06:26:48PM +0200, Luc Van Oostenryck wrote:
> The definition of pci_channel_io_normal and friends is relatively
> complicated and ugly:
> typedef unsigned int __bitwise pci_channel_state_t;
> enum pci_channel_state {
> pci_channel_io_normal = (__force pci_channel_state_t) 1,
> ...
> };
>
> This is clearly motivated by a desire to have some strong typing
> for this constants but:
> * in C enums are weakly typed (they're essentially the same as 'int')
> * sparse only allow to define bitwise ints, not bitwise enums.
>
> This series is a preparation step to introduce bitwise enums.
> This would allow to define these constant without having to use
> the force cast:
> enum __bitwise pci_channel_state {
> pci_channel_io_normal = 1,
> ...
> };
> or, equivalently:
> typedef enum __bitwise {
> pci_channel_io_normal = 1,
> ...
> } pci_channel_state_t;
>
>
> Note: the first patch is, I think, uncontroversial, the other ones
> less so but can be safely dropped.
>
>
> Changes since v1:
> * add missing conversion
> * try to avoid using 'enum pci_channel_state' in include/linux/pci.h
> * try to avoid using 'enum pci_channel_state' in the documentation
>
>
> Luc Van Oostenryck (3):
> pci: use 'pci_channel_state_t' instead of 'enum pci_channel_state'
> pci: use anonymous 'enum' instead of 'enum pci_channel_state'
> pci: update to doc to use 'pci_channel_state_t'
>
> Documentation/PCI/pci-error-recovery.rst | 8 ++++----
> arch/powerpc/kernel/eeh_driver.c | 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/ice/ice_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/pci.h | 2 +-
> drivers/pci/pcie/err.c | 4 ++--
> 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 | 4 ++--
> 18 files changed, 24 insertions(+), 24 deletions(-)
Since it's all basically "use pci_channel_state_t instead of enum
pci_channel_state", I squashed these all together and applied the
result to pci/error for v5.8, thanks!
prev parent reply other threads:[~2020-07-07 22:17 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-02 16:26 [PATCH v2 0/3] pci: enforce usage of 'pci_channel_state_t' Luc Van Oostenryck
2020-07-02 16:26 ` [PATCH v2 1/3] pci: use 'pci_channel_state_t' instead of 'enum pci_channel_state' Luc Van Oostenryck
2020-07-02 16:26 ` [PATCH v2 2/3] pci: use anonymous 'enum' " Luc Van Oostenryck
2020-07-02 16:26 ` [PATCH v2 3/3] pci: update to doc to use 'pci_channel_state_t' Luc Van Oostenryck
2020-07-07 22:17 ` Bjorn Helgaas [this message]
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=20200707221708.GA390968@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;
as well as URLs for NNTP newsgroup(s).