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-samsung-soc" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html