[PATCH -next] staging: comedi: tests: ni_routes_test: Remove unused variable 'olddevroutes'

2021-04-10 Thread Qiheng Lin
GCC reports the following warning with W=1:

drivers/staging/comedi/drivers/tests/ni_routes_test.c:215:45: warning:
 variable 'olddevroutes' set but not used [-Wunused-but-set-variable]
  215 |  const struct ni_device_routes *devroutes, *olddevroutes;
  | ^~~~

This variable is not used in function , this commit
remove it to fix the warning.

Reported-by: Hulk Robot 
Signed-off-by: Qiheng Lin 
---
 .../staging/comedi/drivers/tests/ni_routes_test.c  | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/comedi/drivers/tests/ni_routes_test.c 
b/drivers/staging/comedi/drivers/tests/ni_routes_test.c
index 48e4a7a9cd14..652362486ff6 100644
--- a/drivers/staging/comedi/drivers/tests/ni_routes_test.c
+++ b/drivers/staging/comedi/drivers/tests/ni_routes_test.c
@@ -212,7 +212,7 @@ static bool route_set_sources_in_order(const struct 
ni_device_routes *devroutes)
 
 static void test_ni_assign_device_routes(void)
 {
-   const struct ni_device_routes *devroutes, *olddevroutes;
+   const struct ni_device_routes *devroutes;
const u8 *table, *oldtable;
 
init_pci_6070e();
@@ -248,7 +248,6 @@ static void test_ni_assign_device_routes(void)
 RVI(table, B(NI_AI_ConvertClock), B(NI_PFI(2))) == 
V(NI_PFI_OUTPUT_AI_CONVERT),
 "pci-6070e finds e-series route_values table\n");
 
