Subject: Re: [PATCH 1/6] powerpc/eeh: Refactor EEH flag accessors

From: Gavin Shan <[email-masked]>
Date: Wed, 16 Jul 2014 22:10:43 +1000

On Wed, Jul 16, 2014 at 08:24:49AM +0000, David Laight wrote:
>From: Gavin Shan
>> There are multiple global EEH flags. Almost each flag has its own
>> accessor, which doesn't make sense. The patch refactors EEH flag
>> accessors so that they look unified:
>> 
>>   eeh_add_flag():   Add EEH flag
>
>eeh_set_flag() ??
>

I guess it's reasonable to keep eeh_add_flag(). eeh_set_flag() overwrites
the flags we had. I steal them from include/asm-generic/pci-bridge.h:

pci_set_flag()
pci_add_flag()
pci_clear_flag()

>>   eeh_clear_flag(): Clear EEH flag
>>   eeh_has_flag():   Check if one specific flag has been set
>
>Personally I find these sort of 'accessor' functions rather pointless.
>

Indeed, but it makes the code a bit clean. I needn't access
the global variable for flags directly.

Thanks,
Gavin

>	David