Re: [PATCH] arch: powerpc: kernel: signal_32.c: Remove unused function

2014-12-07 Thread Rickard Strandqvist
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

[PATCH] gpu: drm: i915: intel_dsi_pll.c: Remove unused function

2014-12-07 Thread Rickard Strandqvist
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

[PATCH] tools: testing: selftests: powerpc: pmu: ebb: trace.c: Remove some unused functions

2014-12-07 Thread Rickard Strandqvist
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

[PATCH] arch: powerpc: kernel: vio.c: Remove unused function

2014-12-07 Thread Rickard Strandqvist
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

[PATCH] arch: arm: mach-omap2: dpll44xx.c: Remove unused function

2014-12-07 Thread Rickard Strandqvist
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

[PATCH] arch: powerpc: kvm: book3s_paired_singles.c: Remove unused function

2014-12-07 Thread Rickard Strandqvist
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

[PATCH] staging: rtl8192e: rtl8192e: rtl_cam.c: Remove unused function

2014-12-07 Thread Rickard Strandqvist
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

[PATCH] arch: arm: mach-omap2: cm33xx.c: Remove some unused functions

2014-12-07 Thread Rickard Strandqvist
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

[PATCH] arch: powerpc: kernel: smp.c: Remove unused function

2014-12-07 Thread Rickard Strandqvist
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

[PATCH] scsi: bfa: bfad.c: Remove unused function

2014-12-07 Thread Rickard Strandqvist
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

[PATCH] arch: powerpc: kernel: signal_32.c: Remove unused function

2014-12-07 Thread Rickard Strandqvist
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

[PATCH] staging: vt6655: mac.c: Remove unused function

2014-12-07 Thread Rickard Strandqvist
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

[PATCH] net: wireless: rtlwifi: rtl8192de: fw.c: Remove unused function

2014-12-07 Thread Rickard Strandqvist
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

[PATCH] staging: rtl8188eu: os_dep: usb_ops_linux.c: Remove unused function

2014-12-07 Thread Rickard Strandqvist
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

[PATCH] gpu: drm: i915: intel_dsi_cmd.c: Remove unused function

2014-12-07 Thread Rickard Strandqvist
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

[PATCH] arch: arm: mach-omap2: clkt2xxx_apll.c: Remove some unused functions

2014-12-07 Thread Rickard Strandqvist
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

[PATCH] gpu: drm: i915: intel_dp.c: Remove unused function

2014-12-07 Thread Rickard Strandqvist
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

[PATCH] arch: mn10300: kernel: traps.c: Remove unused function

2014-12-07 Thread Rickard Strandqvist
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

[PATCH] arch: frv: mm: extable.c: Remove unused function

2014-12-07 Thread Rickard Strandqvist
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

[PATCH] tools: testing: selftests: powerpc: pmu: ebb: ebb.c: Remove unused function

2014-12-07 Thread Rickard Strandqvist
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

[PATCH] arch: arm: mach-omap2: omap-pm-noop.c: Remove some unused functions

2014-12-07 Thread Rickard Strandqvist
() 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

[PATCH] arch: openrisc: kernel: traps.c: Remove unused function

2014-12-07 Thread Rickard Strandqvist
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

[PATCH] arch: powerpc: kernel: traps.c: Remove unused function

2014-12-07 Thread Rickard Strandqvist
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

[PATCH] gpu: drm: i915: intel_display.c: Remove unused function

2014-12-07 Thread Rickard Strandqvist
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

[PATCH] scsi: bfa: bfa_fcbuild.c: Remove some unused functions

2014-12-07 Thread Rickard Strandqvist
() 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

[PATCH] staging: rtl8188eu: hal: rtl8188e_hal_init.c: Remove unused function

2014-12-07 Thread Rickard Strandqvist
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

[PATCH] arch: powerpc: kvm: book3s_pr.c: Remove unused function

2014-12-07 Thread Rickard Strandqvist
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

[PATCH] arch: powerpc: mm: slice.c: Remove unused function

2014-12-07 Thread Rickard Strandqvist
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

[PATCH] arch: powerpc: kernel: sys_ppc32.c: Remove unused function

2014-12-07 Thread Rickard Strandqvist
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

[PATCH] staging: rtl8188eu: hal: rtl8188e_cmd.c: Remove unused function

2014-12-07 Thread Rickard Strandqvist
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

[PATCH] arch: powerpc: kvm: book3s.c: Remove some unused functions

2014-12-07 Thread Rickard Strandqvist
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

[PATCH] scsi: bfa: bfa_fcpim.c: Remove unused function

2014-12-07 Thread Rickard Strandqvist
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

[PATCH] arch: arm: mach-omap2: omap_hwmod.c: Remove some unused functions

2014-12-07 Thread Rickard Strandqvist
() 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

[PATCH] arch: powerpc: kvm: book3s_32_mmu.c: Remove unused function

2014-12-07 Thread Rickard Strandqvist
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

[PATCH] sound: pci: asihpi: hpifunc.c: Remove some unused functions

2014-12-07 Thread Rickard Strandqvist
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