-   olddevroutes = devroutes;
oldtable = table;
init_pci_6220();
ni_assign_device_routes(ni_mseries, pci_6220, NULL,



[PATCH -next] Bluetooth: use flexible-array member instead of zero-length array

2021-04-09 Thread Qiheng Lin
Fix the following coccicheck warning:

net/bluetooth/msft.c:37:6-13: WARNING use flexible-array member instead
net/bluetooth/msft.c:42:6-10: WARNING use flexible-array member instead
net/bluetooth/msft.c:52:6-10: WARNING use flexible-array member instead

Signed-off-by: Qiheng Lin 
---
 net/bluetooth/msft.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/net/bluetooth/msft.c b/net/bluetooth/msft.c
index e28f15439ce4..37a394786a94 100644
--- a/net/bluetooth/msft.c
+++ b/net/bluetooth/msft.c
@@ -34,12 +34,12 @@ struct msft_le_monitor_advertisement_pattern {
__u8 length;
__u8 data_type;
__u8 start_byte;
-   __u8 pattern[0];
+   __u8 pattern[];
 };
 
 struct msft_le_monitor_advertisement_pattern_data {
__u8 count;
-   __u8 data[0];
+   __u8 data[];
 };
 
 struct msft_cp_le_monitor_advertisement {
@@ -49,7 +49,7 @@ struct msft_cp_le_monitor_advertisement {
__u8 rssi_low_interval;
__u8 rssi_sampling_period;
__u8 cond_type;
-   __u8 data[0];
+   __u8 data[];
 } __packed;
 
 struct msft_rp_le_monitor_advertisement {
-- 
2.31.1



[PATCH -next] drm/i915/display: remove redundant NULL check

2021-04-09 Thread Qiheng Lin
Fix the following coccicheck warning:

drivers/gpu/drm/i915/display/intel_psr.c:1530:29-31: WARNING
 !A || A && B is equivalent to !A || B

Signed-off-by: Qiheng Lin 
---
 drivers/gpu/drm/i915/display/intel_psr.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_psr.c 
b/drivers/gpu/drm/i915/display/intel_psr.c
index 32d3d56259c2..4cec6b4d7fb9 100644
--- a/drivers/gpu/drm/i915/display/intel_psr.c
+++ b/drivers/gpu/drm/i915/display/intel_psr.c
@@ -1526,8 +1526,7 @@ void intel_psr_wait_for_idle(const struct 
intel_crtc_state *new_crtc_state)
u32 psr_status;
 
mutex_lock(_dp->psr.lock);
-   if (!intel_dp->psr.enabled ||
-   (intel_dp->psr.enabled && intel_dp->psr.psr2_enabled)) {
+   if (!intel_dp->psr.enabled || intel_dp->psr.psr2_enabled) {
mutex_unlock(_dp->psr.lock);
continue;
}
-- 
2.31.1



[PATCH -next] drm/etnaviv: remove unneeded if-null-free check

2021-04-09 Thread Qiheng Lin
Eliminate the following coccicheck warning:

drivers/gpu/drm/etnaviv/etnaviv_gem_submit.c:616:2-8: WARNING:
 NULL check before some freeing functions is not needed.
drivers/gpu/drm/etnaviv/etnaviv_gem_submit.c:618:2-8: WARNING:
 NULL check before some freeing functions is not needed.
drivers/gpu/drm/etnaviv/etnaviv_gem_submit.c:620:2-8: WARNING:
 NULL check before some freeing functions is not needed.
drivers/gpu/drm/etnaviv/etnaviv_gem_submit.c:622:2-8: WARNING:
 NULL check before some freeing functions is not needed.

Signed-off-by: Qiheng Lin 
---
 drivers/gpu/drm/etnaviv/etnaviv_gem_submit.c | 12 
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gem_submit.c 
b/drivers/gpu/drm/etnaviv/etnaviv_gem_submit.c
index d05c35994579..bd0d66ebf314 100644
--- a/drivers/gpu/drm/etnaviv/etnaviv_gem_submit.c
+++ b/drivers/gpu/drm/etnaviv/etnaviv_gem_submit.c
@@ -612,14 +612,10 @@ int etnaviv_ioctl_gem_submit(struct drm_device *dev, void 
*data,
 err_submit_cmds:
if (ret && (out_fence_fd >= 0))
put_unused_fd(out_fence_fd);
-   if (stream)
-   kvfree(stream);
-   if (bos)
-   kvfree(bos);
-   if (relocs)
-   kvfree(relocs);
-   if (pmrs)
-   kvfree(pmrs);
+   kvfree(stream);
+   kvfree(bos);
+   kvfree(relocs);
+   kvfree(pmrs);
 
return ret;
 }
-- 
2.31.1



[PATCH -next] scsi: qla2xxx: remove unneeded if-null-free check

2021-04-09 Thread Qiheng Lin
Eliminate the following coccicheck warning:

drivers/scsi/qla2xxx/qla_os.c:4622:2-7:
 WARNING: NULL check before some freeing functions is not needed.
drivers/scsi/qla2xxx/qla_os.c:4637:3-8:
 WARNING: NULL check before some freeing functions is not needed.

Signed-off-by: Qiheng Lin 
---
 drivers/scsi/qla2xxx/qla_os.c | 6 ++
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
index 12959e3874cb..d74c32f84ef5 100644
--- a/drivers/scsi/qla2xxx/qla_os.c
+++ b/drivers/scsi/qla2xxx/qla_os.c
@@ -4618,8 +4618,7 @@ qla2x00_free_fw_dump(struct qla_hw_data *ha)
dma_free_coherent(>pdev->dev,
EFT_SIZE, ha->eft, ha->eft_dma);
 
-   if (ha->fw_dump)
-   vfree(ha->fw_dump);
+   vfree(ha->fw_dump);
 
ha->fce = NULL;
ha->fce_dma = 0;
@@ -4633,8 +4632,7 @@ qla2x00_free_fw_dump(struct qla_hw_data *ha)
ha->fw_dump_len = 0;
 
for (j = 0; j < 2; j++, fwdt++) {
-   if (fwdt->template)
-   vfree(fwdt->template);
+   vfree(fwdt->template);
fwdt->template = NULL;
fwdt->length = 0;
}
-- 
2.31.1



[PATCH -next] scsi: qla4xxx: remove unneeded if-null-free check

2021-04-09 Thread Qiheng Lin
Eliminate the following coccicheck warning:

drivers/scsi/qla4xxx/ql4_os.c:4175:2-7: WARNING:
 NULL check before some freeing functions is not needed.
drivers/scsi/qla4xxx/ql4_os.c:4196:2-7: WARNING:
 NULL check before some freeing functions is not needed.
drivers/scsi/qla4xxx/ql4_os.c:4215:2-7: WARNING:
 NULL check before some freeing functions is not needed.
drivers/scsi/qla4xxx/ql4_os.c:6400:2-7: WARNING:
 NULL check before some freeing functions is not needed.
drivers/scsi/qla4xxx/ql4_os.c:6402:2-7: WARNING:
 NULL check before some freeing functions is not needed.
drivers/scsi/qla4xxx/ql4_os.c:6555:2-7: WARNING:
 NULL check before some freeing functions is not needed.
drivers/scsi/qla4xxx/ql4_os.c:6557:2-7: WARNING:
 NULL check before some freeing functions is not needed.
drivers/scsi/qla4xxx/ql4_os.c:7838:2-7: WARNING:
 NULL check before some freeing functions is not needed.
drivers/scsi/qla4xxx/ql4_os.c:7840:2-7: WARNING:
 NULL check before some freeing functions is not needed.

Signed-off-by: Qiheng Lin 
---
 drivers/scsi/qla4xxx/ql4_os.c | 27 +--
 1 file changed, 9 insertions(+), 18 deletions(-)

diff --git a/drivers/scsi/qla4xxx/ql4_os.c b/drivers/scsi/qla4xxx/ql4_os.c
index 867730ed21f7..ad3afe30f617 100644
--- a/drivers/scsi/qla4xxx/ql4_os.c
+++ b/drivers/scsi/qla4xxx/ql4_os.c
@@ -4171,8 +4171,7 @@ static void qla4xxx_mem_free(struct scsi_qla_host *ha)
dma_free_coherent(>pdev->dev, ha->queues_len, ha->queues,
  ha->queues_dma);
 
-   if (ha->fw_dump)
-   vfree(ha->fw_dump);
+   vfree(ha->fw_dump);
 
ha->queues_len = 0;
ha->queues = NULL;
@@ -4192,8 +4191,7 @@ static void qla4xxx_mem_free(struct scsi_qla_host *ha)
 
dma_pool_destroy(ha->chap_dma_pool);
 
-   if (ha->chap_list)
-   vfree(ha->chap_list);
+   vfree(ha->chap_list);
ha->chap_list = NULL;
 
dma_pool_destroy(ha->fw_ddb_dma_pool);
@@ -4211,8 +4209,7 @@ static void qla4xxx_mem_free(struct scsi_qla_host *ha)
iounmap(ha->reg);
}
 
-   if (ha->reset_tmplt.buff)
-   vfree(ha->reset_tmplt.buff);
+   vfree(ha->reset_tmplt.buff);
 
pci_release_regions(ha->pdev);
 }
@@ -6396,10 +6393,8 @@ static int qla4xxx_is_session_exists(struct 
scsi_qla_host *ha,
}
 
 exit_check:
-   if (fw_tddb)
-   vfree(fw_tddb);
-   if (tmp_tddb)
-   vfree(tmp_tddb);
+   vfree(fw_tddb);
+   vfree(tmp_tddb);
return ret;
 }
 
@@ -6551,10 +6546,8 @@ static int qla4xxx_is_flash_ddb_exists(struct 
scsi_qla_host *ha,
}
 
 exit_check:
-   if (fw_tddb)
-   vfree(fw_tddb);
-   if (tmp_tddb)
-   vfree(tmp_tddb);
+   vfree(fw_tddb);
+   vfree(tmp_tddb);
return ret;
 }
 
