[uClinux-dev] [PATCH 4/8] m68knommu: clean up ColdFire CACHE control code

Philippe De Muyter phdm at macqel.be
Thu Nov 11 04:01:19 EST 2010


Hi Greg,

On Thu, Nov 11, 2010 at 11:48:42AM +1000, Greg Ungerer wrote:
...
> +#ifdef CONFIG_COLDFIRE_SW_A7
> +#define CACHE_INIT	(CACR_CINV + CACR_DISD)
> +#define CACHE_MODE	(CACR_CENB + CACR_DISD + CACR_DCM)
> +#else
> +#define CACHE_INIT	(CACR_CINV + CACR_DISD + CACR_EUSP)
> +#define CACHE_MODE	(CACR_CENB + CACR_DISD + CACR_DCM + CACR_EUSP)
> +#endif

Wouldn't that be more maintainable as :

#ifdef CONFIG_COLDFIRE_SW_A7
#define USERA7_MODE	0
#else
#define USERA7_MODE	CACR_EUSP
#endif

#define CACHE_INIT	(CACR_CINV + CACR_DISD + USERA7_MODE)
#define CACHE_MODE	(CACR_CENB + CACR_DISD + CACR_DCM + USERA7_MODE)

Philippe



More information about the uClinux-dev mailing list