From: Peter Ujfalusi <peter.ujfalusi@ti.com>
To: Tony Lindgren <tony@atomide.com>
Cc: Chen Gang <gang.chen@asianux.com>,
Russell King - ARM Linux <linux@arm.linux.org.uk>,
linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH] ARM:omap2: using strlcpy instead of strncpy
Date: Mon, 4 Feb 2013 10:00:27 +0100 [thread overview]
Message-ID: <510F78AB.4000602@ti.com> (raw)
In-Reply-To: <20130201224546.GG22517@atomide.com>
Hi Tony,
On 02/01/2013 11:45 PM, Tony Lindgren wrote:
> * Chen Gang <gang.chen@asianux.com> [130130 03:50]:
>>
>> 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
>
> Tony
>
>> 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
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
WARNING: multiple messages have this Message-ID (diff)
From: peter.ujfalusi@ti.com (Peter Ujfalusi)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] ARM:omap2: using strlcpy instead of strncpy
Date: Mon, 4 Feb 2013 10:00:27 +0100 [thread overview]
Message-ID: <510F78AB.4000602@ti.com> (raw)
In-Reply-To: <20130201224546.GG22517@atomide.com>
Hi Tony,
On 02/01/2013 11:45 PM, Tony Lindgren wrote:
> * Chen Gang <gang.chen@asianux.com> [130130 03:50]:
>>
>> 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
>
> Tony
>
>> 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
next prev parent reply other threads:[~2013-02-04 9:00 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-30 11:46 [PATCH] ARM:omap2: using strlcpy instead of strncpy Chen Gang
2013-01-30 11:46 ` Chen Gang
2013-02-01 22:45 ` Tony Lindgren
2013-02-01 22:45 ` Tony Lindgren
2013-02-02 2:25 ` Chen Gang
2013-02-02 2:25 ` Chen Gang
2013-02-02 18:07 ` Tony Lindgren
2013-02-02 18:07 ` Tony Lindgren
2013-02-04 1:17 ` Chen Gang
2013-02-04 1:17 ` Chen Gang
2013-02-04 9:00 ` Peter Ujfalusi [this message]
2013-02-04 9:00 ` Peter Ujfalusi
2013-02-04 18:18 ` Tony Lindgren
2013-02-04 18:18 ` Tony Lindgren
2013-02-05 2:18 ` Chen Gang
2013-02-05 2:18 ` Chen Gang
2013-02-05 18:56 ` Tony Lindgren
2013-02-05 18:56 ` Tony Lindgren
2013-02-06 2:05 ` Chen Gang
2013-02-06 2:05 ` Chen Gang
2013-02-04 8:54 ` Peter Ujfalusi
2013-02-04 8:54 ` Peter Ujfalusi
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=510F78AB.4000602@ti.com \
--to=peter.ujfalusi@ti.com \
--cc=gang.chen@asianux.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-omap@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
--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.