@@ -7834,10 +7827,8 @@ static int qla4xxx_sysfs_ddb_logout(struct 
iscsi_bus_flash_session *fnode_sess,
ret = -ESRCH;
 
 exit_ddb_logout:
-   if (flash_tddb)
-   vfree(flash_tddb);
-   if (tmp_tddb)
-   vfree(tmp_tddb);
+   vfree(flash_tddb);
+   vfree(tmp_tddb);
if (fw_ddb_entry)
dma_pool_free(ha->fw_ddb_dma_pool, fw_ddb_entry, fw_ddb_dma);
 
-- 
2.31.1



[PATCH net-next] cxgb4: remove unneeded if-null-free check

2021-04-09 Thread Qiheng Lin
Eliminate the following coccicheck warning:

drivers/net/ethernet/chelsio/cxgb4/cxgb4_tc_u32.c:529:3-9: WARNING:
 NULL check before some freeing functions is not needed.
drivers/net/ethernet/chelsio/cxgb4/cxgb4_tc_u32.c:533:2-8: WARNING:
 NULL check before some freeing functions is not needed.
drivers/net/ethernet/chelsio/cxgb4/cxgb4_cudbg.c:161:2-7: WARNING:
 NULL check before some freeing functions is not needed.
drivers/net/ethernet/chelsio/cxgb4/clip_tbl.c:327:3-9: WARNING:
 NULL check before some freeing functions is not needed.

Signed-off-by: Qiheng Lin 
---
 drivers/net/ethernet/chelsio/cxgb4/clip_tbl.c | 3 +--
 drivers/net/ethernet/chelsio/cxgb4/cxgb4_cudbg.c  | 3 +--
 drivers/net/ethernet/chelsio/cxgb4/cxgb4_tc_u32.c | 8 ++--
 3 files changed, 4 insertions(+), 10 deletions(-)

diff --git a/drivers/net/ethernet/chelsio/cxgb4/clip_tbl.c 
b/drivers/net/ethernet/chelsio/cxgb4/clip_tbl.c
index ce28820c57c9..12fcf84d67ad 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/clip_tbl.c
+++ b/drivers/net/ethernet/chelsio/cxgb4/clip_tbl.c
@@ -323,8 +323,7 @@ void t4_cleanup_clip_tbl(struct adapter *adap)
struct clip_tbl *ctbl = adap->clipt;
 
if (ctbl) {
-   if (ctbl->cl_list)
-   kvfree(ctbl->cl_list);
+   kvfree(ctbl->cl_list);
kvfree(ctbl);
}
 }
diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_cudbg.c 
b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_cudbg.c
index 77648e4ab4cc..dd66b244466d 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_cudbg.c
+++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_cudbg.c
@@ -157,8 +157,7 @@ static int cudbg_alloc_compress_buff(struct cudbg_init 
*pdbg_init)
 
 static void cudbg_free_compress_buff(struct cudbg_init *pdbg_init)
 {
-   if (pdbg_init->compress_buff)
-   vfree(pdbg_init->compress_buff);
+   vfree(pdbg_init->compress_buff);
 }
 
 int cxgb4_cudbg_collect(struct adapter *adap, void *buf, u32 *buf_size,
diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_tc_u32.c 
b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_tc_u32.c
index dede02505ceb..a5d2f84dcdd5 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_tc_u32.c
+++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_tc_u32.c
@@ -524,13 +524,9 @@ struct cxgb4_tc_u32_table *cxgb4_init_tc_u32(struct 
adapter *adap)
 out_no_mem:
for (i = 0; i < t->size; i++) {
struct cxgb4_link *link = >table[i];
-
-   if (link->tid_map)
-   kvfree(link->tid_map);
+   kvfree(link->tid_map);
}
-
-   if (t)
-   kvfree(t);
+   kvfree(t);
 
return NULL;
 }
-- 
2.31.1



[PATCH -next] mailbox: arm_mhu_db: Remove redundant dev_err call in mhu_db_probe()

2021-04-09 Thread Qiheng Lin
There is a error message within devm_ioremap_resource
already, so remove the dev_err call to avoid redundant
error message.

Reported-by: Hulk Robot 
Signed-off-by: Qiheng Lin 
---
 drivers/mailbox/arm_mhu_db.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/mailbox/arm_mhu_db.c b/drivers/mailbox/arm_mhu_db.c
index 8eb66c4ecf5b..9e9c1261da2a 100644
--- a/drivers/mailbox/arm_mhu_db.c
+++ b/drivers/mailbox/arm_mhu_db.c
@@ -278,10 +278,8 @@ static int mhu_db_probe(struct amba_device *adev, const 
struct amba_id *id)
return -ENOMEM;
 
mhu->base = devm_ioremap_resource(dev, >res);
-   if (IS_ERR(mhu->base)) {
-   dev_err(dev, "ioremap failed\n");
+   if (IS_ERR(mhu->base))
return PTR_ERR(mhu->base);
-   }
 
chans = devm_kcalloc(dev, max_chans, sizeof(*chans), GFP_KERNEL);
if (!chans)



[PATCH -next] ASoC: sun4i-codec: remove redundant dev_err call in sun4i_codec_probe()

2021-04-09 Thread Qiheng Lin
There is a error message within devm_ioremap_resource
already, so remove the dev_err call to avoid redundant
error message.

Reported-by: Hulk Robot 
Signed-off-by: Qiheng Lin 
---
 sound/soc/sunxi/sun4i-codec.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/sound/soc/sunxi/sun4i-codec.c b/sound/soc/sunxi/sun4i-codec.c