[PATCH] arch: arm: mach-omap2: powerdomain.c: Remove some unused functions

2014-12-07 Thread Rickard Strandqvist
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

[PATCH] gpu: drm: i915: intel_sideband.c: Remove some unused functions

2014-12-07 Thread Rickard Strandqvist
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

[PATCH] gpu: drm: gma500: tc35876x-dsi-lvds.c: Remove unused function

2014-12-07 Thread Rickard Strandqvist
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

[PATCH] arch: arm: mach-omap1: timer32k.c: Remove unused function

2014-12-07 Thread Rickard Strandqvist
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

[PATCH] arch: arm: mach-omap1: irq.c: Remove unused function

2014-12-07 Thread Rickard Strandqvist
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

[PATCH] arch: arm: mach-mxs: mach-mxs.c: Remove unused function

2014-12-06 Thread Rickard Strandqvist
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

[PATCH] arch: arm: mach-msm: vreg.c: Remove unused function

2014-12-06 Thread Rickard Strandqvist
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

[PATCH] arch: arm: mach-msm: smd.c: Remove some unused functions

2014-12-06 Thread Rickard Strandqvist
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

[PATCH] arch: arm: mach-davinci: cdce949.c: Remove unused function

2014-12-06 Thread Rickard Strandqvist
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

[PATCH] arch: arm: common: edma.c: Remove some unused functions

2014-12-06 Thread Rickard Strandqvist
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

[PATCH] arch: arc: plat-arcfpga: smp.c: Remove some unused functions

2014-12-06 Thread Rickard Strandqvist
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

[PATCH] arch: alpha: kernel: core_titan.c: Remove some unused functions

2014-12-06 Thread Rickard Strandqvist
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

[PATCH] mm: memcontrol.c: Cleaning up function that are not used anywhere

2014-12-06 Thread Rickard Strandqvist
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

Re: [PATCH] sound: pci: cmipci.c: Cleaning up function that are not used anywhere

2014-12-03 Thread Rickard Strandqvist
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

Re: [PATCH] mm: memcontrol.c: Cleaning up function that are not used anywhere

2014-12-03 Thread Rickard Strandqvist
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

[PATCH] sound: pci: cmipci.c: Cleaning up function that are not used anywhere

2014-12-02 Thread Rickard Strandqvist
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

[PATCH] sound: pci: azt3328.c: Cleaning up function that are not used anywhere

2014-12-02 Thread Rickard Strandqvist
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

[PATCH] mm: memcontrol.c: Cleaning up function that are not used anywhere

2014-12-02 Thread Rickard Strandqvist
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

[PATCH] staging: rtl8188eu: hal: hal_intf.c: Cleaning up functions that are not used anywhere

2014-12-02 Thread Rickard Strandqvist
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

[PATCH] arch: arm: mach-davinci: serial.c: Cleaning up function that are not used anywhere

2014-12-02 Thread Rickard Strandqvist
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

[PATCH] arch: alpha: kernel: core_lca.c: Cleaning up functions that are not used anywhere

2014-12-02 Thread Rickard Strandqvist
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

[PATCH] staging: comedi: drivers: comedi_bond.c: Remove unneeded #define

2014-11-02 Thread Rickard Strandqvist
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

Re: [PATCH 2/5] scsi: bfa: bfa_fcs_lport.c: Cleaning up missing null-terminate by switching from strncpy to strzcpy

2014-10-20 Thread Rickard Strandqvist
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

Re: [PATCH 1/5] lib: string.c: Added a function strzcpy

2014-10-19 Thread Rickard Strandqvist
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

[PATCH 5/5] mmc: host: vub300.c: Cleaning up missing null-terminate by switching from strncpy to strzcpy

2014-10-18 Thread Rickard Strandqvist
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

[PATCH 4/5] power: charger-manager.c: Cleaning up missing null-terminate by switching from strncpy to strzcpy

2014-10-18 Thread Rickard Strandqvist
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

[PATCH 3/5] video: fbdev: uvesafb.c: Cleaning up missing null-terminate by switching from strncpy to strzcpy

2014-10-18 Thread Rickard Strandqvist
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

[PATCH 2/5] scsi: bfa: bfa_fcs_lport.c: Cleaning up missing null-terminate by switching from strncpy to strzcpy

2014-10-18 Thread Rickard Strandqvist
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

[PATCH 1/5] lib: string.c: Added a function strzcpy

2014-10-18 Thread Rickard Strandqvist
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

[PATCH v2] staging: comedi: drivers: comedi_bond.c: Changed from using strncat to strlcat

2014-10-18 Thread Rickard Strandqvist
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

Re: [PATCH v2] lib: string.c: Added a funktion function strzcpy

2014-10-16 Thread Rickard Strandqvist
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: >> > >> >

[PATCH v5] char: hw_random: core.c: Changed from using strncat to strlcat

2014-10-16 Thread Rickard Strandqvist
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

Re: [PATCH v2] lib: string.c: Added a funktion function strzcpy

2014-10-16 Thread Rickard Strandqvist
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

Re: [PATCH v4] char: hw_random: core.c: Changed from using strncat to strlcat

