Skip to contentSkip to conversation

ARM:omap2: using strlcpy instead of strncpy

PATCH New Chen Gang 3 participants 11 messages Jan 30, 2013 – Feb 6, 2013

Subsystems (3)
lore
Share & tools
lore

Chen Gang

author
#0 lore raw

PATCH 1/1 ARM:omap2: using strlcpy instead of strncpy

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

---
 arch/arm/mach-omap2/twl-common.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
arch/arm/mach-omap2/twl-common.c +2 -1
index e49b40b..6a7aec6 100644
@@ -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;
Signature · 1 line
1.7.10.4
maintainer
#1 lore raw

PATCH 1/1 ARM:omap2: using strlcpy instead of strncpy

Quoted 3 lines · Chen Gang

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

Added Peter to cc on this one too, it's best that he queues all the twl changes.

Tony

Quoted 28 lines
---
 arch/arm/mach-omap2/twl-common.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
arch/arm/mach-omap2/twl-common.c +2 -1
index e49b40b..6a7aec6 100644
@@ -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;
Signature · 1 line
1.7.10.4
author
#2 lore raw

PATCH 1/1 ARM:omap2: using strlcpy instead of strncpy

? 2013?02?02? 06:45, Tony Lindgren ??:

Quoted 2 lines

Added Peter to cc on this one too, it's best that he queues all the twl changes.

is it suitable to sync the MAINTAINER file for it ?
if suitable, can you help to change it ?

thanks.

Signature · 3 lines
Chen Gang

Asianux Corporation
maintainer
#3 lore raw

PATCH 1/1 ARM:omap2: using strlcpy instead of strncpy

Quoted 6 lines · Chen Gang

? 2013?02?02? 06:45, Tony Lindgren ??:

Quoted 2 lines

Added Peter to cc on this one too, it's best that he queues all the twl changes.

is it suitable to sync the MAINTAINER file for it ?
if suitable, can you help to change it ?

Yes I suggest we add Peter as the maintainer for all twl related things.

Regards,

Tony

author
#4 lore raw

PATCH 1/1 ARM:omap2: using strlcpy instead of strncpy

? 2013?02?03? 02:07, Tony Lindgren ??:

Quoted 10 lines
Quoted 2 lines

is it suitable to sync the MAINTAINER file for it ?

Quoted 1 line

if suitable, can you help to change it ?

Yes I suggest we add Peter as the maintainer for all twl related things.

Regards,

Tony

ok, thanks.

by the way:
if necessary (not find another suitable members to sync it), I should
sync it (since I found it)

Signature · 3 lines
Chen Gang

Asianux Corporation
#5 lore raw

PATCH 1/1 ARM:omap2: using strlcpy instead of strncpy

In reply to Tony Lindgren

Hi Tony,

Quoted 7 lines · Tony Lindgren
Quoted 3 lines · Chen Gang

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

Added Peter to cc on this one too, it's best that he queues all the twl changes.

I can create a branch for you in our gitorious tree
(git://gitorious.org/omap-audio/linux-audio.git) for this patch. But I think for now it would be best if you could take this via linux-omap (the file is under arch/arm/mach-omap2 anyways)

Regards,
P?ter

Quoted 31 lines

Tony

Quoted 28 lines
---
 arch/arm/mach-omap2/twl-common.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
arch/arm/mach-omap2/twl-common.c +2 -1
index e49b40b..6a7aec6 100644
@@ -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;
Signature · 1 line
1.7.10.4
maintainer
#6 lore raw

PATCH 1/1 ARM:omap2: using strlcpy instead of strncpy

Quoted 8 lines · Peter Ujfalusi

Hi Tony,

Quoted 5 lines · Tony Lindgren
Quoted 3 lines · Chen Gang

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

Quoted 7 lines
Quoted 2 lines

Added Peter to cc on this one too, it's best that he queues all the twl changes.

I can create a branch for you in our gitorious tree
(git://gitorious.org/omap-audio/linux-audio.git) for this patch. But I think for now it would be best if you could take this via linux-omap (the file is under arch/arm/mach-omap2 anyways)

OK thanks I'll apply with your ack to omap-for-v3.9/fixes-noncritical.

Tony

author
#7 lore raw

PATCH 1/1 ARM:omap2: using strlcpy instead of strncpy

? 2013?02?05? 02:18, Tony Lindgren ??:

Quoted 11 lines · Peter Ujfalusi
Quoted 6 lines
Quoted 6 lines

Hi Tony,

I can create a branch for you in our gitorious tree
(git://gitorious.org/omap-audio/linux-audio.git) for this patch. But I think for now it would be best if you could take this via linux-omap (the file is under arch/arm/mach-omap2 anyways)

OK thanks I'll apply with your ack to omap-for-v3.9/fixes-noncritical.

Tony

Does it mean: we need not sync MAINTAINERS file for twl-*, recently ?

:-)

thanks.

Signature · 3 lines
Chen Gang

Asianux Corporation
maintainer
#8 lore raw

PATCH 1/1 ARM:omap2: using strlcpy instead of strncpy

Quoted 8 lines · Chen Gang

? 2013?02?05? 02:18, Tony Lindgren ??:

Quoted 7 lines · Peter Ujfalusi
Quoted 6 lines
Quoted 6 lines

Hi Tony,

I can create a branch for you in our gitorious tree
(git://gitorious.org/omap-audio/linux-audio.git) for this patch. But I think for now it would be best if you could take this via linux-omap (the file is under arch/arm/mach-omap2 anyways)

Quoted 8 lines
Quoted 4 lines

OK thanks I'll apply with your ack to omap-for-v3.9/fixes-noncritical.

Tony

Does it mean: we need not sync MAINTAINERS file for twl-*, recently ?

:-)

No we should still do it.

Tony

author
#9 lore raw

PATCH 1/1 ARM:omap2: using strlcpy instead of strncpy

? 2013?02?06? 02:56, Tony Lindgren ??:

Quoted 8 lines · Chen Gang
Quoted 3 lines
Quoted 3 lines

Does it mean: we need not sync MAINTAINERS file for twl-*, recently ?

:-)

No we should still do it.

Tony

ok, thanks.

if necessary (no other members do it), I should perform. if really should I do:

requirements:
A) I should succeed provide at least 3 valuable patches to twl-* (or I am not qualified to provide the sync MAINTAINERS patch)

B) relative member need give strictly checking for the patch. (so can evaluate whether I have been qualified)

C) it is necessary to be monitored by the relative mailing lists.

I should try:
A) need mainly focus on the omap2, specially for twl-*

B) the patch type should be for bug fixing:
(I am not familiar with omap2, so can not for new features)
i. memory override.
ii. resource management.
iii. others (compiling issue, type cast, ...)

C) should provide 3 twl-* valuable patches within 1 month. (have finished one: strlcpy, in Jan 30 2013) (so need finish the other 2 patches, before Feb 28 2013)

hope I can succeed.

welcome any members to provide suggestions and completions.

thanks.

:-)

Signature · 3 lines
Chen Gang

Asianux Corporation
#10 lore raw

PATCH 1/1 ARM:omap2: using strlcpy instead of strncpy

In reply to Chen Gang
Quoted 5 lines · Chen Gang

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

Quoted 26 lines
---
 arch/arm/mach-omap2/twl-common.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
arch/arm/mach-omap2/twl-common.c +2 -1
index e49b40b..6a7aec6 100644
@@ -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;
Signature · 1 line
P?ter