Used kmemdup instead of kmalloc and memcpy.
Patch found using coccinelle.
Signed-off-by: Alexandru Gheorghiu
---
drivers/parport/parport_gsc.c |4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/parport/parport_gsc.c b/drivers/parport/parport_gsc.c
index 050773c
Replaced calls to kmalloc and memset with kzalloc.
Patch found using coccinelle.
Signed-off-by: Alexandru Gheorghiu
---
drivers/parport/share.c |3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/parport/share.c b/drivers/parport/share.c
index a848e02..6a83ee1
Use kstrdup function instead of kmalloc and strcpy.
Patch found using coccinelle.
Signed-off-by: Alexandru Gheorghiu
---
fs/reiserfs/super.c |4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/fs/reiserfs/super.c b/fs/reiserfs/super.c
index 194113b..f8a23c3 100644
--- a/fs
Use ERR_CAST function instead of ERR_PTR and PTR_ERR.
Patch found using coccinelle.
Signed-off-by: Alexandru Gheorghiu
---
drivers/usb/gadget/composite.c |2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/usb/gadget/composite.c b/drivers/usb/gadget/composite.c
index
Use ERR_CAST function instead of ERR_PTR and PTR_ERR.
Patch found using coccinelle.
Signed-off-by: Alexandru Gheorghiu
---
lib/digsig.c |2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/digsig.c b/lib/digsig.c
index 2f31e6a..8793aed 100644
--- a/lib/digsig.c
+++ b/lib
Use devm_request_and_ioremap function which provides more consistent error
handling.
Signed-off-by: Alexandru Gheorghiu
---
drivers/dma/txx9dmac.c |6 +-
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/drivers/dma/txx9dmac.c b/drivers/dma/txx9dmac.c
index 913f55c..471f9f1
Use PTR_RET function instead of IS_ERR and PTR_ERR.
Patch found using coccinelle.
Signed-off-by: Alexandru Gheorghiu
---
block/ioctl.c |2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/block/ioctl.c b/block/ioctl.c
index a31d91d..4698c1f7 100644
--- a/block/ioctl.c
+++ b
Use PTR_RET function instead of IS_ERR and PTR_ERR.
Patch found using coccinelle.
Signed-off-by: Alexandru Gheorghiu
---
block/blk-timeout.c |2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/block/blk-timeout.c b/block/blk-timeout.c
index 6e4744c..2a6aba0 100644
--- a/block
Used PTR_RET function instead of IS_ERR and PTR_ERR.
Patch found using coccinelle.
Signed-off-by: Alexandru Gheorghiu
---
block/blk-core.c |2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/block/blk-core.c b/block/blk-core.c
index 074b758..3a85a55 100644
--- a/block/blk
Use kmemdup instead of kzalloc and memcpy.
Signed-off-by: Alexandru Gheorghiu
---
fs/f2fs/node.c| 12 +---
fs/f2fs/segment.c |3 +--
2 files changed, 6 insertions(+), 9 deletions(-)
diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c
index e275218..9f5eca4 100644
--- a/fs/f2fs
Used kmemdup instead of kzalloc and memcpy.
Signed-off-by: Alexandru Gheorghiu
---
fs/f2fs/node.c| 11 ---
fs/f2fs/segment.c |3 +--
2 files changed, 5 insertions(+), 9 deletions(-)
diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c
index e275218..920f53a 100644
--- a/fs/f2fs
Used kmemdup instead of kzalloc followed by memcpy.
Patch found using coccinelle.
Signed-off-by: Alexandru Gheorghiu
---
fs/f2fs/segment.c |3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
index 777f17e..1758149 100644
--- a/fs/f2fs
Use kmemdup instead of kmalloc followed by memcpy.
Patch found using coccinelle.
Signed-off-by: Alexandru Gheorghiu
---
fs/dlm/lowcomms.c |3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/fs/dlm/lowcomms.c b/fs/dlm/lowcomms.c
index 4f5ad24..bfd6fbc 100644
--- a/fs/dlm
Used PTR_RET function instead of IS_ERR and PTR_ERR.
Patch found using coccinelle.
Signed-off-by: Alexandru Gheorghiu
---
sound/soc/soc-io.c |5 +
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/sound/soc/soc-io.c b/sound/soc/soc-io.c
index 29183ef..8ca9ecc 100644
--- a
Used kmemdup instead of replicating it's behaviour with kmalloc followed
by memcpy.
Patch found using coccinelle.
Signed-off-by: Alexandru Gheorghiu
---
sound/oss/sb_common.c |3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/sound/oss/sb_common.c b/sound/oss/sb_com
Used kmemdup instead of replicating it's behaviour with kmalloc followed
by memcpy.
Patch found using coccinelle.
Signed-off-by: Alexandru Gheorghiu
---
sound/oss/uart401.c | 11 +++
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/sound/oss/uart401.c b/sound/oss/ua
Used PTR_RET function instead of IS_ERR and PTR_ERR.
Patch found using coccinelle.
Signed-off-by: Alexandru Gheorghiu
---
drivers/virtio/virtio_mmio.c |5 +
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/drivers/virtio/virtio_mmio.c b/drivers/virtio/virtio_mmio.c
index
Use PTR_RET function instead of IS_ERR and PTR_ERR.
Patch found using coccinelle.
Signed-off-by: Alexandru Gheorghiu
---
drivers/video/omap2/dss/core.c |5 +
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/drivers/video/omap2/dss/core.c b/drivers/video/omap2/dss/core.c
Used memdup_user function instead of kmalloc and copy_from_user.
Patch found using coccinelle.
Signed-off-by: Alexandru Gheorghiu
---
drivers/message/fusion/mptctl.c | 13 +++--
1 file changed, 3 insertions(+), 10 deletions(-)
diff --git a/drivers/message/fusion/mptctl.c b/drivers
Used kmemdup function instead of kmalloc and memcpy.
Patch found using coccinelle.
Signed-off-by: Alexandru Gheorghiu
---
drivers/message/fusion/mptbase.c |3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/message/fusion/mptbase.c b/drivers/message/fusion/mptbase.c
Use kstrdup instead kmalloc and strcpy.
Patch found using coccinelle
Signed-off-by: Alexandru Gheorghiu
---
drivers/message/i2o/memory.c |3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/message/i2o/memory.c b/drivers/message/i2o/memory.c
index 292b41e..1741a59
Used PTR_RET function instead of IS_ERR and PTR_ERR.
Patch found using coccinelle.
Signed-off-by: Alexandru Gheorghiu
---
drivers/platform/x86/samsung-q10.c |5 +
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/drivers/platform/x86/samsung-q10.c
b/drivers/platform/x86
Used memdup_user function instead of kmalloc followed by copy_from_user.
Also, handled return error using IS_ERR and PTR_ERR.
Patch found using coccinelle.
Signed-off-by: Alexandru Gheorghiu
---
drivers/ptp/ptp_chardev.c | 11 +++
1 file changed, 3 insertions(+), 8 deletions(-)
diff
Used PTR_RET function instead of IS_ERR and PTR_ERR.
Patch found using coccinelle.
Signed-off-by: Alexandru Gheorghiu
---
drivers/regulator/fan53555.c |4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/regulator/fan53555.c b/drivers/regulator/fan53555.c
index
Replaced calls to kzalloc followed by memcpy with a single call to kmemdup.
Signed-off-by: Alexandru Gheorghiu
---
net/bluetooth/a2mp.c |6 ++
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/net/bluetooth/a2mp.c b/net/bluetooth/a2mp.c
index eb0f4b1..17f33a6 100644
--- a
Use devm_ioremap_resource function, which provides better error handling,
instead of devm_request_and_ioremap.
Patch found using coccinelle.
Signed-off-by: Alexandru Gheorghiu
---
drivers/cpuidle/cpuidle-kirkwood.c |6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a
Use resource_size function instead of explicit computation.
Patch found using coccinelle.
Signed-off-by: Alexandru Gheorghiu
---
drivers/ata/pata_octeon_cf.c |2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/ata/pata_octeon_cf.c b/drivers/ata/pata_octeon_cf.c
index
Used PTR_RET function instead of IS_ERR and PTR_ERR.
Patch found using coccinelle.
Signed-off-by: Alexandru Gheorghiu
---
drivers/char/tile-srom.c |2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/char/tile-srom.c b/drivers/char/tile-srom.c
index 3b22a60..2e2036e
Replaced calls to kmalloc followed by strcpy with a sincle call to kstrdup.
Patch found using coccinelle.
Signed-off-by: Alexandru Gheorghiu
---
drivers/char/ipmi/ipmi_msghandler.c |3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/char/ipmi/ipmi_msghandler.c
b
Used PTR_RET function instead of IS_ERR and PTR_ERR.
Patch found using coccinelle.
Signed-off-by: Alexandru Gheorghiu
---
net/bluetooth/hci_sysfs.c |4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/net/bluetooth/hci_sysfs.c b/net/bluetooth/hci_sysfs.c
index 23b4e24
Replaced calls to kzalloc followed by memcpy with a single call to kmemdup.
Patch found using coccinelle.
Signed-off-by: Alexandru Gheorghiu
---
net/bluetooth/a2mp.c |6 ++
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/net/bluetooth/a2mp.c b/net/bluetooth/a2mp.c
index
Replace use of kmalloc followed by memcpy with kmemdup.
Patch found using coccinelle.
Signed-off-by: Alexandru Gheorghiu
---
net/dns_resolver/dns_query.c |3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/net/dns_resolver/dns_query.c b/net/dns_resolver/dns_query.c
index
Use the newly introduced devm_ioremap_resource() instead of
devm_request_and_ioremap() which provides more consistent error
handling.
Signed-off-by: Alexandru Gheorghiu
---
drivers/gpio/gpio-vt8500.c |6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/gpio/gpio
Replaced calls to IS_ERR and PTR_ERR with PTR_RET function.
Patch found using coccinelle.
Signed-off-by: Alexandru Gheorghiu
---
drivers/spi/spidev.c |2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/spi/spidev.c b/drivers/spi/spidev.c
index 2e0655d..911e9e0 100644
Replaced calls to IS_ERR and PTR_ERR with PTR_RET function.
Patch found using coccinelle.
Signed-off-by: Alexandru Gheorghiu
---
drivers/spi/spi-fsl-spi.c |4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/spi/spi-fsl-spi.c b/drivers/spi/spi-fsl-spi.c
index
Replaced call to devm_request_and_ioremap with devm_ioremap_resource which
provides better error handling.
Signed-off-by: Alexandru Gheorghiu
---
drivers/dma/pl330.c |6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c
index
Rewrote conditional statement and eliminated the out_kthread label.
Signed-off-by: Alexandru Gheorghiu
---
arch/s390/mm/cmm.c |8 +++-
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/arch/s390/mm/cmm.c b/arch/s390/mm/cmm.c
index 479e942..9d84a1f 100644
--- a/arch/s390/mm
Used PTR_RET function instead of IS_ERR and PTR_ERR.
Patch found using coccinelle.
Signed-off-by: Alexandru Gheorghiu
---
arch/s390/hypfs/hypfs_dbfs.c |4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/arch/s390/hypfs/hypfs_dbfs.c b/arch/s390/hypfs/hypfs_dbfs.c
index
Used PTR_RET function instead of IS_ERR and PTR_ERR.
Patch found using coccinelle.
Signed-off-by: Alexandru Gheorghiu
---
arch/s390/mm/cmm.c |2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/s390/mm/cmm.c b/arch/s390/mm/cmm.c
index 479e942..5cf867f 100644
--- a/arch
Used kzalloc instead of kmalloc followed by memset with 0.
Patch found using coccinelle.
Signed-off-by: Alexandru Gheorghiu
---
arch/s390/net/bpf_jit_comp.c |3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/arch/s390/net/bpf_jit_comp.c b/arch/s390/net/bpf_jit_comp.c
index
Used resource_size function instead of explicit computation.
Signed-off-by: Alexandru Gheorghiu
---
drivers/acpi/osl.c |2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c
index 586e7e9..4d31748 100644
--- a/drivers/acpi/osl.c
+++ b
Used PTR_RET function instead of explicit checking with IS_ERR.
Signed-off-by: Alexandru Gheorghiu
---
drivers/acpi/acpi_pad.c |2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/acpi/acpi_pad.c b/drivers/acpi/acpi_pad.c
index 31de104..27bb6a9 100644
--- a/drivers
Replaced calls to kmalloc followed by memcpy with a single call to kmemdup.
Patch found using coccinelle.
Signed-off-by: Alexandru Gheorghiu
---
drivers/acpi/bus.c |5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c
index 01708a1
Used resource_size function instead of explicit computation.
Patch found using coccinelle.
Signed-off-by: Alexandru Gheorghiu
---
drivers/mmc/host/wmt-sdmmc.c |2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/mmc/host/wmt-sdmmc.c b/drivers/mmc/host/wmt-sdmmc.c
index
Replaced calls to kmalloc followed by memcpy with a single call to kmemdup.
Also removed a now redundant if statement.
Signed-off-by: Alexandru Gheorghiu
---
drivers/gpu/drm/i915/intel_dp.c |5 +
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/i915
Replaced calls kzalloc followed by memcpy with call to kmemdup.
Patch found using coccinelle.
Signed-off-by: Alexandru Gheorghiu
---
drivers/gpu/drm/gma500/intel_bios.c |3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/gma500/intel_bios.c
b/drivers/gpu
Replaced ERR_PTR and PTR_ERR calls with ERR_CAST.
Patch found using coccinelle.
Signed-off-by: Alexandru Gheorghiu
---
drivers/gpu/drm/drm_prime.c |2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/drm_prime.c b/drivers/gpu/drm/drm_prime.c
index 366910d
Replaced calls to kmalloc followed by memcpy with a single call to kmemdup.
This patch was found using coccinelle.
Signed-off-by: Alexandru Gheorghiu
---
drivers/gpu/drm/i915/intel_dp.c |3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/i915/intel_dp.c b
Replaced calls to kzalloc followed by memcpy with call to kmemdup.
Patch found using coccinelle.
Signed-off-by: Alexandru Gheorghiu
---
drivers/gpu/drm/exynos/exynos_drm_vidi.c |6 ++
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/exynos/exynos_drm_vidi.c
Replaced calls to kmalloc followed by memcpy with single call to kmemdup.
This patch was found using coccicheck.
Signed-off-by: Alexandru Gheorghiu
---
fs/btrfs/send.c |3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/fs/btrfs/send.c b/fs/btrfs/send.c
index f7a8b86
Replaced calls to kmalloc and memcpy with a single call to kmemdup.
This patch was found using coccicheck.
Signed-off-by: Alexandru Gheorghiu
---
fs/pstore/ram.c |3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/fs/pstore/ram.c b/fs/pstore/ram.c
index 288f068..38babb3
Replaced calls to kmalloc followd by memcpy with a single call to kmemdup.
This patch was found using coccicheck.
Signed-off-by: Alexandru Gheorghiu
---
fs/ocfs2/localalloc.c |6 ++
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/fs/ocfs2/localalloc.c b/fs/ocfs2
Replaced kmalloc followed by memset calls with a single kzalloc call.
This was found using coccicheck.
Signed-off-by: Alexandru Gheorghiu
---
arch/x86/platform/uv/uv_time.c |3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/arch/x86/platform/uv/uv_time.c b/arch/x86
Use resource_size function on resource object instead of explicit
computation.
Signed-off-by: Alexandru Gheorghiu
---
drivers/staging/media/davinci_vpfe/dm365_ipipeif.c |3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/staging/media/davinci_vpfe/dm365_ipipeif.c
b
Fixed coding style issue by removing trailing whitespaces.
Signed-off-by: Alexandru Gheorghiu
---
kernel/signal.c | 10 +-
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/kernel/signal.c b/kernel/signal.c
index 2ec870a..fd9a953 100644
--- a/kernel/signal.c
+++ b/kernel
Removed unused variable 'c' and fixed the following warning:
arch/x86/kernel/smpboot.c: In function ‘mwait_play_dead’:
arch/x86/kernel/smpboot.c:1370:22: warning: unused variable ‘c’
[-Wunused-variable]
Signed-off-by: Alexandru Gheorghiu
---
arch/x86/kernel/smpboot.c |1 -
1 fi
Removed unused function nfnl_get_lock which fixed the following warning:
net/netfilter/nfnetlink.c:65:22: warning: ‘nfnl_get_lock’ defined but not used
[-Wunused-function]
Signed-off-by: Alexandru Gheorghiu
---
net/netfilter/nfnetlink.c |5 -
1 file changed, 5 deletions(-)
diff --git
Fixed coding style issue.
Signed-off-by: Alexandru Gheorghiu
---
drivers/staging/silicom/bp_mod.c |4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/silicom/bp_mod.c b/drivers/staging/silicom/bp_mod.c
index 58c5f5c..61a912d 100644
--- a/drivers/staging
58 matches
Mail list logo