2014-10-16 Thread Rickard Strandqvist
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

[PATCH v4] char: hw_random: core.c: Changed from using strncat to strlcat

2014-10-16 Thread Rickard Strandqvist
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

Re: [PATCH 3v] char: hw_random: core.c: Changed from using strncat to strlcat

2014-10-16 Thread Rickard Strandqvist
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

Re: [PATCH 3v] char: hw_random: core.c: Changed from using strncat to strlcat

2014-10-16 Thread Rickard Strandqvist
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

[PATCH 3v] char: hw_random: core.c: Changed from using strncat to strlcat

2014-10-16 Thread Rickard Strandqvist
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

Re: [PATCH v2] char: hw_random: core.c: Changed from using strncat to strlcat

2014-10-16 Thread Rickard Strandqvist
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

Re: [PATCH] net: ethernet: marvell: sky2.c: Cleaning up missing null-terminate in conjunction with strncpy

2014-10-14 Thread 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. >>> >> >>> >>

Re: [PATCH] staging: lustre: lustre: libcfs: debug.c: Cleaning up unnecessary use of memset in conjunction with strncpy

2014-10-14 Thread Rickard Strandqvist
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

Re: [PATCH v2] char: hw_random: core.c: Changed from using strncat to strlcat

2014-10-14 Thread Rickard Strandqvist
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: >> &

Re: [PATCH v2] char: hw_random: core.c: Changed from using strncat to strlcat

2014-10-13 Thread Rickard Strandqvist
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

Re: [PATCH] tools: perf: util: sort.c: Changed from using strncat to strlcat

2014-10-13 Thread Rickard Strandqvist
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 +

Re: [PATCH] staging: comedi: drivers: comedi_bond.c: Changed from using strncat to strlcat

2014-10-13 Thread Rickard Strandqvist
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

Re: [PATCH] net: wireless: brcm80211: brcmfmac: dhd_sdio.c: Cleaning up missing null-terminate in conjunction with strncpy

2014-10-13 Thread Rickard Strandqvist
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

[PATCH] tools: perf: util: sort.c: Changed from using strncat to strlcat

2014-10-12 Thread Rickard Strandqvist
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

[PATCH] scripts: docproc.c: Changed from using strncat to strlcat

2014-10-12 Thread Rickard Strandqvist
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

Re: [PATCH] target: iscsi: iscsi_target_tpg.c: Cleaning up possible size overwriting in conjunction with sprintf

2014-10-12 Thread Rickard Strandqvist
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

[PATCH] kernel: debug: kdb: kdb_main.c: Replacing strncat with strlcat to avoid overwrite size

2014-10-12 Thread Rickard Strandqvist
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

[PATCH] target: iscsi: iscsi_target_tpg.c: Cleaning up possible size overwriting in conjunction with sprintf

2014-10-12 Thread Rickard Strandqvist
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

[PATCH] staging: lustre: lustre: ptlrpc: sec.c: Replacing strncat with strlcat to avoid overwrite size

2014-10-12 Thread Rickard Strandqvist
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

[PATCH] staging: comedi: drivers: comedi_bond.c: Changed from using strncat to strlcat

2014-10-12 Thread Rickard Strandqvist
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

[PATCH v2] brcmfmac: dhd_sdio.c: Cleaning up missing null-terminate in conjunction with strncpy

2014-10-12 Thread Rickard Strandqvist
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

[PATCH v2] brcmfmac: dhd_sdio.c: Cleaning up missing null-terminate in conjunction with strncpy

2014-10-12 Thread Rickard Strandqvist
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:

Re: [PATCH] net: wireless: brcm80211: brcmfmac: dhd_sdio.c: Cleaning up missing null-terminate in conjunction with strncpy

2014-10-12 Thread Rickard Strandqvist
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

[PATCH v2] char: hw_random: core.c: Changed from using strncat to strlcat

2014-10-12 Thread Rickard Strandqvist
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

Re: [PATCH] char: hw_random: core.c: Changed from using strncpy to strlcpy

2014-10-12 Thread Rickard Strandqvist
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

[PATCH] net: wireless: brcm80211: brcmfmac: dhd_sdio.c: Cleaning up missing null-terminate in conjunction with strncpy

2014-10-11 Thread Rickard Strandqvist
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

[PATCH] char: hw_random: core.c: Changed from using strncpy to strlcpy

2014-10-11 Thread Rickard Strandqvist
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

[PATCH v2] gpu: drm: drm_dp_mst_topology.c: Fix improper use of strncat

2014-10-11 Thread Rickard Strandqvist
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

[PATCH] gpu: drm: drm_dp_mst_topology.c: Fix improper use of strncat.

2014-10-05 Thread Rickard Strandqvist
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

Re: [PATCH] lib: string.c: A speed optimized for strncpy

2014-10-05 Thread Rickard Strandqvist
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

[PATCH] lib: string.c: A speed optimized for strncpy

2014-10-05 Thread Rickard Strandqvist
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

[PATCH] lib: string.c: A speed optimized for strncpy

2014-10-05 Thread Rickard Strandqvist
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

<    1   2   3   4   5   6   7   8   9   10   >