Remove function snd_cmipci_pll_rmn() that is not used anywhere.
This was partially found by using a static code analysis program called
cppcheck.
Signed-off-by: Rickard Strandqvist
---
sound/pci/cmipci.c | 41 -
1 file changed, 41 deletions(-)
diff
Remove function snd_azf3328_codec_outl() that is not used anywhere.
This was partially found by using a static code analysis program called
cppcheck.
Signed-off-by: Rickard Strandqvist
---
sound/pci/azt3328.c |9 -
1 file changed, 9 deletions(-)
diff --git a/sound/pci/azt3328.c b
Remove function mem_cgroup_lru_names_not_uptodate() that is not used anywhere.
This was partially found by using a static code analysis program called
cppcheck.
Signed-off-by: Rickard Strandqvist
---
mm/memcontrol.c |5 -
1 file changed, 5 deletions(-)
diff --git a/mm/memcontrol.c b
Removes some functions that are not used anywhere.
rtw_hal_interrupt_handler() rtw_hal_sreset_get_wifi_status()
This was partially found by using a static code analysis program called
cppcheck.
Signed-off-by: Rickard Strandqvist
---
drivers/staging/rtl8188eu/hal/hal_intf.c | 16
Remove function serial_read_reg() that is not used anywhere.
This was partially found by using a static code analysis program called
cppcheck.
Signed-off-by: Rickard Strandqvist
---
arch/arm/mach-davinci/serial.c | 10 --
1 file changed, 10 deletions(-)
diff --git a/arch/arm/mach
Removes some functions that are not used anywhere.
lca_clock_print() lca_get_clock() lca_clock_fiddle()
This was partially found by using a static code analysis program called
cppcheck.
Signed-off-by: Rickard Strandqvist
---
arch/alpha/kernel/core_lca.c | 43
Removes some functions that are not used anywhere.
lca_clock_print() lca_get_clock() lca_clock_fiddle()
This was partially found by using a static code analysis program called
cppcheck.
Signed-off-by: Rickard Strandqvist rickard_strandqv...@spectrumdigital.se
---
arch/alpha/kernel/core_lca.c
Remove function serial_read_reg() that is not used anywhere.
This was partially found by using a static code analysis program called
cppcheck.
Signed-off-by: Rickard Strandqvist rickard_strandqv...@spectrumdigital.se
---
arch/arm/mach-davinci/serial.c | 10 --
1 file changed, 10
Removes some functions that are not used anywhere.
rtw_hal_interrupt_handler() rtw_hal_sreset_get_wifi_status()
This was partially found by using a static code analysis program called
cppcheck.
Signed-off-by: Rickard Strandqvist rickard_strandqv...@spectrumdigital.se
---
drivers/staging
Remove function mem_cgroup_lru_names_not_uptodate() that is not used anywhere.
This was partially found by using a static code analysis program called
cppcheck.
Signed-off-by: Rickard Strandqvist rickard_strandqv...@spectrumdigital.se
---
mm/memcontrol.c |5 -
1 file changed, 5
Remove function snd_azf3328_codec_outl() that is not used anywhere.
This was partially found by using a static code analysis program called
cppcheck.
Signed-off-by: Rickard Strandqvist rickard_strandqv...@spectrumdigital.se
---
sound/pci/azt3328.c |9 -
1 file changed, 9 deletions
Remove function snd_cmipci_pll_rmn() that is not used anywhere.
This was partially found by using a static code analysis program called
cppcheck.
Signed-off-by: Rickard Strandqvist rickard_strandqv...@spectrumdigital.se
---
sound/pci/cmipci.c | 41 -
1
Remove unneeded #define. This was previously included in a patch set
two but patchset one was taken by mistake.
Signed-off-by: Rickard Strandqvist
---
drivers/staging/comedi/drivers/comedi_bond.c |3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/staging/comedi
Remove unneeded #define. This was previously included in a patch set
two but patchset one was taken by mistake.
Signed-off-by: Rickard Strandqvist rickard_strandqv...@spectrumdigital.se
---
drivers/staging/comedi/drivers/comedi_bond.c |3 +--
1 file changed, 1 insertion(+), 2 deletions
2014-10-20 17:37 GMT+02:00 Dan Carpenter :
> On Sun, Oct 19, 2014 at 12:13:10AM +0200, Rickard Strandqvist wrote:
>> Ensures that the string is null-terminate in connection with the
>> use of strncpy, by switching from strncpy to strzcpy.
>>
>
> I wish the changelogs w
2014-10-20 17:37 GMT+02:00 Dan Carpenter dan.carpen...@oracle.com:
On Sun, Oct 19, 2014 at 12:13:10AM +0200, Rickard Strandqvist wrote:
Ensures that the string is null-terminate in connection with the
use of strncpy, by switching from strncpy to strzcpy.
I wish the changelogs were more clear
2014-10-19 3:38 GMT+02:00 Joe Perches :
> On Sun, 2014-10-19 at 00:03 +0200, Rickard Strandqvist wrote:
>> Added a function strzcpy which works the same as strncpy,
>> but guaranteed to produce the trailing null character.
>>
>> There are many places in the code
2014-10-19 3:38 GMT+02:00 Joe Perches j...@perches.com:
On Sun, 2014-10-19 at 00:03 +0200, Rickard Strandqvist wrote:
Added a function strzcpy which works the same as strncpy,
but guaranteed to produce the trailing null character.
There are many places in the code where strncpy used although
Ensures that the string is null-terminate in connection with the
use of strncpy, by switching from strncpy to strzcpy.
Signed-off-by: Rickard Strandqvist
---
drivers/mmc/host/vub300.c | 24
1 file changed, 12 insertions(+), 12 deletions(-)
diff --git a/drivers/mmc
Ensures that the string is null-terminate in connection with the
use of strncpy, by switching from strncpy to strzcpy.
Signed-off-by: Rickard Strandqvist
---
drivers/power/charger-manager.c |4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/power/charger
Ensures that the string is null-terminate in connection with the
use of strncpy, by switching from strncpy to strzcpy.
Signed-off-by: Rickard Strandqvist
---
drivers/video/fbdev/uvesafb.c |2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/video/fbdev/uvesafb.c b
Ensures that the string is null-terminate in connection with the
use of strncpy, by switching from strncpy to strzcpy.
Signed-off-by: Rickard Strandqvist
---
drivers/scsi/bfa/bfa_fcs_lport.c |2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/scsi/bfa/bfa_fcs_lport.c
with zero characters.
Signed-off-by: Rickard Strandqvist
---
include/linux/string.h |1 +
lib/string.c | 31 +++
2 files changed, 32 insertions(+)
diff --git a/include/linux/string.h b/include/linux/string.h
index d36977e..d789ee5e 100644
--- a/include/linux
Changed from using strncat to strlcat to simplify the code
Signed-off-by: Rickard Strandqvist
Reviewed-by: Ian Abbott
Reviewed-by: H Hartley Sweeten
---
drivers/staging/comedi/drivers/comedi_bond.c |9 +++--
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/drivers/staging
Changed from using strncat to strlcat to simplify the code
Signed-off-by: Rickard Strandqvist rickard_strandqv...@spectrumdigital.se
Reviewed-by: Ian Abbott abbo...@mev.co.uk
Reviewed-by: H Hartley Sweeten hswee...@visionengravers.com
---
drivers/staging/comedi/drivers/comedi_bond.c |9
with zero characters.
Signed-off-by: Rickard Strandqvist rickard_strandqv...@spectrumdigital.se
---
include/linux/string.h |1 +
lib/string.c | 31 +++
2 files changed, 32 insertions(+)
diff --git a/include/linux/string.h b/include/linux/string.h
index d36977e
Ensures that the string is null-terminate in connection with the
use of strncpy, by switching from strncpy to strzcpy.
Signed-off-by: Rickard Strandqvist rickard_strandqv...@spectrumdigital.se
---
drivers/scsi/bfa/bfa_fcs_lport.c |2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff
Ensures that the string is null-terminate in connection with the
use of strncpy, by switching from strncpy to strzcpy.
Signed-off-by: Rickard Strandqvist rickard_strandqv...@spectrumdigital.se
---
drivers/video/fbdev/uvesafb.c |2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git
Ensures that the string is null-terminate in connection with the
use of strncpy, by switching from strncpy to strzcpy.
Signed-off-by: Rickard Strandqvist rickard_strandqv...@spectrumdigital.se
---
drivers/power/charger-manager.c |4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff
Ensures that the string is null-terminate in connection with the
use of strncpy, by switching from strncpy to strzcpy.
Signed-off-by: Rickard Strandqvist rickard_strandqv...@spectrumdigital.se
---
drivers/mmc/host/vub300.c | 24
1 file changed, 12 insertions(+), 12
2014-10-16 23:17 GMT+02:00 Andrew Morton :
> On Thu, 16 Oct 2014 23:09:00 +0200 Rickard Strandqvist
> wrote:
>
>> 2014-10-16 0:15 GMT+02:00 Andrew Morton :
>> > On Sun, 5 Oct 2014 15:06:17 +0200 Rickard Strandqvist
>> > wrote:
>> >
>>
The buf is used to hold the list of hwrng devices registered.
The old code ensures we don't walk off the end of buf as we
fill it, but it's unnecessarily complicated and thus difficult
to maintain. Simplify it by using strlcat.
Signed-off-by: Rickard Strandqvist
Reviewed-by: Jason Cooper
2014-10-16 0:15 GMT+02:00 Andrew Morton :
> On Sun, 5 Oct 2014 15:06:17 +0200 Rickard Strandqvist
> wrote:
>
>> Added a function strzcpy which works the same as strncpy,
>> but guaranteed to produce the trailing null character.
>>
>> There are many places in the
2014-10-16 20:25 GMT+02:00 Jason Cooper :
> On Thu, Oct 16, 2014 at 08:15:55PM +0200, Rickard Strandqvist wrote:
>> The buf is used to hold the list of hwrng devices registered.
>> The old code ensures we don't walk off the end of buf as we
>> fill it, but it's unnecessarily
strlen is ok.
Signed-off-by: Rickard Strandqvist
---
drivers/char/hw_random/core.c | 11 ---
1 file changed, 4 insertions(+), 7 deletions(-)
diff --git a/drivers/char/hw_random/core.c b/drivers/char/hw_random/core.c
index aa30a25..25599ea 100644
--- a/drivers/char/hw_random/core.c
+++ b
2014-10-16 20:05 GMT+02:00 Jason Cooper :
> On Thu, Oct 16, 2014 at 10:55:57AM -0700, Joe Perches wrote:
>> On Thu, 2014-10-16 at 13:48 -0400, Jason Cooper wrote:
>> > On Thu, Oct 16, 2014 at 10:25:03AM -0700, Joe Perches wrote:
>> > > On Thu, 2014-10-16 at 19:15 +0
2014-10-16 19:25 GMT+02:00 Joe Perches :
> On Thu, 2014-10-16 at 19:15 +0200, Rickard Strandqvist wrote:
>> The buf is used to hold the list of hwrng devices registered.
>> The old code ensures we don't walk off the end of buf as we
>> fill it, but it's unnecessarily complicat
strlen is ok.
Signed-off-by: Rickard Strandqvist
---
drivers/char/hw_random/core.c | 12
1 file changed, 4 insertions(+), 8 deletions(-)
diff --git a/drivers/char/hw_random/core.c b/drivers/char/hw_random/core.c
index aa30a25..1500cfd 100644
--- a/drivers/char/hw_random/core.c
2014-10-15 16:57 GMT+02:00 Jason Cooper :
> On Tue, Oct 14, 2014 at 11:11:28PM +0200, Rickard Strandqvist wrote:
>> 2014-10-14 17:36 GMT+02:00 Jason Cooper :
>> > On Mon, Oct 13, 2014 at 11:20:35PM +0200, Rickard Strandqvist wrote:
>> >> 2014-10-12 21:22 GMT+02:00
2014-10-15 16:57 GMT+02:00 Jason Cooper ja...@lakedaemon.net:
On Tue, Oct 14, 2014 at 11:11:28PM +0200, Rickard Strandqvist wrote:
2014-10-14 17:36 GMT+02:00 Jason Cooper ja...@lakedaemon.net:
On Mon, Oct 13, 2014 at 11:20:35PM +0200, Rickard Strandqvist wrote:
2014-10-12 21:22 GMT+02:00
strlen is ok.
Signed-off-by: Rickard Strandqvist rickard_strandqv...@spectrumdigital.se
---
drivers/char/hw_random/core.c | 12
1 file changed, 4 insertions(+), 8 deletions(-)
diff --git a/drivers/char/hw_random/core.c b/drivers/char/hw_random/core.c
index aa30a25..1500cfd 100644
2014-10-16 19:25 GMT+02:00 Joe Perches j...@perches.com:
On Thu, 2014-10-16 at 19:15 +0200, Rickard Strandqvist wrote:
The buf is used to hold the list of hwrng devices registered.
The old code ensures we don't walk off the end of buf as we
fill it, but it's unnecessarily complicated and thus
I keep on trying to get a patch that solves one of these stupid
functions, but the strncpy in that case.
Kind regards
Rickard Strandqvist
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at http
strlen is ok.
Signed-off-by: Rickard Strandqvist rickard_strandqv...@spectrumdigital.se
---
drivers/char/hw_random/core.c | 11 ---
1 file changed, 4 insertions(+), 7 deletions(-)
diff --git a/drivers/char/hw_random/core.c b/drivers/char/hw_random/core.c
index aa30a25..25599ea 100644
2014-10-16 20:25 GMT+02:00 Jason Cooper ja...@lakedaemon.net:
On Thu, Oct 16, 2014 at 08:15:55PM +0200, Rickard Strandqvist wrote:
The buf is used to hold the list of hwrng devices registered.
The old code ensures we don't walk off the end of buf as we
fill it, but it's unnecessarily
2014-10-16 0:15 GMT+02:00 Andrew Morton a...@linux-foundation.org:
On Sun, 5 Oct 2014 15:06:17 +0200 Rickard Strandqvist
rickard_strandqv...@spectrumdigital.se wrote:
Added a function strzcpy which works the same as strncpy,
but guaranteed to produce the trailing null character
The buf is used to hold the list of hwrng devices registered.
The old code ensures we don't walk off the end of buf as we
fill it, but it's unnecessarily complicated and thus difficult
to maintain. Simplify it by using strlcat.
Signed-off-by: Rickard Strandqvist rickard_strandqv
2014-10-16 23:17 GMT+02:00 Andrew Morton a...@linux-foundation.org:
On Thu, 16 Oct 2014 23:09:00 +0200 Rickard Strandqvist
rickard_strandqv...@spectrumdigital.se wrote:
2014-10-16 0:15 GMT+02:00 Andrew Morton a...@linux-foundation.org:
On Sun, 5 Oct 2014 15:06:17 +0200 Rickard Strandqvist
>>>
>>> > On Sun, 14 Sep 2014 19:33:43 +0200
>>> > Rickard Strandqvist wrote:
>>> >
>>> >> Replacing strncpy with strlcpy to avoid strings that lacks null
>>> >> terminate.
>>> >>
>>> >>
2014-09-19 0:39 GMT+02:00 Dan Carpenter :
> On Thu, Sep 18, 2014 at 09:57:17PM +0200, Rickard Strandqvist wrote:
>>
>> Should I add this as a patch in lib/string.c or email him first.. What
>> is customary in these situations?
>>
>
> Just write up a normal
2014-10-14 17:36 GMT+02:00 Jason Cooper :
> On Mon, Oct 13, 2014 at 11:20:35PM +0200, Rickard Strandqvist wrote:
>> 2014-10-12 21:22 GMT+02:00 Jason Cooper :
>> > Rickard,
>> >
>> > On Sun, Oct 12, 2014 at 12:49:31PM +0200, Rickard Strandqvist wrote:
>>
2014-10-14 17:36 GMT+02:00 Jason Cooper ja...@lakedaemon.net:
On Mon, Oct 13, 2014 at 11:20:35PM +0200, Rickard Strandqvist wrote:
2014-10-12 21:22 GMT+02:00 Jason Cooper ja...@lakedaemon.net:
Rickard,
On Sun, Oct 12, 2014 at 12:49:31PM +0200, Rickard Strandqvist wrote:
Changed from
2014-09-19 0:39 GMT+02:00 Dan Carpenter dan.carpen...@oracle.com:
On Thu, Sep 18, 2014 at 09:57:17PM +0200, Rickard Strandqvist wrote:
Should I add this as a patch in lib/string.c or email him first.. What
is customary in these situations?
Just write up a normal patch and try to merge
: Sun, 14 Sep 2014 19:05:57 -0700
On Sun, 14 Sep 2014 19:33:43 +0200
Rickard Strandqvist rickard_strandqv...@spectrumdigital.se wrote:
Replacing strncpy with strlcpy to avoid strings that lacks null
terminate.
Signed-off-by: Rickard Strandqvist
rickard_strandqv...@spectrumdigital.se
2014-10-12 21:22 GMT+02:00 Jason Cooper :
> Rickard,
>
> On Sun, Oct 12, 2014 at 12:49:31PM +0200, Rickard Strandqvist wrote:
>> Changed from using strncat to strlcat to simplify the code
>
> I'd like to see a little more explicit discussion here. As Guenter got
&
2014-10-13 14:44 GMT+02:00 Jiri Olsa :
> On Sun, Oct 12, 2014 at 10:40:35PM +0200, Rickard Strandqvist wrote:
>> Changed from using strncat to strlcat to simplify the code
>>
>> Signed-off-by: Rickard Strandqvist
>> ---
>> tools/perf/util/sort.c | 12 +
2014-10-13 11:14 GMT+02:00 Ian Abbott :
> On 12/10/14 13:23, Rickard Strandqvist wrote:
>>
>> Changed from using strncat to strlcat to simplify the code
>>
>> Signed-off-by: Rickard Strandqvist
>>
>> ---
>> drivers/staging/comedi/drivers/comed
2014-10-13 10:55 GMT+02:00 David Laight :
> From: Rickard Strandqvist
>> Replacing strncpy with strlcpy to avoid strings that lacks null terminate.
>> And changed from using strncpy to strlcpy to simplify code.
>
> I think you should return an error if the strings ge
2014-10-13 10:55 GMT+02:00 David Laight david.lai...@aculab.com:
From: Rickard Strandqvist
Replacing strncpy with strlcpy to avoid strings that lacks null terminate.
And changed from using strncpy to strlcpy to simplify code.
I think you should return an error if the strings get truncated
2014-10-13 11:14 GMT+02:00 Ian Abbott abbo...@mev.co.uk:
On 12/10/14 13:23, Rickard Strandqvist wrote:
Changed from using strncat to strlcat to simplify the code
Signed-off-by: Rickard Strandqvist
rickard_strandqv...@spectrumdigital.se
---
drivers/staging/comedi/drivers/comedi_bond.c
2014-10-13 14:44 GMT+02:00 Jiri Olsa jo...@redhat.com:
On Sun, Oct 12, 2014 at 10:40:35PM +0200, Rickard Strandqvist wrote:
Changed from using strncat to strlcat to simplify the code
Signed-off-by: Rickard Strandqvist rickard_strandqv...@spectrumdigital.se
---
tools/perf/util/sort.c | 12
2014-10-12 21:22 GMT+02:00 Jason Cooper ja...@lakedaemon.net:
Rickard,
On Sun, Oct 12, 2014 at 12:49:31PM +0200, Rickard Strandqvist wrote:
Changed from using strncat to strlcat to simplify the code
I'd like to see a little more explicit discussion here. As Guenter got
caught up in the mis
Changed from using strncat to strlcat to simplify the code
Signed-off-by: Rickard Strandqvist
---
tools/perf/util/sort.c | 12
1 file changed, 4 insertions(+), 8 deletions(-)
diff --git a/tools/perf/util/sort.c b/tools/perf/util/sort.c
index 14e5a03..6e242f0 100644
--- a/tools
Changed from using strncat to strlcat to simplify the code
Signed-off-by: Rickard Strandqvist
---
scripts/docproc.c | 24 +++-
1 file changed, 11 insertions(+), 13 deletions(-)
diff --git a/scripts/docproc.c b/scripts/docproc.c
index e267e621..dd1d10a 100644
--- a/scripts
2014-10-12 20:18 GMT+02:00 Joe Perches :
> On Sun, 2014-10-12 at 19:55 +0200, Rickard Strandqvist wrote:
>> Changed same snprintf and sprintf to strlcpy and strlcat.
>> This will guarantee that the string size is not overwritten,
>> and they are significantly faster than spri
Changed from using strncat with strlcat to avoid overwrite the max size
Signed-off-by: Rickard Strandqvist
---
kernel/debug/kdb/kdb_main.c |2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/debug/kdb/kdb_main.c b/kernel/debug/kdb/kdb_main.c
index 379650b..eb8b6c4
Changed same snprintf and sprintf to strlcpy and strlcat.
This will guarantee that the string size is not overwritten,
and they are significantly faster than sprintf also.
Signed-off-by: Rickard Strandqvist
---
drivers/target/iscsi/iscsi_target_tpg.c | 16 +++-
1 file changed, 7
Changed from using strncat with strlcat to avoid overwrite the max size.
Take the opportunity to change a snprint to strlcpy.
Signed-off-by: Rickard Strandqvist
---
drivers/staging/lustre/lustre/ptlrpc/sec.c |5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers
Changed from using strncat to strlcat to simplify the code
Signed-off-by: Rickard Strandqvist
---
drivers/staging/comedi/drivers/comedi_bond.c |6 ++
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/staging/comedi/drivers/comedi_bond.c
b/drivers/staging/comedi
Replacing strncpy with strlcpy to avoid strings that lacks null terminate.
And changed from using strncat to strlcat to simplify code.
Signed-off-by: Rickard Strandqvist
---
drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c | 25 ++--
1 file changed, 12 insertions(+), 13
brcmf_firmware_path[0] == '\0' we do not want to do like.
if (brcmf_firmware_path[0] != '\0') {
...
} else {
sdiodev->fw_name[0] = '\0';
sdiodev->nvram_name[0] = '\0';
}
Kind regards
Rickard Strandqvist
Rickard Strandqvist (1):
net: wireless: brcm80211: brcmfmac: dhd_sdio.c: Clean
2014-10-12 10:06 GMT+02:00 Arend van Spriel :
> On 12-10-14 01:52, Rickard Strandqvist wrote:
>> Replacing strncpy with strlcpy to avoid strings that lacks null terminate.
>> And changed from using strncpy to strlcpy to simplify code.
>
> Looks good to me. Just two small pr
Changed from using strncat to strlcat to simplify the code
Signed-off-by: Rickard Strandqvist
---
drivers/char/hw_random/core.c | 12
1 file changed, 4 insertions(+), 8 deletions(-)
diff --git a/drivers/char/hw_random/core.c b/drivers/char/hw_random/core.c
index aa30a25..1500cfd
Hi
Oops, sorry.
New patch on the way!
Kind regards
Rickard Strandqvist
2014-10-12 2:27 GMT+02:00 Mark D Rustad :
> On Oct 11, 2014, at 3:36 PM, Rickard Strandqvist
> wrote:
>
>> Changed from using strncpy to strlcpy to simplify the code
>
> Actually you changed from usi
Hi
Oops, sorry.
New patch on the way!
Kind regards
Rickard Strandqvist
2014-10-12 2:27 GMT+02:00 Mark D Rustad mrus...@gmail.com:
On Oct 11, 2014, at 3:36 PM, Rickard Strandqvist
rickard_strandqv...@spectrumdigital.se wrote:
Changed from using strncpy to strlcpy to simplify the code
Changed from using strncat to strlcat to simplify the code
Signed-off-by: Rickard Strandqvist rickard_strandqv...@spectrumdigital.se
---
drivers/char/hw_random/core.c | 12
1 file changed, 4 insertions(+), 8 deletions(-)
diff --git a/drivers/char/hw_random/core.c b/drivers/char
2014-10-12 10:06 GMT+02:00 Arend van Spriel ar...@broadcom.com:
On 12-10-14 01:52, Rickard Strandqvist wrote:
Replacing strncpy with strlcpy to avoid strings that lacks null terminate.
And changed from using strncpy to strlcpy to simplify code.
Looks good to me. Just two small process related
brcmf_firmware_path[0] == '\0' we do not want to do like.
if (brcmf_firmware_path[0] != '\0') {
...
} else {
sdiodev-fw_name[0] = '\0';
sdiodev-nvram_name[0] = '\0';
}
Kind regards
Rickard Strandqvist
Rickard Strandqvist (1):
net: wireless: brcm80211: brcmfmac: dhd_sdio.c: Cleaning up
Replacing strncpy with strlcpy to avoid strings that lacks null terminate.
And changed from using strncat to strlcat to simplify code.
Signed-off-by: Rickard Strandqvist rickard_strandqv...@spectrumdigital.se
---
drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c | 25 ++--
1
Changed from using strncat to strlcat to simplify the code
Signed-off-by: Rickard Strandqvist rickard_strandqv...@spectrumdigital.se
---
drivers/staging/comedi/drivers/comedi_bond.c |6 ++
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/staging/comedi/drivers
Changed from using strncat with strlcat to avoid overwrite the max size.
Take the opportunity to change a snprint to strlcpy.
Signed-off-by: Rickard Strandqvist rickard_strandqv...@spectrumdigital.se
---
drivers/staging/lustre/lustre/ptlrpc/sec.c |5 ++---
1 file changed, 2 insertions(+), 3
Changed same snprintf and sprintf to strlcpy and strlcat.
This will guarantee that the string size is not overwritten,
and they are significantly faster than sprintf also.
Signed-off-by: Rickard Strandqvist rickard_strandqv...@spectrumdigital.se
---
drivers/target/iscsi/iscsi_target_tpg.c | 16
Changed from using strncat with strlcat to avoid overwrite the max size
Signed-off-by: Rickard Strandqvist rickard_strandqv...@spectrumdigital.se
---
kernel/debug/kdb/kdb_main.c |2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/debug/kdb/kdb_main.c b/kernel/debug/kdb
2014-10-12 20:18 GMT+02:00 Joe Perches j...@perches.com:
On Sun, 2014-10-12 at 19:55 +0200, Rickard Strandqvist wrote:
Changed same snprintf and sprintf to strlcpy and strlcat.
This will guarantee that the string size is not overwritten,
and they are significantly faster than sprintf also.
I
Changed from using strncat to strlcat to simplify the code
Signed-off-by: Rickard Strandqvist rickard_strandqv...@spectrumdigital.se
---
scripts/docproc.c | 24 +++-
1 file changed, 11 insertions(+), 13 deletions(-)
diff --git a/scripts/docproc.c b/scripts/docproc.c
index
Changed from using strncat to strlcat to simplify the code
Signed-off-by: Rickard Strandqvist rickard_strandqv...@spectrumdigital.se
---
tools/perf/util/sort.c | 12
1 file changed, 4 insertions(+), 8 deletions(-)
diff --git a/tools/perf/util/sort.c b/tools/perf/util/sort.c
index
Replacing strncpy with strlcpy to avoid strings that lacks null terminate.
And changed from using strncpy to strlcpy to simplify code.
Signed-off-by: Rickard Strandqvist
---
drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c | 25 ++--
1 file changed, 12 insertions(+), 13
Changed from using strncpy to strlcpy to simplify the code
Signed-off-by: Rickard Strandqvist
---
drivers/char/hw_random/core.c | 12
1 file changed, 4 insertions(+), 8 deletions(-)
diff --git a/drivers/char/hw_random/core.c b/drivers/char/hw_random/core.c
index aa30a25..1500cfd
Fixed wrong usage of strncat, switched to strlcpy.
While sending the string size to function to reduce
the potential for misuse in future.
Signed-off-by: Rickard Strandqvist
---
drivers/gpu/drm/drm_dp_mst_topology.c | 15 ---
1 file changed, 8 insertions(+), 7 deletions(-)
diff
Fixed wrong usage of strncat, switched to strlcpy.
While sending the string size to function to reduce
the potential for misuse in future.
Signed-off-by: Rickard Strandqvist rickard_strandqv...@spectrumdigital.se
---
drivers/gpu/drm/drm_dp_mst_topology.c | 15 ---
1 file changed, 8
Changed from using strncpy to strlcpy to simplify the code
Signed-off-by: Rickard Strandqvist rickard_strandqv...@spectrumdigital.se
---
drivers/char/hw_random/core.c | 12
1 file changed, 4 insertions(+), 8 deletions(-)
diff --git a/drivers/char/hw_random/core.c b/drivers/char
Replacing strncpy with strlcpy to avoid strings that lacks null terminate.
And changed from using strncpy to strlcpy to simplify code.
Signed-off-by: Rickard Strandqvist rickard_strandqv...@spectrumdigital.se
---
drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c | 25 ++--
1
I have now eliminate the need to use the temporary string,
and therefore also the use of strncat.
And I think this code is clearer and more effective.
Signed-off-by: Rickard Strandqvist
---
drivers/gpu/drm/drm_dp_mst_topology.c | 15 ---
1 file changed, 8 insertions(+), 7
Hi
Yes, it can be faster, even if it is as you say, probably a difference
depending on the size of the count.
And even greater need to test this on a variety of hardware :-/
But I try to do my test with the memset variant to.
Kind regards
Rickard Strandqvist
2014-10-05 17:36 GMT+02:00 Joe
This variant is in my tests about 7-10% faster, and I also think
it is perhaps even clearer code than before.
I assume that more will do the testing, I do not know if we should do tests
on different types of hardware as well, my test was on a new Intel I7.
Rickard Strandqvist (1):
lib
This variant is in my tests about 7-10% faster, and also think
it is perhaps even clearer code than before.
Signed-off-by: Rickard Strandqvist
---
lib/string.c | 12 ++--
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/lib/string.c b/lib/string.c
index f3c6ff5..6961229
with zero characters.
Signed-off-by: Rickard Strandqvist
---
include/linux/string.h |1 +
lib/string.c | 31 +++
2 files changed, 32 insertions(+)
diff --git a/include/linux/string.h b/include/linux/string.h
index d36977e..d789ee5e 100644
--- a/include/linux
';
This is solved with strzcpy.
Rickard Strandqvist (1):
lib: string.c: Added a funktion function strzcpy
include/linux/string.h |1 +
lib/string.c | 31 +++
2 files changed, 32 insertions(+)
--
1.7.10.4
--
To unsubscribe from this list: send the line
';
This is solved with strzcpy.
Rickard Strandqvist (1):
lib: string.c: Added a funktion function strzcpy
include/linux/string.h |1 +
lib/string.c | 31 +++
2 files changed, 32 insertions(+)
--
1.7.10.4
--
To unsubscribe from this list: send the line unsubscribe
with zero characters.
Signed-off-by: Rickard Strandqvist rickard_strandqv...@spectrumdigital.se
---
include/linux/string.h |1 +
lib/string.c | 31 +++
2 files changed, 32 insertions(+)
diff --git a/include/linux/string.h b/include/linux/string.h
index d36977e
901 - 1000 of 2007 matches
Mail list logo