[RFC 7/8] clk: use strncmp for matching con_id in clk_find

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxx>
Cc: Mike Turquette <mturquette@xxxxxxxxxx>
---
 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

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux