lkml.org 
[lkml]   [2014]   [Jun]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH v2] clocksource: exynos-mct: Register the timer for stable udelay
Date
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


\
 
 \ /
  Last update: 2014-06-19 13:21    [from the cache]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and my Meterkast|Read the blog