index 6c13cc84b3fb..00b73b7444b7 100644
--- a/sound/soc/sunxi/sun4i-codec.c
+++ b/sound/soc/sunxi/sun4i-codec.c
@@ -1706,10 +1706,8 @@ static int sun4i_codec_probe(struct platform_device 
*pdev)
 
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
base = devm_ioremap_resource(>dev, res);
-   if (IS_ERR(base)) {
-   dev_err(>dev, "Failed to map the registers\n");
+   if (IS_ERR(base))
return PTR_ERR(base);
-   }
 
quirks = of_device_get_match_data(>dev);
if (quirks == NULL) {



[PATCH -next] soc: amlogic: meson-clk-measure: remove redundant dev_err call in meson_msr_probe()

2021-04-09 Thread Qiheng Lin
There is a error message within devm_ioremap_resource
already, so remove the dev_err call to avoid redundant
error message.

Reported-by: Hulk Robot 
Signed-off-by: Qiheng Lin 
---
 drivers/soc/amlogic/meson-clk-measure.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/soc/amlogic/meson-clk-measure.c 
b/drivers/soc/amlogic/meson-clk-measure.c
index e1957476a006..6dd190270123 100644
--- a/drivers/soc/amlogic/meson-clk-measure.c
+++ b/drivers/soc/amlogic/meson-clk-measure.c
@@ -626,10 +626,8 @@ static int meson_msr_probe(struct platform_device *pdev)
 
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
base = devm_ioremap_resource(>dev, res);
-   if (IS_ERR(base)) {
-   dev_err(>dev, "io resource mapping failed\n");
+   if (IS_ERR(base))
return PTR_ERR(base);
-   }
 
priv->regmap = devm_regmap_init_mmio(>dev, base,
 _clk_msr_regmap_config);



[PATCH net-next] mt76: mt7921: remove unneeded semicolon

2021-04-05 Thread Qiheng Lin
Eliminate the following coccicheck warning:
 drivers/net/wireless/mediatek/mt76/mt7921/mac.c:1402:2-3: Unneeded semicolon

Signed-off-by: Qiheng Lin 
---
 drivers/net/wireless/mediatek/mt76/mt7921/mac.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/mac.c 
b/drivers/net/wireless/mediatek/mt76/mt7921/mac.c
index 3f9097481a5e..e56cde3a19ec 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7921/mac.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7921/mac.c
@@ -1399,7 +1399,7 @@ void mt7921_mac_work(struct work_struct *work)
if (++phy->sta_work_count == 10) {
phy->sta_work_count = 0;
mt7921_mac_sta_stats_work(phy);
-   };
+   }
 
mt7921_mutex_release(phy->dev);
 
-- 
2.31.1



[PATCH net-next] netdevsim: remove unneeded semicolon

2021-04-05 Thread Qiheng Lin
Eliminate the following coccicheck warning:
 drivers/net/netdevsim/fib.c:569:2-3: Unneeded semicolon

Signed-off-by: Qiheng Lin 
---
 drivers/net/netdevsim/fib.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/netdevsim/fib.c b/drivers/net/netdevsim/fib.c
index fda6f37e7055..213d3e5056c8 100644
--- a/drivers/net/netdevsim/fib.c
+++ b/drivers/net/netdevsim/fib.c
@@ -566,7 +566,7 @@ nsim_fib6_rt_create(struct nsim_fib_data *data,
 err_fib6_rt_nh_del:
for (i--; i >= 0; i--) {
nsim_fib6_rt_nh_del(fib6_rt, rt_arr[i]);
-   };
+   }
nsim_fib_rt_fini(_rt->common);
kfree(fib6_rt);
return ERR_PTR(err);
-- 
2.31.1



[PATCH net-next] net: ethernet: mtk_eth_soc: remove unneeded semicolon

2021-04-05 Thread Qiheng Lin
Eliminate the following coccicheck warning:
 drivers/net/ethernet/mediatek/mtk_ppe.c:270:2-3: Unneeded semicolon

Signed-off-by: Qiheng Lin 
---
 drivers/net/ethernet/mediatek/mtk_ppe.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/mediatek/mtk_ppe.c 
