Linux Samsung SOC development
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: linux-arm-kernel@lists.infradead.org
Cc: amit daniel kachhap <amit.daniel@samsung.com>,
	Daniel Lezcano <daniel.lezcano@linaro.org>,
	Kukjin Kim <kgene.kim@samsung.com>,
	David Riley <davidriley@chromium.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Doug Anderson <dianders@chromium.org>,
	"linux-samsung-soc@vger.kernel.org"
	<linux-samsung-soc@vger.kernel.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Tomasz Figa <tomasz.figa@gmail.com>
Subject: Re: [PATCH v2] clocksource: exynos-mct: Register the timer for stable udelay
Date: Thu, 19 Jun 2014 12:29:55 +0200	[thread overview]
Message-ID: <4808230.DmzmRfAocp@wuerfel> (raw)
In-Reply-To: <CADGdYn6YObHdRq6A9-L7qbD+EYiPrwhrKkLwyA5Z=0tDoWUzvA@mail.gmail.com>

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

  reply	other threads:[~2014-06-19 10:30 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-19  8:39 [PATCH v2] clocksource: exynos-mct: Register the timer for stable udelay Amit Daniel Kachhap
2014-06-19  9:11 ` Daniel Lezcano
2014-06-19 10:21   ` amit daniel kachhap
2014-06-19 10:29     ` Arnd Bergmann [this message]
2014-06-19 10:30     ` Daniel Lezcano
2014-06-19 11:00       ` amit daniel kachhap
2014-06-19 10:21 ` Tomasz Figa
2014-06-19 16:01   ` Doug Anderson
2014-06-19 16:17     ` Tomasz Figa
2014-06-19 16:31       ` Doug Anderson
2014-06-19 16:40         ` Tomasz Figa
2014-06-20  8:15           ` Will Deacon
2014-06-20 11:19             ` amit daniel kachhap
2014-06-20 17:47               ` Doug Anderson
2014-06-21  9:53                 ` amit daniel kachhap

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4808230.DmzmRfAocp@wuerfel \
    --to=arnd@arndb.de \
    --cc=amit.daniel@samsung.com \
    --cc=daniel.lezcano@linaro.org \
    --cc=davidriley@chromium.org \
    --cc=dianders@chromium.org \
    --cc=kgene.kim@samsung.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=tglx@linutronix.de \
    --cc=tomasz.figa@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox