From: Tony Lindgren <tony@atomide.com>
To: Tero Kristo <t-kristo@ti.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: Sun, 3 Jul 2016 23:54:29 -0700 [thread overview]
Message-ID: <20160704065428.GS28140@atomide.com> (raw)
In-Reply-To: <1467292503-4376-3-git-send-email-t-kristo@ti.com>
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?
Regards,
Tony
WARNING: multiple messages have this Message-ID (diff)
From: tony@atomide.com (Tony Lindgren)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/5] ARM: OMAP2+: hwmod: fetch main_clk based on hwmod name
Date: Sun, 3 Jul 2016 23:54:29 -0700 [thread overview]
Message-ID: <20160704065428.GS28140@atomide.com> (raw)
In-Reply-To: <1467292503-4376-3-git-send-email-t-kristo@ti.com>
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?
Regards,
Tony
next prev parent reply other threads:[~2016-07-04 6:54 UTC|newest]
Thread overview: 20+ 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 ` 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:14 ` Tero Kristo
2016-06-30 13:15 ` [PATCH 2/5] ARM: OMAP2+: hwmod: fetch main_clk based on hwmod name Tero Kristo
2016-06-30 13:15 ` Tero Kristo
2016-07-04 6:54 ` Tony Lindgren [this message]
2016-07-04 6:54 ` Tony Lindgren
2016-07-04 9:17 ` Tero Kristo
2016-07-04 9:17 ` Tero Kristo
2016-07-04 11:11 ` [PATCHv2 " Tero Kristo
2016-07-04 11:11 ` Tero Kristo
2016-07-04 14:32 ` Tony Lindgren
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 ` 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 ` Tero Kristo
2016-06-30 13:15 ` [PATCH 5/5] ARM: AM33xx: fix module_wait_ready without clkctrl register Tero Kristo
2016-06-30 13:15 ` 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=20160704065428.GS28140@atomide.com \
--to=tony@atomide.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-omap@vger.kernel.org \
--cc=paul@pwsan.com \
--cc=t-kristo@ti.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 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.