b/drivers/net/ethernet/mediatek/mtk_ppe.c
index a1a9959a2461..71e1ccea6e72 100644
--- a/drivers/net/ethernet/mediatek/mtk_ppe.c
+++ b/drivers/net/ethernet/mediatek/mtk_ppe.c
@@ -267,7 +267,7 @@ int mtk_foe_entry_set_ipv6_tuple(struct mtk_foe_entry 
*entry,
default:
WARN_ON_ONCE(1);
return -EINVAL;
-   };
+   }
 
for (i = 0; i < 4; i++)
src[i] = be32_to_cpu(src_addr[i]);
-- 
2.31.1



[PATCH -next] mm/vmalloc: Fix non-conforming function headers

2021-04-01 Thread Qiheng Lin
Fix the following W=1 kernel build warning(s):
 mm/vmalloc.c:425: warning: expecting prototype for vunmap_range_noflush(). 
Prototype was for vunmap_range() instead

Signed-off-by: Qiheng Lin 
---
 mm/vmalloc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/vmalloc.c b/mm/vmalloc.c
index 8b564f91a610..4238e407eb2d 100644
--- a/mm/vmalloc.c
+++ b/mm/vmalloc.c
@@ -413,7 +413,7 @@ void vunmap_range_noflush(unsigned long start, unsigned 
long end)
 }
 
 /**
- * vunmap_range_noflush - unmap kernel virtual addresses
+ * vunmap_range - unmap kernel virtual addresses
  * @addr: start of the VM area to unmap
  * @end: end of the VM area to unmap (non-inclusive)
  *
-- 
2.25.1



[PATCH -next] memory: fsl-corenet-cf: Remove redundant dev_err call in ccf_probe()

2021-03-31 Thread Qiheng Lin
There is a error message within devm_ioremap_resource
already, so remove the dev_err call to avoid redundant
error message.

Reported-by: Hulk Robot 
Signed-off-by: Qiheng Lin 
---
 drivers/memory/fsl-corenet-cf.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/memory/fsl-corenet-cf.c b/drivers/memory/fsl-corenet-cf.c
index 0309bd5a1800..e15c962d4540 100644
--- a/drivers/memory/fsl-corenet-cf.c
+++ b/drivers/memory/fsl-corenet-cf.c
@@ -192,10 +192,8 @@ static int ccf_probe(struct platform_device *pdev)
}
 
ccf->regs = devm_ioremap_resource(>dev, r);
-   if (IS_ERR(ccf->regs)) {
-   dev_err(>dev, "%s: can't map mem resource\n", __func__);
+   if (IS_ERR(ccf->regs))
return PTR_ERR(ccf->regs);
-   }
 
ccf->dev = >dev;
ccf->info = match->data;



[PATCH -next] powerpc: Remove duplicated include from time.c

2021-03-31 Thread Qiheng Lin
Remove duplicated include.

Reported-by: Hulk Robot 
Signed-off-by: Qiheng Lin 
---
 arch/powerpc/kernel/time.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/arch/powerpc/kernel/time.c b/arch/powerpc/kernel/time.c
index b67d93a609a2..2c8762002b21 100644
--- a/arch/powerpc/kernel/time.c
+++ b/arch/powerpc/kernel/time.c
@@ -53,7 +53,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 



[PATCH -next] misc/pvpanic: fix return value check in pvpanic_pci_probe()

2021-03-29 Thread Qiheng Lin
In case of error, the function pci_iomap() returns NULL pointer
not ERR_PTR(). The IS_ERR() test in the return value check
should be replaced with NULL test.

Reported-by: Hulk Robot 
Signed-off-by: Qiheng Lin 
---
 drivers/misc/pvpanic/pvpanic-pci.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/misc/pvpanic/pvpanic-pci.c 
b/drivers/misc/pvpanic/pvpanic-pci.c
index f38a80a5bbc8..9ecc4e8559d5 100644
--- a/drivers/misc/pvpanic/pvpanic-pci.c
+++ b/drivers/misc/pvpanic/pvpanic-pci.c
@@ -83,8 +83,8 @@ static int pvpanic_pci_probe(struct pci_dev *pdev,
return ret;
 
base = pci_iomap(pdev, 0, 0);
-   if (IS_ERR(base))
-   return PTR_ERR(base);
+   if (!base)
+   return -ENOMEM;
 
pi = kmalloc(sizeof(*pi), GFP_ATOMIC);
if (!pi)