All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tero Kristo <t-kristo@ti.com>
To: linux-omap@vger.kernel.org, tony@atomide.com, khilman@linaro.org,
	paul@pwsan.com
Cc: linux-arm-kernel@lists.infradead.org,
	Mike Turquette <mturquette@linaro.org>
Subject: [RFC 7/8] clk: use strncmp for matching con_id in clk_find
Date: Thu, 21 Mar 2013 19:35:46 +0200	[thread overview]
Message-ID: <1363887347-4686-8-git-send-email-t-kristo@ti.com> (raw)
In-Reply-To: <1363887347-4686-1-git-send-email-t-kristo@ti.com>

As clkdev register forces the con_id length down to a maximum of 15
characters and terminating null, replace the internal implementation
of clk_find to use strncmp instead of strcmp. This makes sure that
if a user registers a clkdev with con_id name which gets trimmed,
the same string used in the clk_lookup will still succeed despite
this.

Signed-off-by: Tero Kristo <t-kristo@ti.com>
Cc: Mike Turquette <mturquette@linaro.org>
---
 drivers/clk/clkdev.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/clk/clkdev.c b/drivers/clk/clkdev.c
index 442a313..05b01a1 100644
--- a/drivers/clk/clkdev.c
+++ b/drivers/clk/clkdev.c
@@ -120,7 +120,7 @@ static struct clk_lookup *clk_find(const char *dev_id, const char *con_id)
 			match += 2;
 		}
 		if (p->con_id) {
-			if (!con_id || strcmp(p->con_id, con_id))
+			if (!con_id || strncmp(p->con_id, con_id, 15))
 				continue;
 			match += 1;
 		}
-- 
1.7.4.1


  parent reply	other threads:[~2013-03-21 17:37 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-21 17:35 [RFC 0/8]: omap4: clk: move clock data under drivers/clk Tero Kristo
2013-03-21 17:35 ` Tero Kristo
2013-03-21 17:35 ` [RFC 1/8] RFC: CLK: OMAP: Add basic infrastructure for OMAP clocks Tero Kristo
2013-03-21 18:50   ` Mike Turquette
2013-03-21 18:50     ` Mike Turquette
2013-03-22  8:39     ` Tero Kristo
2013-03-22  8:39       ` Tero Kristo
2013-03-22 16:47       ` Mike Turquette
2013-03-22 16:47         ` Mike Turquette
2013-03-22 18:39         ` Tero Kristo
2013-03-22 18:39           ` Tero Kristo
2013-03-22 20:01           ` Mike Turquette
2013-03-22 20:01             ` Mike Turquette
2013-03-21 17:35 ` [RFC 3/8] CLK: OMAP4: Clock header register declarations to struct Tero Kristo
2013-03-21 17:35 ` [RFC 4/8] CLK: OMAP4: copy over cclock44xx_data.c file from mach-omap2 Tero Kristo
2013-03-21 17:35 ` [RFC 5/8] CLK: OMAP4: modify clock data layout for the new driver format Tero Kristo
2013-03-21 17:35 ` [RFC 6/8] CLK: OMAP4: add support for the new clock init code Tero Kristo
2013-03-21 17:35 ` Tero Kristo [this message]
2013-03-21 17:35 ` [RFC 8/8] ARM: OMAP4: use new driver for omap4 clock data Tero Kristo
2013-03-22  5:28 ` [RFC 0/8]: omap4: clk: move clock data under drivers/clk Rajendra Nayak
2013-03-22  5:28   ` Rajendra Nayak
2013-03-22  9:32   ` Tero Kristo
2013-03-22  9:32     ` 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=1363887347-4686-8-git-send-email-t-kristo@ti.com \
    --to=t-kristo@ti.com \
    --cc=khilman@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=mturquette@linaro.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 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.