[PATCH 1/7]: PCI revised (2) [PATCH 16/42]: PCI: PCI Error reporting callbacks

Greg KH greg at kroah.com
Tue Nov 8 08:37:29 EST 2005


On Mon, Nov 07, 2005 at 03:21:28PM -0600, linas wrote:
> +typedef int __bitwise pci_channel_state_t;

Closer but...

>  enum pci_channel_state {
> -	pci_channel_io_normal = 0,	/* I/O channel is in normal state */
> -	pci_channel_io_frozen = 1,	/* I/O to channel is blocked */
> -	pci_channel_io_perm_failure,	/* PCI card is dead */
> +	pci_channel_io_normal = (__force pci_channel_state_t) 0,	/* I/O channel is in normal state */
> +	pci_channel_io_frozen = (__force pci_channel_state_t) 1,	/* I/O to channel is blocked */
> +	pci_channel_io_perm_failure = (__force pci_channel_state_t) 2,	/* PCI card is dead */
>  };

You don't have to use an enum anymore, just use a #define.

Sparse developers, I see code in the kernel that that does both 
(__force foo_t) and (foo_t __force).  Which one is correct?


> +typedef int __bitwise pers_result_t;

Ugh, I don't like that name, but I can't think of anything better right
now.  You should at least keep "pci" at the beginning to make it make
more sense to people looking at it for the first time.

thanks,

greg k-h



More information about the Linuxppc64-dev mailing list