From: Kaixu Xia
It is always true that the value of unsigned variable size_presence_reg
greater than or equal to zero, so compared with zero is unnecessary.
Remove it.
Reported-by: Tosk Robot
Signed-off-by: Kaixu Xia
---
drivers/input/rmi4/rmi_driver.c | 2 +-
1 file changed, 1 insertion(+),
From: Kaixu Xia
The commit 78429e55e4057 ("platform/x86: toshiba_acpi: Clean up
variable declaration") cleans up variable declaration in
video_proc_write(). Seems it does the variable assignment in the
wrong place, this results in dead code and changes the source code
logic. Fix it by doing the
From: Kaixu Xia
The bool variable is2T is true, so the if statement is redundant.
we can directly set the variable bound to 8 and remove the if
statement.
Reported-by: Tosk Robot
Signed-off-by: Kaixu Xia
---
drivers/staging/rtl8723bs/hal/HalPhyRf_8723B.c | 7 +--
1 file changed, 1
From: Kaixu Xia
Both of the statements are value assignment of the variable act_offset.
The first value assignment is overwritten by the second and is useless.
Remove it.
Reported-by: Tosk Robot
Signed-off-by: Kaixu Xia
---
drivers/net/ethernet/intel/e1000e/ich8lan.c | 7 ---
1 file
From: Kaixu Xia
The body of the if statement can be executed only when the variable
vlan_count equals to 32, so the condition of the while statement can
not be true and the while statement is dead code. Remove it.
Reported-by: Tosk Robot
Signed-off-by: Kaixu Xia
---
From: Kaixu Xia
The return value of dev_get_by_index_rcu() can be NULL, so here it
is need to check the return value and return error code if it is NULL.
Signed-off-by: Kaixu Xia
---
net/core/filter.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/net/core/filter.c b/net/core/filter.c
From: Kaixu Xia
The variable ret is overwritten by the following variable defrag_count.
Actually the code should return EAGAIN when receiving a pending signal
in the defrag loops.
Reported-by: Tosk Robot
Signed-off-by: Kaixu Xia
---
v2
-return EAGAIN instead of remove the EAGAIN error.
From: Kaixu Xia
It would directly return if the variable err equals to 0 or other errors.
Only when the err equals to -ETIMEDOUT it can reach the 'if (err)'
statement, so the 'if (err)' and last 'return -ETIMEDOUT' statements are
useless. Romove them.
Reported-by: Tosk Robot
Signed-off-by:
From: Kaixu Xia
The value of variable error is overwritten by the following call
devm_request_threaded_irq() in phy_mdm6600_device_power_on(), actually
we should return error when timed out powering up.
Reported-by: Tosk Robot
Signed-off-by: Kaixu Xia
---
From: Kaixu Xia
The value of variable error is overwritten by the following call
devm_request_threaded_irq() in phy_mdm6600_device_power_on(), actually
we should return error when timed out powering up.
Reported-by: Tosk Robot
Signed-off-by: Kaixu Xia
---
v2:
-directly return error when
From: Kaixu Xia
The two bool variables singletone and carrier_sup are always false
and the following if statement can't be true, these code are useless,
so remove them.
Reported-by: Tosk Robot
Signed-off-by: Kaixu Xia
---
drivers/staging/rtl8188eu/hal/phy.c | 7 ---
1 file changed, 7
From: Kaixu Xia
The variable qgroup_to_release is overwritten by the following if/else
statement before it is used, so this assignment is useless. Remove it.
Reported-by: Tosk Robot
Signed-off-by: Kaixu Xia
---
fs/btrfs/block-rsv.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
From: Kaixu Xia
The value of the bool variable ap_enable is always false, so the first
if branch is unreached code. Remove it.
Reported-by: Tosk Robot
Signed-off-by: Kaixu Xia
---
drivers/net/wireless/realtek/rtw88/coex.c | 12 +---
1 file changed, 1 insertion(+), 11 deletions(-)
From: Kaixu Xia
The variable ret is overwritten by the following call
i40e_clean_arq_element() and the assignment is useless, so remove it.
Reported-by: Tosk Robot
Signed-off-by: Kaixu Xia
---
drivers/net/ethernet/intel/i40e/i40e_main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
From: Kaixu Xia
The return value of atomisp_css_continuous_set_num_raw_frames() function
is always 0, so there's no reason for a return value. In addition, the
__enable_continuous_mode() checked the return value for possible error
which is unnecessary. Convert
From: Kaixu Xia
The return value of atomisp_css_stop() function is always 0 and there
are no callers check the return value, so there's no reason for a return
value. Convert atomisp_css_stop() to a void function.
Reported-by: Tosk Robot
Signed-off-by: Kaixu Xia
---
From: Kaixu Xia
The variable ret is overwritten by the following variable defrag_count
and this assignment is useless, so remove it.
Reported-by: Tosk Robot
Signed-off-by: Kaixu Xia
---
fs/btrfs/ioctl.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
From: Kaixu Xia
The variable u4tmp is overwritten by the following call and the assignment
is useless, so remove it.
Reported-by: Tosk Robot
Signed-off-by: Kaixu Xia
---
drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git
From: Kaixu Xia
The value of the variable status must be one of the 0, -EIO and -EILSEQ, so
the switch case -ENODATA is unreached. Remove it.
Reported-by: Tosk Robot
Signed-off-by: Kaixu Xia
---
v2:
-leave a 'default' case in there.
drivers/misc/altera-stapl/altera.c | 5 -
1 file
From: Kaixu Xia
The value of variable ret is overwritten on the delete branch in the
test_create_synth_event() and we care more about the above error than
this delete portion. Remove it.
Reported-by: Tosk Robot
Signed-off-by: Kaixu Xia
---
v2:
-remove the useless assignment in the delete
From: Kaixu Xia
The value of variable ret is overwritten on the delete branch in the
test_create_synth_event() and we care more about the above error than
this delete portion. Remove it.
Reported-by: Tosk Robot
Signed-off-by: Kaixu Xia
---
kernel/trace/synth_event_gen_test.c | 2 +-
1 file
From: Kaixu Xia
The value of variable ret is overwritten by the following call
devm_snd_soc_register_card(), so here the value assignment is useless.
Remove it.
Reported-by: Tosk Robot
Signed-off-by: Kaixu Xia
---
sound/soc/samsung/smdk_wm8994.c | 4 +---
1 file changed, 1 insertion(+), 3
From: Kaixu Xia
The value of variable timeout is overwritten by the following statement in
rtl8xxxu_gen1_init_aggregation(), so here the value assignment is useless.
Remove it.
Reported-by: Tosk Robot
Signed-off-by: Kaixu Xia
---
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 2 +-
From: Kaixu Xia
The value of the variable status must be one of the 0, -EIO and -EILSEQ, so
the switch cases -ENODATA and default are unreached. Remove them.
Reported-by: Tosk Robot
Signed-off-by: Kaixu Xia
---
drivers/misc/altera-stapl/altera.c | 9 -
1 file changed, 9 deletions(-)
From: Kaixu Xia
The value of variable error is overwritten by the following call
devm_request_threaded_irq() in phy_mdm6600_device_power_on(), so here the
value assignment is useless. Remove it.
Reported-by: Tosk Robot
Signed-off-by: Kaixu Xia
---
drivers/phy/motorola/phy-mapphone-mdm6600.c
From: Kaixu Xia
The value of variable ret is overwritten on the delete branch in the
test_create_synth_event(), so here the value assignment is useless.
Remove it.
Reported-by: Tosk Robot
Signed-off-by: Kaixu Xia
---
kernel/trace/synth_event_gen_test.c | 4 +---
1 file changed, 1
From: Kaixu Xia
The unsigned variable reg is assigned a return value from the call
to i2c_smbus_read_byte_data(), which may return negative error code.
Fixes coccicheck warning:
./drivers/hwmon/amc6821.c:215:6-9: WARNING: Unsigned expression compared with
zero: reg > 0
From: Kaixu Xia
The unsigned variable datasec_id is assigned a return value from the call
to check_pseudo_btf_id(), which may return negative error code.
Fixes coccicheck warning:
./kernel/bpf/verifier.c:9616:5-15: WARNING: Unsigned expression compared with
zero: datasec_id > 0
Reported-by:
From: Kaixu Xia
The unsigned variable datasec_id is assigned a return value from the call
to check_pseudo_btf_id(), which may return negative error code.
Fixes coccicheck warning:
./kernel/bpf/verifier.c:9616:5-15: WARNING: Unsigned expression compared with
zero: datasec_id > 0
Reported-by:
From: Kaixu Xia
The unsigned variable datasec_id is assigned a return value from the call
to check_pseudo_btf_id(), which may return negative error code.
Fixes coccicheck warning:
./kernel/bpf/verifier.c:9616:5-15: WARNING: Unsigned expression compared with
zero: datasec_id > 0
Reported-by:
From: Kaixu Xia
Fix coccicheck warning:
./arch/powerpc/platforms/powernv/pci-sriov.c:443:7-10: WARNING: Unsigned
expression compared with zero: win < 0
./arch/powerpc/platforms/powernv/pci-sriov.c:462:7-10: WARNING: Unsigned
expression compared with zero: win < 0
Reported-by: Tosk Robot
From: Kaixu Xia
Fix the following coccinelle warnings:
./drivers/hwtracing/coresight/coresight-tmc-etr.c:957:2-15: WARNING: Assignment
of 0/1 to bool variable
Fix them by assigning boolean values.
Reported-by: Tosk Robot
Signed-off-by: Kaixu Xia
---
From: Kaixu Xia
Fixes coccicheck warning:
./arch/powerpc/mm/pgtable_32.c:87:11-12: WARNING comparing pointer to 0
Avoid pointer type value compared to 0.
Reported-by: Tosk Robot
Signed-off-by: Kaixu Xia
---
arch/powerpc/mm/pgtable_32.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
From: Kaixu Xia
Fixes coccicheck warning:
/arch/sparc/mm/srmmu.c:354:42-43: WARNING comparing pointer to 0
Avoid pointer type value compared to 0.
Reported-by: Tosk Robot
Signed-off-by: Kaixu Xia
---
arch/sparc/mm/srmmu.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git
From: Kaixu Xia
The function lpfc_sli_process_sol_iocb() always return 1, so there's no
reason for a return value. In addition, no other functions will use the
return value of lpfc_sli_process_sol_iocb().
Convert lpfc_sli_process_sol_iocb() to a void function, and fix the
following Coccinelle
From: Kaixu Xia
Fix the following coccicheck warning:
./drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c:2415:5-11: Unneeded
variable: "retval". Return "0" on line 2435
Reported-by: Tosk Robot
Signed-off-by: Kaixu Xia
---
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c | 3 +--
1
From: Kaixu Xia
Fix the following coccinelle report:
./drivers/s390/net/qeth_l3_main.c:107:2-4: WARNING: possible condition with no
effect (if == else)
Both branches are the same, so remove them.
Reported-by: Tosk Robot
Signed-off-by: Kaixu Xia
---
drivers/s390/net/qeth_l3_main.c | 5
From: Kaixu Xia
The '!=' expression itself is bool, no need to convert it to bool.
Fix the following coccicheck warning:
./drivers/net/ethernet/aquantia/atlantic/aq_nic.c:1477:34-39: WARNING:
conversion to bool not needed here
Reported-by: Tosk Robot
Signed-off-by: Kaixu Xia
---
From: Kaixu Xia
Fix the following coccicheck warning:
./drivers/scsi/bnx2fc/bnx2fc_fcoe.c:2089:5-23: WARNING: Comparison to bool
./drivers/scsi/bnx2fc/bnx2fc_fcoe.c:2187:5-23: WARNING: Comparison to bool
Reported-by: Tosk Robot
Signed-off-by: Kaixu Xia
---
drivers/scsi/bnx2fc/bnx2fc_fcoe.c
From: Kaixu Xia
Fix the following coccicheck warning:
./sound/firewire/amdtp-stream.h:273:6-19: WARNING: Comparison to bool
Reported-by: Tosk Robot
Signed-off-by: Kaixu Xia
---
sound/firewire/amdtp-stream.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git
From: Kaixu Xia
Fix the following coccicheck warning:
./fs/proc/generic.c:370:5-31: WARNING: Comparison to bool
Reported-by: Tosk Robot
Signed-off-by: Kaixu Xia
---
fs/proc/generic.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/proc/generic.c b/fs/proc/generic.c
From: Kaixu Xia
Fix the following coccinelle warnings:
./drivers/net/ethernet/mellanox/mlx4/en_rx.c:687:1-17: WARNING: Assignment of
0/1 to bool variable
Reported-by: Tosk Robot
Signed-off-by: Kaixu Xia
---
drivers/net/ethernet/mellanox/mlx4/en_rx.c | 2 +-
1 file changed, 1 insertion(+),
From: Kaixu Xia
Fix the following coccinelle warnings:
./arch/powerpc/kvm/book3s_xics.c:476:3-15: WARNING: Assignment of 0/1 to bool
variable
./arch/powerpc/kvm/book3s_xics.c:504:3-15: WARNING: Assignment of 0/1 to bool
variable
Reported-by: Tosk Robot
Signed-off-by: Kaixu Xia
---
From: Kaixu Xia
Fix the following coccinelle reports:
./arch/x86/kernel/cpu/mce/core.c:1765:3-20: WARNING: Assignment of 0/1 to bool
variable
./arch/x86/kernel/cpu/mce/core.c:1584:2-9: WARNING: Assignment of 0/1 to bool
variable
Reported-by: Tosk Robot
Signed-off-by: Kaixu Xia
---
From: Kaixu Xia
The '>=' expression itself is bool, no need to convert it to bool.
Fix the following coccicheck warning:
./sound/soc/codecs/wcd9335.c:3982:25-30: WARNING: conversion to bool not needed
here
Reported-by: Tosk Robot
Signed-off-by: Kaixu Xia
---
sound/soc/codecs/wcd9335.c | 2
From: Kaixu Xia
Fix the following coccicheck warning:
./drivers/pinctrl/pinctrl-ocelot.c:732:28-33: WARNING: conversion to bool not
needed here
Reported-by: Tosk Robot
Signed-off-by: Kaixu Xia
---
drivers/pinctrl/pinctrl-ocelot.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff
From: Kaixu Xia
Here we could use the '!=' expression to fix the following coccicheck
warning:
./net/netfilter/xt_nfacct.c:30:41-46: WARNING: conversion to bool not needed
here
Reported-by: Tosk Robot
Signed-off-by: Kaixu Xia
---
net/netfilter/xt_nfacct.c | 2 +-
1 file changed, 1
From: Kaixu Xia
Fix the following coccicheck warning:
./drivers/rtc/rtc-da9063.c:246:5-18: WARNING: Comparison to bool
Reported-by: Tosk Robot
Signed-off-by: Kaixu Xia
---
drivers/rtc/rtc-da9063.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/rtc/rtc-da9063.c
From: Kaixu Xia
Here we could use the '!=' expression to fix the following coccicheck
warning:
./drivers/rtc/rtc-sc27xx.c:566:50-55: WARNING: conversion to bool not needed
here
Reported-by: Tosk Robot
Signed-off-by: Kaixu Xia
---
drivers/rtc/rtc-sc27xx.c | 2 +-
1 file changed, 1
From: Kaixu Xia
Fix following warning from coccinelle:
./tools/lib/bpf/libbpf.c:1478:43-48: WARNING: conversion to bool not needed here
Signed-off-by: Kaixu Xia
---
tools/lib/bpf/libbpf.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/lib/bpf/libbpf.c
From: Kaixu Xia
Fix the following coccinelle reports:
./tools/perf/util/intel-bts.c:472:3-13: WARNING: Assignment of 0/1 to bool
variable
./tools/perf/util/intel-bts.c:515:3-13: WARNING: Assignment of 0/1 to bool
variable
Reported-by: Tosk Robot
Signed-off-by: Kaixu Xia
---
From: Kaixu Xia
Here we could use the '!=' expression to fix the following coccicheck
warning:
./tools/perf/builtin-script.c:3209:48-53: WARNING: conversion to bool not
needed here
./tools/perf/builtin-script.c:2761:36-41: WARNING: conversion to bool not
needed here
Reported-by: Tosk Robot
From: Kaixu Xia
The '!=' expression itself is bool, no need to convert it to bool.
Fix the following coccicheck warning:
./drivers/net/ethernet/aquantia/atlantic/aq_nic.c:1477:34-39: WARNING:
conversion to bool not needed here
Reported-by: Tosk Robot
Signed-off-by: Kaixu Xia
---
From: Kaixu Xia
Here we could use the normal helper kobj_to_dev() to get the device
to simplify code.
Reported-by: Tosk Robot
Signed-off-by: Kaixu Xia
---
drivers/scsi/lpfc/lpfc_attr.c | 7 +++
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/drivers/scsi/lpfc/lpfc_attr.c
From: Kaixu Xia
Here we could use the dma_pool_zalloc() function instead of
dma_pool_alloc/memset.
Reported-by: Tosk Robot
Signed-off-by: Kaixu Xia
---
drivers/scsi/qla2xxx/qla_os.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/scsi/qla2xxx/qla_os.c
From: Kaixu Xia
Fix the gcc warning:
drivers/net/ethernet/chelsio/cxgb4/cxgb4_debugfs.c:2673:9: warning: this 'for'
clause does not guard... [-Wmisleading-indentation]
2673 | for (i = 0; i < n; ++i) \
Reported-by: Tosk Robot
Signed-off-by: Kaixu Xia
---
From: Xiaoming Gao
when kernel crash, and kexec into kdump kernel, megaraid_sas will hung and
print follow error logs
24.1485901 sd 0:0:G:0: [sda 1 tag809 BRCfl Debug mfi stat 0x2(1, data len
requested/conpleted 0X100
0/0x0)]
24.1867171 sd 0:0:G :9: [sda I tag861 BRCfl Debug mfft stat 0x2d,
57 matches
Mail list logo