From: Paul Mundt <lethal@linux-sh.org>
To: Julia Lawall <julia.lawall@lip6.fr>
Cc: linux-sh@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: clk dereference in arch/sh/kernel/cpufreq.c
Date: Thu, 10 Jan 2013 08:59:24 +0000 [thread overview]
Message-ID: <20130110085923.GA7785@linux-sh.org> (raw)
In-Reply-To: <alpine.DEB.2.02.1301031038030.1989@hadrien>
On Thu, Jan 03, 2013 at 10:40:20AM +0100, Julia Lawall wrote:
> There has been a discussion recently about how the result of get_clk
> should be an opaque handle, not a value that can be dereferenced:
>
> https://lkml.org/lkml/2012/12/20/105
>
> There is such a dereference in arch/sh/kernel/cpufreq.c, in the function
> sh_cpufreq_cpu_init:
>
> freq_table = cpuclk->nr_freqs ? cpuclk->freq_table : NULL;
>
> It was not obvious to me, however, what API function should be used
> instead, so I am just reporting the (potential) problem.
>
In this case we would have to add some new API for fetching the frequency
table associated with the struct clk, which is reasonably
straightforward. It's not obvious how a private API vs deref of a type we
have a private definition for is any better or worse, though. This code
is not aimed at the common struct clk in any event.
WARNING: multiple messages have this Message-ID (diff)
From: Paul Mundt <lethal@linux-sh.org>
To: Julia Lawall <julia.lawall@lip6.fr>
Cc: linux-sh@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: clk dereference in arch/sh/kernel/cpufreq.c
Date: Thu, 10 Jan 2013 17:59:24 +0900 [thread overview]
Message-ID: <20130110085923.GA7785@linux-sh.org> (raw)
In-Reply-To: <alpine.DEB.2.02.1301031038030.1989@hadrien>
On Thu, Jan 03, 2013 at 10:40:20AM +0100, Julia Lawall wrote:
> There has been a discussion recently about how the result of get_clk
> should be an opaque handle, not a value that can be dereferenced:
>
> https://lkml.org/lkml/2012/12/20/105
>
> There is such a dereference in arch/sh/kernel/cpufreq.c, in the function
> sh_cpufreq_cpu_init:
>
> freq_table = cpuclk->nr_freqs ? cpuclk->freq_table : NULL;
>
> It was not obvious to me, however, what API function should be used
> instead, so I am just reporting the (potential) problem.
>
In this case we would have to add some new API for fetching the frequency
table associated with the struct clk, which is reasonably
straightforward. It's not obvious how a private API vs deref of a type we
have a private definition for is any better or worse, though. This code
is not aimed at the common struct clk in any event.
next prev parent reply other threads:[~2013-01-10 8:59 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-03 9:40 clk dereference in arch/sh/kernel/cpufreq.c Julia Lawall
2013-01-03 9:40 ` Julia Lawall
2013-01-10 8:59 ` Paul Mundt [this message]
2013-01-10 8:59 ` Paul Mundt
2013-01-10 9:31 ` Julia Lawall
2013-01-10 9:31 ` Julia Lawall
2013-01-10 13:18 ` Paul Mundt
2013-01-10 13:18 ` Paul Mundt
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=20130110085923.GA7785@linux-sh.org \
--to=lethal@linux-sh.org \
--cc=julia.lawall@lip6.fr \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sh@vger.kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.