
Dear Christophe,
In message 622b8aec162cc43e774bde5da990a61fc961b4d9.1519976944.git.christophe.leroy@c-s.fr you wrote:
Function get_immr() is almost not used and doesn't bring much added value. Just replace it with mfspr(SPRN_IMMR) at the two needed places.
...
static int check_CPU(long clock, uint pvr, uint immr) {
- immap_t __iomem *immap = (immap_t __iomem *)(immr & 0xFFFF0000);
- immap_t __iomem *immap = (immap_t __iomem *)CONFIG_SYS_IMMR;
This is a totally unrelated change, which additionally changes the behaviour of the code - the content of the argument "immr" is now not longer used here.
If this is necessary / intentional, it should be a separate commit with proper explanation.
- uint immr = get_immr(0); /* Return full IMMR contents */
- immap_t __iomem *immap = (immap_t __iomem *)(immr & 0xFFFF0000);
- immap_t __iomem *immap = (immap_t __iomem *)CONFIG_SYS_IMMR;
Ditto here.
- uint immr = get_immr(0); /* Return full IMMR contents */
- immap_t __iomem *immap = (immap_t __iomem *)(immr & 0xFFFF0000);
- immap_t __iomem *immap = (immap_t __iomem *)CONFIG_SYS_IMMR;
And here again.
-#if defined(CONFIG_8xx) -static inline uint get_immr(uint mask) -{
- uint immr = mfspr(SPRN_IMMR);
- return mask ? (immr & mask) : immr;
-} -#endif
Actually, I do not see what you win by this "cleanup". In my opinion the function serves a good purpose; your code just becomes more difficult to understand.
Best regards,
Wolfgang Denk