Hi
Ok, sorry :-(
But I really do not. I've hacked together a script that will scan all
the code for the function, and test builds with some different config
options turned on.
Kind regards
Rickard Strandqvist
2014-12-07 23:18 GMT+01:00 Richard Weinberger :
> Am 07.12.2014 um 23:07
Remove the function dsi_rr_formula() that is not used anywhere.
This was partially found by using a static code analysis program called
cppcheck.
Signed-off-by: Rickard Strandqvist
---
drivers/gpu/drm/i915/intel_dsi_pll.c | 83 +-
1 file changed, 1 insertion
Removes some functions that are not used anywhere:
trace_log_outdent() trace_log_indent()
This was partially found by using a static code analysis program called
cppcheck.
Signed-off-by: Rickard Strandqvist
---
tools/testing/selftests/powerpc/pmu/ebb/trace.c | 26
Remove the function cmo_high_show() that is not used anywhere.
This was partially found by using a static code analysis program called
cppcheck.
Signed-off-by: Rickard Strandqvist
---
arch/powerpc/kernel/vio.c |5 -
1 file changed, 5 deletions(-)
diff --git a/arch/powerpc/kernel
Remove the function omap4_dpllmx_gatectrl_read() 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-omap2/clock.h|1 -
arch/arm/mach-omap2/dpll44xx.c | 20
Remove the function inst_set_field() that is not used anywhere.
This was partially found by using a static code analysis program called
cppcheck.
Signed-off-by: Rickard Strandqvist
---
arch/powerpc/kvm/book3s_paired_singles.c |8
1 file changed, 8 deletions(-)
diff --git a/arch
Remove the function CAM_read_entry() that is not used anywhere.
This was partially found by using a static code analysis program called
cppcheck.
Signed-off-by: Rickard Strandqvist
---
drivers/staging/rtl8192e/rtl8192e/rtl_cam.c | 29 ---
drivers/staging/rtl8192e
Removes some functions that are not used anywhere:
am33xx_cm_read_reg_bits() am33xx_cm_clear_reg_bits() am33xx_cm_set_reg_bits()
This was partially found by using a static code analysis program called
cppcheck.
Signed-off-by: Rickard Strandqvist
---
arch/arm/mach-omap2/cm33xx.c | 21
Remove the function generic_mach_cpu_die() that is not used anywhere.
This was partially found by using a static code analysis program called
cppcheck.
Signed-off-by: Rickard Strandqvist
---
arch/powerpc/include/asm/smp.h |1 -
arch/powerpc/kernel/smp.c | 14 --
2 files
Remove the function bfad_drv_uninit() that is not used anywhere.
This was partially found by using a static code analysis program called
cppcheck.
Signed-off-by: Rickard Strandqvist
---
drivers/scsi/bfa/bfad.c | 20
drivers/scsi/bfa/bfad_drv.h |1 -
2 files
Remove the function sys_debug_setcontext() that is not used anywhere.
This was partially found by using a static code analysis program called
cppcheck.
Signed-off-by: Rickard Strandqvist
---
arch/powerpc/kernel/signal_32.c | 107 ---
1 file changed, 107
Remove the function MACbCompareContext() that is not used anywhere.
This was partially found by using a static code analysis program called
cppcheck.
Signed-off-by: Rickard Strandqvist
---
drivers/staging/vt6655/mac.c | 42 --
drivers/staging/vt6655
Remove the function rtl92d_set_fw_pwrmode_cmd() that is not used anywhere.
This was partially found by using a static code analysis program called
cppcheck.
Signed-off-by: Rickard Strandqvist
---
drivers/net/wireless/rtlwifi/rtl8192de/fw.c | 17 -
drivers/net/wireless
Remove the function usb_writeN() that is not used anywhere.
This was partially found by using a static code analysis program called
cppcheck.
Signed-off-by: Rickard Strandqvist
---
drivers/staging/rtl8188eu/include/usb_ops_linux.h |1 -
drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c
Remove the function dsi_hs_mode_enable() that is not used anywhere.
This was partially found by using a static code analysis program called
cppcheck.
Signed-off-by: Rickard Strandqvist
---
drivers/gpu/drm/i915/intel_dsi_cmd.c | 21 -
drivers/gpu/drm/i915/intel_dsi_cmd.h
program called
cppcheck.
Signed-off-by: Rickard Strandqvist
---
arch/arm/mach-omap2/clkt2xxx_apll.c | 52 ---
arch/arm/mach-omap2/clock2xxx.h |9 --
2 files changed, 61 deletions(-)
diff --git a/arch/arm/mach-omap2/clkt2xxx_apll.c
b/arch/arm/mach-omap2
Remove the function intel_dp_set_drrs_state() that is not used anywhere.
This was partially found by using a static code analysis program called
cppcheck.
Signed-off-by: Rickard Strandqvist
---
drivers/gpu/drm/i915/intel_dp.c | 89 --
drivers/gpu/drm
Remove the function show_trace_task() that is not used anywhere.
This was partially found by using a static code analysis program called
cppcheck.
Signed-off-by: Rickard Strandqvist
---
arch/mn10300/kernel/traps.c | 14 --
1 file changed, 14 deletions(-)
diff --git a/arch
Remove the function search_one_table() that is not used anywhere.
This was partially found by using a static code analysis program called
cppcheck.
Signed-off-by: Rickard Strandqvist
---
arch/frv/mm/extable.c | 23 ---
1 file changed, 23 deletions(-)
diff --git a/arch
Remove the function event_bhrb_init() that is not used anywhere.
This was partially found by using a static code analysis program called
cppcheck.
Signed-off-by: Rickard Strandqvist
---
tools/testing/selftests/powerpc/pmu/ebb/ebb.c |5 -
tools/testing/selftests/powerpc/pmu/ebb/ebb.h
() omap_pm_set_max_sdma_lat()
This was partially found by using a static code analysis program called
cppcheck.
Signed-off-by: Rickard Strandqvist
---
arch/arm/mach-omap2/omap-pm-noop.c | 196
arch/arm/mach-omap2/omap-pm.h | 192 ---
2
Remove the function show_trace_task() that is not used anywhere.
This was partially found by using a static code analysis program called
cppcheck.
Signed-off-by: Rickard Strandqvist
---
arch/openrisc/kernel/traps.c |7 ---
1 file changed, 7 deletions(-)
diff --git a/arch/openrisc
Remove the function vsx_assist_exception() that is not used anywhere.
This was partially found by using a static code analysis program called
cppcheck.
Signed-off-by: Rickard Strandqvist
---
arch/powerpc/kernel/traps.c | 15 ---
1 file changed, 15 deletions(-)
diff --git a/arch
Remove the function intel_output_name() that is not used anywhere.
This was partially found by using a static code analysis program called
cppcheck.
Signed-off-by: Rickard Strandqvist
---
drivers/gpu/drm/i915/intel_display.c | 22 --
drivers/gpu/drm/i915/intel_drv.h
() fc_rrq_rsp_parse()
This was partially found by using a static code analysis program called
cppcheck.
Signed-off-by: Rickard Strandqvist
---
drivers/scsi/bfa/bfa_fcbuild.c | 607
drivers/scsi/bfa/bfa_fcbuild.h | 87 --
2 files changed, 694 deletions
Remove the function GetEEPROMSize8188E() that is not used anywhere.
This was partially found by using a static code analysis program called
cppcheck.
Signed-off-by: Rickard Strandqvist
---
drivers/staging/rtl8188eu/hal/rtl8188e_hal_init.c | 14 --
drivers/staging/rtl8188eu
Remove the function get_fpr_index() that is not used anywhere.
This was partially found by using a static code analysis program called
cppcheck.
Signed-off-by: Rickard Strandqvist
---
arch/powerpc/kvm/book3s_pr.c |5 -
1 file changed, 5 deletions(-)
diff --git a/arch/powerpc/kvm
Remove the function slice_set_psize() that is not used anywhere.
This was partially found by using a static code analysis program called
cppcheck.
Signed-off-by: Rickard Strandqvist
---
arch/powerpc/mm/slice.c | 29 -
1 file changed, 29 deletions(-)
diff --git a
Remove the function compat_sys_mmap2() that is not used anywhere.
This was partially found by using a static code analysis program called
cppcheck.
Signed-off-by: Rickard Strandqvist
---
arch/powerpc/kernel/sys_ppc32.c |8
1 file changed, 8 deletions(-)
diff --git a/arch/powerpc
Remove the function rtl8188e_set_rssi_cmd() that is not used anywhere.
This was partially found by using a static code analysis program called
cppcheck.
Signed-off-by: Rickard Strandqvist
---
drivers/staging/rtl8188eu/hal/rtl8188e_cmd.c | 16
drivers/staging/rtl8188eu
Removes some functions that are not used anywhere:
kvmppc_core_load_guest_debugstate() kvmppc_core_load_host_debugstate()
This was partially found by using a static code analysis program called
cppcheck.
Signed-off-by: Rickard Strandqvist
---
arch/powerpc/kvm/book3s.c |8
arch
Remove the function bfa_tskim_iodone() that is not used anywhere.
This was partially found by using a static code analysis program called
cppcheck.
Signed-off-by: Rickard Strandqvist
---
drivers/scsi/bfa/bfa_fcpim.c |9 -
drivers/scsi/bfa/bfa_fcpim.h |1 -
2 files changed, 10
()
This was partially found by using a static code analysis program called
cppcheck.
Signed-off-by: Rickard Strandqvist
---
arch/arm/mach-omap2/omap_hwmod.c | 232 --
arch/arm/mach-omap2/omap_hwmod.h | 16 ---
2 files changed, 248 deletions(-)
diff --git a/arch
Remove the function sr_nx() that is not used anywhere.
This was partially found by using a static code analysis program called
cppcheck.
Signed-off-by: Rickard Strandqvist
---
arch/powerpc/kvm/book3s_32_mmu.c |5 -
1 file changed, 5 deletions(-)
diff --git a/arch/powerpc/kvm
Removes some functions that are not used anywhere:
hpi_subsys_get_version_ex() hpi_instream_wait_start()
This was partially found by using a static code analysis program called
cppcheck.
Signed-off-by: Rickard Strandqvist
---
sound/pci/asihpi/hpi.h |4
sound/pci/asihpi/hpifunc.c
Removes some functions that are not used anywhere:
pwrdm_get_voltdm() pwrdm_for_each_clkdm() pwrdm_del_clkdm()
This was partially found by using a static code analysis program called
cppcheck.
Signed-off-by: Rickard Strandqvist
---
arch/arm/mach-omap2/powerdomain.c | 81
Removes some functions that are not used anywhere:
vlv_flisdsi_read() vlv_gps_core_write() vlv_gps_core_read()
vlv_ccu_write() vlv_ccu_read() vlv_gpio_nc_read()
This was partially found by using a static code analysis program called
cppcheck.
Signed-off-by: Rickard Strandqvist
---
drivers/gpu
Remove the function tc35876x_exit() that is not used anywhere.
This was partially found by using a static code analysis program called
cppcheck.
Signed-off-by: Rickard Strandqvist
---
drivers/gpu/drm/gma500/tc35876x-dsi-lvds.c | 10 --
drivers/gpu/drm/gma500/tc35876x-dsi-lvds.h
Remove the function omap_32k_timer_read() 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-omap1/timer32k.c |5 -
1 file changed, 5 deletions(-)
diff --git a/arch/arm/mach
Remove the function irq_bank_readl() 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-omap1/irq.c |5 -
1 file changed, 5 deletions(-)
diff --git a/arch/arm/mach-omap1
Remove the function __mxs_togl() 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-mxs/mach-mxs.c |5 -
1 file changed, 5 deletions(-)
diff --git a/arch/arm/mach-mxs/mach
Remove the function vreg_put() 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-msm/include/mach/vreg.h |1 -
arch/arm/mach-msm/vreg.c |4
2 files changed
Removes some functions that are not used anywhere:
smsm_set_sleep_duration() smsm_get_state() smd_wait_until_writable()
smd_wait_until_readable() smd_write_atomic() smd_sleep_exit()
This was partially found by using a static code analysis program called
cppcheck.
Signed-off-by: Rickard
Remove the function cdce_set_rate() 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/cdce949.c | 37 --
arch/arm/mach-davinci/include
Removes some functions that are not used anywhere:
edma_shadow0_read() edma_or_array()
This was partially found by using a static code analysis program called
cppcheck.
Signed-off-by: Rickard Strandqvist
---
arch/arm/common/edma.c |8
1 file changed, 8 deletions(-)
diff --git a
Removes some functions that are not used anywhere:
idu_irq_get_pend() idu_irq_get_ack()
This was partially found by using a static code analysis program called
cppcheck.
Signed-off-by: Rickard Strandqvist
---
arch/arc/plat-arcfpga/smp.c | 27 ---
1 file changed, 27
Removes some functions that are not used anywhere:
titan_write_tig() titan_read_tig()
This was partially found by using a static code analysis program called
cppcheck.
Signed-off-by: Rickard Strandqvist
---
arch/alpha/kernel/core_titan.c | 14 --
1 file changed, 14 deletions
Remove function mem_cgroup_lru_names_not_uptodate() that is not used anywhere.
And move BUILD_BUG_ON() to the beginning of memcg_stat_show() instead.
This was partially found by using a static code analysis program called
cppcheck.
Signed-off-by: Rickard Strandqvist
---
mm/memcontrol.c |7
2014-12-03 7:55 GMT+01:00 Takashi Iwai :
> At Wed, 3 Dec 2014 00:12:55 +0100,
> Rickard Strandqvist wrote:
>>
>> Remove function snd_cmipci_pll_rmn() that is not used anywhere.
>
> It's an experimental code that is currently disabled. Keeping such a
> code wou
2014-12-03 16:54 GMT+01:00 Michal Hocko :
> On Wed 03-12-14 10:22:31, Johannes Weiner wrote:
>> On Tue, Dec 02, 2014 at 11:41:23PM +0100, Rickard Strandqvist wrote:
>> > Remove function mem_cgroup_lru_names_not_uptodate() that is not used
>> > anywhere.
>> >
&g
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
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
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-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 whe
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
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
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: Ja
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 unn
the final 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/co
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
the final 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_ran
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
>>>
>>> > 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 patc
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-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
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
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:
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
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
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
401 - 500 of 1004 matches
Mail list logo