simple_strtol and simple_strtoul are obsolete, both place
use kstrtouint instead.
V2: fix error tmp += tn
V3: fix compile error
Signed-off-by: Ding Xiang
---
drivers/bluetooth/bt3c_cs.c | 9 ++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/drivers/bluetooth/bt3c_cs.c b
simple_strtoul is obsolete, and use kstrtoint instead
Signed-off-by: Ding Xiang
---
drivers/power/supply/ab8500_fg.c | 21 +++--
1 file changed, 15 insertions(+), 6 deletions(-)
diff --git a/drivers/power/supply/ab8500_fg.c b/drivers/power/supply/ab8500_fg.c
index 02356f9
If fw is null then fw->size will trigger null pointer dereference
Signed-off-by: Ding Xiang
---
drivers/staging/greybus/bootrom.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/greybus/bootrom.c
b/drivers/staging/greybus/bootrom.c
index e85ffae..3af2
delete redundant semicolon
Signed-off-by: Ding Xiang
---
fs/ubifs/sb.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/ubifs/sb.c b/fs/ubifs/sb.c
index bf17f58..d5c55e2 100644
--- a/fs/ubifs/sb.c
+++ b/fs/ubifs/sb.c
@@ -603,7 +603,7 @@ int ubifs_read_superblock(struct
simple_strtol and simple_strtoul are obsolete, both place
use kstrtoul instead.
Signed-off-by: Ding Xiang
---
drivers/bluetooth/bt3c_cs.c | 10 +++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/drivers/bluetooth/bt3c_cs.c b/drivers/bluetooth/bt3c_cs.c
index 25b0cf9
simple_strtol and simple_strtoul are obsolete, both place
use kstrtoul instead.
V2: fix error tmp += tn
Signed-off-by: Ding Xiang
---
drivers/bluetooth/bt3c_cs.c | 9 ++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/drivers/bluetooth/bt3c_cs.c b/drivers/bluetooth
Hi, Johan
sorry, it's my fault.
On 8/24/2018 2:29 PM, Johan Hovold wrote:
On Fri, Aug 24, 2018 at 12:07:11AM -0400, Ding Xiang wrote:
If fw is null then fw->size will trigger null pointer dereference
Signed-off-by: Ding Xiang
---
drivers/staging/greybus/bootrom.c | 2 +-
For single statement blocks,braces are not necessary.
And "else" is not useful after return. So,remove these code.
Signed-off-by: Ding Xiang
---
drivers/cpufreq/acpi-cpufreq.c | 10 --
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/drivers/cpufreq/acpi-cpufreq.c
use PTR_ERR_OR_ZERO inetead of return code
Signed-off-by: Ding Xiang
---
drivers/clk/davinci/da8xx-cfgchip.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/clk/davinci/da8xx-cfgchip.c
b/drivers/clk/davinci/da8xx-cfgchip.c
index d1bbee1..bdc5236 100644
--- a
The variable will check in debugfs_remove_recursive, so
the NULL check here is not needed
Signed-off-by: Ding Xiang
---
drivers/fmc/fmc-debug.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/fmc/fmc-debug.c b/drivers/fmc/fmc-debug.c
index 3293072..ab868a3 100644
if ovl_encode_real_fh() fails, no memory was allocated
and the error in the error-valued pointer should be returned.
Fixes: 9b6faee0747 ("ovl: check ERR_PTR() return value from ovl_encode_fh()")
Signed-off-by: Ding Xiang
---
fs/overlayfs/export.c | 2 +-
1 file changed, 1 inser
Fix a static code checker warning:
fs/ocfs2/acl.c:331
ocfs2_acl_chmod() warn: passing zero to 'PTR_ERR'
Fixes: 5ee0fbd50fd ("ocfs2: revert using ocfs2_acl_chmod to avoid inode cluster
lock hang")
Signed-off-by: Ding Xiang
---
fs/ocfs2/acl.c | 4 ++--
1 file changed
devm_ioremap_resource already contains error message, so remove
the redundant dev_err message
Signed-off-by: Ding Xiang
---
drivers/fpga/ts73xx-fpga.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/fpga/ts73xx-fpga.c b/drivers/fpga/ts73xx-fpga.c
index 9a17fe9
"len" is unneeded,just return 0
Signed-off-by: Ding Xiang
---
drivers/net/wireless/ath/ath9k/gpio.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/net/wireless/ath/ath9k/gpio.c
b/drivers/net/wireless/ath/ath9k/gpio.c
index b457e52..f3d1bc0 100644
---
if ovl_encode_real_fh() fails, no memory was allocated
and the error in the error-valued pointer should be returned.
V1->V2: fix SHA1 length problem
Fixes: 9b6faee07470 ("ovl: check ERR_PTR() return value from ovl_encode_fh()")
Signed-off-by: Ding Xiang
---
fs/overlayfs/export.c |
debugfs_remove_recursive will do NULL check, so remove
the redundant null check
Signed-off-by: Ding Xiang
---
drivers/remoteproc/remoteproc_debugfs.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/drivers/remoteproc/remoteproc_debugfs.c
b/drivers/remoteproc/remoteproc_debugfs.c
index
platform_get_irq already contains error message, so remove
the redundant dev_err message
Signed-off-by: Ding Xiang
---
drivers/virtio/virtio_mmio.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/virtio/virtio_mmio.c b/drivers/virtio/virtio_mmio.c
index e09edb5
Fix a static code checker warning:
fs/nfs/nfs4idmap.c:331
nfs_idmap_get_key() warn: passing zero to 'PTR_ERR'
Signed-off-by: Ding Xiang
---
fs/nfs/nfs4idmap.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/nfs/nfs4idmap.c b/fs/nfs/nfs4idmap.c
ind
devm_ioremap_resource already contains error message, so remove
the redundant dev_err message
Signed-off-by: Ding Xiang
---
drivers/ata/libahci_platform.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/ata/libahci_platform.c b/drivers/ata/libahci_platform.c
index 72312ad..3a36e76
put_device will call stm_source_device_release to free
stm_source_device, so remove the kfree.
Signed-off-by: Ding Xiang
---
drivers/hwtracing/stm/core.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/hwtracing/stm/core.c b/drivers/hwtracing/stm/core.c
index e55b902..181e7ff 100644
device_unregister will call put_device,
so remove the redundant put_device
Signed-off-by: Ding Xiang
---
drivers/spi/spi.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
index 75ac046..d753689 100644
--- a/drivers/spi/spi.c
+++ b
devm_ioremap_resource already contains error message, so remove
the redundant dev_err message
Signed-off-by: Ding Xiang
---
drivers/pwm/pwm-sifive.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/pwm/pwm-sifive.c b/drivers/pwm/pwm-sifive.c
index a7c107f..bb4f02c
simple_strtoll is obsolete, and use kstrtoll instead
Signed-off-by: Ding Xiang
---
fs/libfs.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/fs/libfs.c b/fs/libfs.c
index 7e52e77..69cc01d 100644
--- a/fs/libfs.c
+++ b/fs/libfs.c
@@ -883,7 +883,8 @@ ssize_t
use resource_size to calcuate ioremap size and make
the code simpler.
Signed-off-by: Ding Xiang
---
drivers/net/ethernet/atheros/ag71xx.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/atheros/ag71xx.c
b/drivers/net/ethernet/atheros/ag71xx.c
index
If devm_ioremap() failed, it will return NULL pointer not
ERR_PTR(). So, use NULL test instead of IS_ERR() test.
Signed-off-by: Ding Xiang
---
drivers/mailbox/zynqmp-ipi-mailbox.c | 16
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/drivers/mailbox/zynqmp-ipi
devm_ioremap_resource already contains error message, so remove
the redundant dev_err message
Signed-off-by: Ding Xiang
---
drivers/nvmem/bcm-ocotp.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/nvmem/bcm-ocotp.c b/drivers/nvmem/bcm-ocotp.c
index a809751
"error" is unneeded,just return 0
Signed-off-by: Ding Xiang
---
drivers/net/ethernet/myricom/myri10ge/myri10ge.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/myricom/myri10ge/myri10ge.c
b/drivers/net/ethernet/myricom/myri10ge/myri10
devm_ioremap_resource already contains error message, so remove
the redundant dev_err message
Signed-off-by: Ding Xiang
---
drivers/gpio/gpio-ixp4xx.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/gpio/gpio-ixp4xx.c b/drivers/gpio/gpio-ixp4xx.c
index 670c2a8
put_device will call ac97_codec_release to free
ac97_codec_device and other resources, so remove the kfree
and other redundant code.
Signed-off-by: Ding Xiang
---
sound/ac97/bus.c | 13 -
1 file changed, 4 insertions(+), 9 deletions(-)
diff --git a/sound/ac97/bus.c b/sound/ac97
devm_ioremap_resource already contains error message, so remove
the redundant dev_err message
Signed-off-by: Ding Xiang
---
drivers/ptp/ptp_dte.c | 5 +
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/drivers/ptp/ptp_dte.c b/drivers/ptp/ptp_dte.c
index 5b6393e..0dcfdc8 100644
devm_ioremap_resource already contains error message, so remove
the redundant dev_err message
Signed-off-by: Ding Xiang
---
arch/arm/mach-zx/zx296702-pm-domain.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/arch/arm/mach-zx/zx296702-pm-domain.c
b/arch/arm/mach-zx
devm_ioremap_resource already contains error message, so remove
the redundant dev_err message
Signed-off-by: Ding Xiang
---
drivers/media/rc/meson-ir.c | 4 +---
drivers/media/rc/mtk-cir.c | 4 +---
drivers/media/rc/sunxi-cir.c | 1 -
3 files changed, 2 insertions(+), 7 deletions(-)
diff
devm_ioremap_resource already contains error message, so remove
the redundant dev_err message
Signed-off-by: Ding Xiang
---
drivers/slimbus/qcom-ctrl.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/slimbus/qcom-ctrl.c b/drivers/slimbus/qcom-ctrl.c
index ad3e2e23
The return code after switch default is unreachable,
so remove it.
Signed-off-by: Ding Xiang
---
drivers/scsi/scsi_error.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c
index bfa569f..12180f0 100644
--- a/drivers/scsi/scsi_error.c
+++ b
use dma_zalloc_coherent instead of dma_alloc_coherent/memset
Signed-off-by: Ding Xiang
---
arch/sh/mm/consistent.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/arch/sh/mm/consistent.c b/arch/sh/mm/consistent.c
index 792f361..aa4e450 100644
--- a/arch/sh/mm/consistent.c
the memory allocated and ioremap address need free after
device_register return error.
Signed-off-by: Ding Xiang
---
arch/mips/txx9/generic/setup.c | 6 --
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/arch/mips/txx9/generic/setup.c b/arch/mips/txx9/generic/setup.c
index
the memory allocated and ioremap address need free after
device_register return error.
v2: remove redundant "return"
Signed-off-by: Ding Xiang
---
arch/mips/txx9/generic/setup.c | 7 ---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/arch/mips/txx9/generic/setu
On 9/5/2018 11:37 PM, Atsushi Nemoto wrote:
On Wed, 5 Sep 2018 19:22:19 +0800, Ding Xiang
wrote:
the memory allocated and ioremap address need free after
device_register return error.
...
exit_put:
put_device(&dev->dev);
- return;
+exit_free:
+ iounmap(de
if device_register return error, iounmap should be called, also iounmap
need to call before put_device.
Signed-off-by: Ding Xiang
---
arch/mips/txx9/generic/setup.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/arch/mips/txx9/generic/setup.c b/arch/mips/txx9/generic
device_unregister will put device, do not need to do it one more time
Signed-off-by: Ding Xiang
---
drivers/s390/scsi/zfcp_unit.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/s390/scsi/zfcp_unit.c b/drivers/s390/scsi/zfcp_unit.c
index 1bf0a09..6b50084 100644
--- a/drivers/s390
On 9/6/2018 2:24 PM, Heiko Carstens wrote:
On Thu, Sep 06, 2018 at 02:16:27PM +0800, Ding Xiang wrote:
device_unregister will put device, do not need to do it one more time
Signed-off-by: Ding Xiang
---
drivers/s390/scsi/zfcp_unit.c | 2 --
1 file changed, 2 deletions(-)
diff --git a
put_device will call vme_dev_release to free vdev, kfree is
unnecessary here.
Signed-off-by: Ding Xiang
---
drivers/vme/vme.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/vme/vme.c b/drivers/vme/vme.c
index 92500f6..520a5f9 100644
--- a/drivers/vme/vme.c
+++ b/drivers/vme/vme.c
use PTR_ERR_OR_ZERO for bpf__setup_stdout return code
Signed-off-by: Ding Xiang
---
tools/perf/util/bpf-loader.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/perf/util/bpf-loader.c b/tools/perf/util/bpf-loader.c
index 47aac41..f9ae1a9 100644
--- a/tools/perf/util
use PTR_ERR_OR_ZERO for bpf__setup_stdout return code
v2: add macro PTR_ERR_OR_ZERO to err.h
Signed-off-by: Ding Xiang
---
tools/include/linux/err.h| 7 +++
tools/perf/util/bpf-loader.c | 2 +-
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/tools/include/linux/err.h b
Add PTR_ERR_OR_ZERO, and tools can use it.
Signed-off-by: Ding Xiang
---
tools/include/linux/err.h | 7 +++
1 file changed, 7 insertions(+)
diff --git a/tools/include/linux/err.h b/tools/include/linux/err.h
index 7a8b61a..0946496 100644
--- a/tools/include/linux/err.h
+++ b/tools/include
use PTR_ERR_OR_ZERO for bpf__setup_stdout return code,
it looks better.
Signed-off-by: Ding Xiang
---
tools/perf/util/bpf-loader.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/perf/util/bpf-loader.c b/tools/perf/util/bpf-loader.c
index 47aac41..f9ae1a9 100644
--- a
simple_strtoul is obsolete, and use kstrtouint instead
Signed-off-by: Ding Xiang
---
security/tomoyo/common.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/security/tomoyo/common.c b/security/tomoyo/common.c
index 03923a1..9b38f94 100644
--- a/security/tomoyo/common.c
Use kobj_to_dev() instead of container_of()
Signed-off-by: Ding Xiang
---
drivers/staging/fieldbus/dev_core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/fieldbus/dev_core.c
b/drivers/staging/fieldbus/dev_core.c
index 1ba0234cc60d..5aab734606ea 100644
The check result of (!A || (A && B)) is equivalent to (!A || B),
so remove redundant NULL check of "params"
Signed-off-by: Ding Xiang
---
drivers/staging/media/atomisp/pci/sh_css_params.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/staging
NULL check before kfree is unneeded, so remove it.
Signed-off-by: Ding Xiang
---
drivers/mtd/parsers/afs.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/mtd/parsers/afs.c b/drivers/mtd/parsers/afs.c
index 0c73002..972b260 100644
--- a/drivers/mtd/parsers/afs.c
simple_strtoul is obsolete, use kstrtoul instead.
Signed-off-by: Ding Xiang
---
drivers/sh/intc/userimask.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/sh/intc/userimask.c b/drivers/sh/intc/userimask.c
index 87d69e7..d1d8e9b 100644
--- a/drivers/sh/intc
The range of max_hops is 0~15 and gap_count_table size is 16,
so the condition is always true, just remove it.
Signed-off-by: Ding Xiang
---
drivers/firewire/core-card.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/firewire/core-card.c b/drivers/firewire/core
Fix a static code checker warning:
drivers/fmc/fmc-debug.c:155
fmc_debug_init() warn: passing zero to 'PTR_ERR'
Signed-off-by: Ding Xiang
---
drivers/fmc/fmc-debug.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/fmc/fmc-debug.c b/drivers/fmc/f
Fix a static code checker warning:
drivers/block/loop.c:798 loop_attr_backing_file_show()
warn: passing zero to 'PTR_ERR'
Signed-off-by: Ding Xiang
---
drivers/block/loop.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/block/loop.c b/drivers/bl
The variable data is assigned but never used in rest code.
Signed-off-by: Ding Xiang
---
drivers/staging/xgifb/vb_setmode.c |1 -
1 files changed, 0 insertions(+), 1 deletions(-)
diff --git a/drivers/staging/xgifb/vb_setmode.c
b/drivers/staging/xgifb/vb_setmode.c
index 50c8ea4..71bb9ca
The variable data is assigned but never used in rest code.
Signed-off-by: Ding Xiang
---
drivers/staging/xgifb/vb_setmode.c |1 -
1 files changed, 0 insertions(+), 1 deletions(-)
diff --git a/drivers/staging/xgifb/vb_setmode.c
b/drivers/staging/xgifb/vb_setmode.c
index 50c8ea4..71bb9ca
Commit-ID: 01ab2e91103b8c23dfedfeb799bc8b810d585bd0
Gitweb: https://git.kernel.org/tip/01ab2e91103b8c23dfedfeb799bc8b810d585bd0
Author: Ding Xiang
AuthorDate: Fri, 7 Sep 2018 09:34:41 +0800
Committer: Arnaldo Carvalho de Melo
CommitDate: Wed, 19 Sep 2018 10:25:08 -0300
tools include
Commit-ID: e381d1c21eea186daed6834af444575e06841355
Gitweb: https://git.kernel.org/tip/e381d1c21eea186daed6834af444575e06841355
Author: Ding Xiang
AuthorDate: Fri, 7 Sep 2018 09:34:42 +0800
Committer: Arnaldo Carvalho de Melo
CommitDate: Wed, 19 Sep 2018 10:25:09 -0300
perf bpf-loader
58 matches
Mail list logo