Re: [PATCH] mtd: fix mtd_blkdevs problem with caches on somearchitectures (2.6.31)

From: Ilya Loginov
Date: Sat Nov 21 2009 - 18:37:23 EST


> And then, in a .c file:
>
> #ifndef ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE
> #error "you lose"
> #endif
>
> and, of course:
>
> #if ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE
> <implement real code>
> #else
> <implement empty stubs>
> #endif
>
>
> This way
>
> a) the definition site for ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE is
> right next to the definition site for flush_dcache_page(), instead
> of being in some random remote file and
>
> b) people can't forget to implement ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE.
>
>
> Generally we prefer to avoid defining ARCH_HAS_FOO in header files and
> we prefer to control the definition in Kconfig. But it sounds like we
> have a special case here..
>

I agree. I think this is the best way. I will rewrite the patch.
Thank you!

--
Ilya Loginov <isloginov@xxxxxxxxx>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/