linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ARM:omap2: using strlcpy instead of strncpy
@ 2013-01-30 11:46 Chen Gang
  2013-02-01 22:45 ` Tony Lindgren
  2013-02-04  8:54 ` Peter Ujfalusi
  0 siblings, 2 replies; 11+ messages in thread
From: Chen Gang @ 2013-01-30 11:46 UTC (permalink / raw)
  To: linux-arm-kernel


  the fields must be null-terminated:
  the caller may use it as null-terminted string, next.

Signed-off-by: Chen Gang <gang.chen@asianux.com>
---
 arch/arm/mach-omap2/twl-common.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/arm/mach-omap2/twl-common.c b/arch/arm/mach-omap2/twl-common.c
index e49b40b..6a7aec6 100644
--- a/arch/arm/mach-omap2/twl-common.c
+++ b/arch/arm/mach-omap2/twl-common.c
@@ -23,6 +23,7 @@
 #include <linux/i2c.h>
 #include <linux/i2c/twl.h>
 #include <linux/gpio.h>
+#include <linux/string.h>
 #include <linux/regulator/machine.h>
 #include <linux/regulator/fixed.h>
 
@@ -56,7 +57,7 @@ void __init omap_pmic_init(int bus, u32 clkrate,
 			   struct twl4030_platform_data *pmic_data)
 {
 	omap_mux_init_signal("sys_nirq", OMAP_PIN_INPUT_PULLUP | OMAP_PIN_OFF_WAKEUPENABLE);
-	strncpy(pmic_i2c_board_info.type, pmic_type,
+	strlcpy(pmic_i2c_board_info.type, pmic_type,
 		sizeof(pmic_i2c_board_info.type));
 	pmic_i2c_board_info.irq = pmic_irq;
 	pmic_i2c_board_info.platform_data = pmic_data;
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2013-02-06  2:05 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-30 11:46 [PATCH] ARM:omap2: using strlcpy instead of strncpy Chen Gang
2013-02-01 22:45 ` Tony Lindgren
2013-02-02  2:25   ` Chen Gang
2013-02-02 18:07     ` Tony Lindgren
2013-02-04  1:17       ` Chen Gang
2013-02-04  9:00   ` Peter Ujfalusi
2013-02-04 18:18     ` Tony Lindgren
2013-02-05  2:18       ` Chen Gang
2013-02-05 18:56         ` Tony Lindgren
2013-02-06  2:05           ` Chen Gang
2013-02-04  8:54 ` Peter Ujfalusi

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).