Re: [PATCH v2] clocksource: exynos-mct: Register the timer for stable udelay

From: Arnd Bergmann
Date: Thu Jun 19 2014 - 06:30:16 EST


On Thursday 19 June 2014 15:51:58 amit daniel kachhap wrote:
> I also didn't want to use macros but used as a last option. you want
> me to put more comments here?
> Or something like below is also possible for checking the size of
> (unsigned long) in runtime.
>
> unsigned long x;
> unsigned int size = (char *)(&x + 1) - (char *)(&x);

reimplementing "sizeof (long)"?

> if (size == 4)
> return __raw_readl(reg_base + EXYNOS4_MCT_G_CNT_L);

readl_relaxed(), certainly

> else
> return exynos4_frc_read(&mct_frc);
>
> But this involves extra computation which should not be used for time
> critical functions.

sizeof is a constant expression, the compiler will optimize this.

Arnd
--
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/