From: Tero Kristo <t-kristo@ti.com>
To: Tony Lindgren <tony@atomide.com>
Cc: paul@pwsan.com, linux-omap@vger.kernel.org,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 2/5] ARM: OMAP2+: hwmod: fetch main_clk based on hwmod name
Date: Mon, 4 Jul 2016 12:17:57 +0300 [thread overview]
Message-ID: <577A29C5.3010209@ti.com> (raw)
In-Reply-To: <20160704065428.GS28140@atomide.com>
On 04/07/16 09:54, Tony Lindgren wrote:
> Hi,
>
> * Tero Kristo <t-kristo@ti.com> [160630 06:18]:
>> With the transition to hwmod module clocks, all hwmods will have
>> their main clocks named <hwmod_name>_mod_ck. Use this info to
>> fetch main_clk, and use it if found.
> ..
>
>> static int _init_main_clk(struct omap_hwmod *oh)
>> {
>> int ret = 0;
>> + char name[32];
>> + static int max_len;
>> + struct clk *clk;
>>
>> - if (!oh->main_clk)
>> - return 0;
>> + strcpy(name, oh->name);
>> + strcat(name, "_mod_ck");
>> +
>> + if (strlen(name) > max_len)
>> + max_len = strlen(name);
>
> Just noticed that this needs some improvments to avoid nasty
> bugs early on. You don't seem to have max_len defined, and
> you should do a strncpy using #define MOD_CLK_MAX_LEN (32 + 7)
> or something similar instead of the strcpy and leave room for
> the strcat.
>
> Care to update and repost just this one?
Yeah, let me fix this and repost a bit later today.
-Tero
next prev parent reply other threads:[~2016-07-04 9:17 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-30 13:14 [PATCH 0/5] ARM: OMAP2+: hwmod/clk related fixes Tero Kristo
2016-06-30 13:14 ` [PATCH 1/5] ARM: OMAP2+: omap_device: create clock alias purely from DT data Tero Kristo
2016-06-30 13:15 ` [PATCH 2/5] ARM: OMAP2+: hwmod: fetch main_clk based on hwmod name Tero Kristo
2016-07-04 6:54 ` Tony Lindgren
2016-07-04 9:17 ` Tero Kristo [this message]
2016-07-04 11:11 ` [PATCHv2 " Tero Kristo
2016-07-04 14:32 ` Tony Lindgren
2016-06-30 13:15 ` [PATCH 3/5] ARM: OMAP2+: timer: change order of hwmod data handling Tero Kristo
2016-06-30 13:15 ` [PATCH 4/5] ARM: OMAP2+: clockdomain: add usecounting support to autoidle APIs Tero Kristo
2016-06-30 13:15 ` [PATCH 5/5] ARM: AM33xx: fix module_wait_ready without clkctrl register Tero Kristo
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=577A29C5.3010209@ti.com \
--to=t-kristo@ti.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-omap@vger.kernel.org \
--cc=paul@pwsan.com \
--cc=tony@atomide.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;
as well as URLs for NNTP newsgroup(s).