lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Thu,  2 Jul 2020 18:26:51 +0200
From:   Luc Van Oostenryck <luc.vanoostenryck@...il.com>
To:     Bjorn Helgaas <bhelgaas@...gle.com>
Cc:     linux-pci@...r.kernel.org, linux-kernel@...r.kernel.org,
        Luc Van Oostenryck <luc.vanoostenryck@...il.com>
Subject: [PATCH v2 3/3] pci: update to doc to use 'pci_channel_state_t'

The type used to describe the PCI channel state is a combination
of a bitwise typedef 'pci_channel_state_t' and an enumeration
of constant __force casted to this typedef: enum pci_channel_state.

It's a bit complex and quite ugly because:
* in C enums are weakly typed (they're essentially the same as 'int')
* sparse only allow to define bitwise ints, not bitwise enums.
But the idea is clearly to enforce typechecking and thus to
use 'pci_channel_state_t' everywhere.

So, update the documentation to use 'pci_chanell_state_t' and hide
'enum pci_channel_state' by showing a simplified but somehow equivalent
definition:
	typedef enum { ... } pci_channel_state_t;
which makes abstraction of the '__bitwise' which would otherwise
just bring unneeded complications here.

Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@...il.com>
---
 Documentation/PCI/pci-error-recovery.rst | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Documentation/PCI/pci-error-recovery.rst b/Documentation/PCI/pci-error-recovery.rst
index c055deec8c56..ccd713423133 100644
--- a/Documentation/PCI/pci-error-recovery.rst
+++ b/Documentation/PCI/pci-error-recovery.rst
@@ -87,11 +87,11 @@ This structure has the form::
 
 The possible channel states are::
 
-	enum pci_channel_state {
+	typedef enum {
 		pci_channel_io_normal,  /* I/O channel is in normal state */
 		pci_channel_io_frozen,  /* I/O to channel is blocked */
 		pci_channel_io_perm_failure, /* PCI card is dead */
-	};
+	} pci_channel_state_t;
 
 Possible return values are::
 
-- 
2.27.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