[PATCH 3/6] powerpc/powernv: Replace variables with flags

David Laight David.Laight at ACULAB.COM
Wed Jun 26 19:12:16 EST 2013


> We have 2 fields in "struct pnv_phb" to trace the states. The patch
> replace the fields with one and introduces flags for that. The patch
> doesn't impact the logic.

What is the benefit of this change?

...
> +
> +#define PNV_EEH_STATE_ENABLED	(1 << 0)	/* EEH enabled	*/
> +#define PNV_EEH_STATE_REMOVED	(1 << 1)	/* PHB removed	*/
> +
>  #endif /* CONFIG_EEH */
> 
>  struct pnv_phb {
> @@ -92,8 +96,7 @@ struct pnv_phb {
> 
>  #ifdef CONFIG_EEH
>  	struct pnv_eeh_ops	*eeh_ops;
> -	int			eeh_enabled;
> -	int			removed;
> +	int			eeh_state;
>  #endif
> 
>  #ifdef CONFIG_DEBUG_FS

All I can see is that it possibly reduces a structure by 4 bytes
while adding extra code.
(On 64 bit systems there might be a 4 byte pad added.)

	David





More information about the Linuxppc-dev mailing list