[tip: sched/core] sched/fair: Move update_nohz_stats() to the CONFIG_NO_HZ_COMMON block to simplify the code & fix an unused function warning
The following commit has been merged into the sched/core branch of tip: Commit-ID: 3f5ad91488e813026f8c5f46b839e91a83912703 Gitweb: https://git.kernel.org/tip/3f5ad91488e813026f8c5f46b839e91a83912703 Author:YueHaibing AuthorDate:Mon, 29 Mar 2021 22:40:29 +08:00 Committer: Ingo Molnar CommitterDate: Tue, 20 Apr 2021 10:14:15 +02:00 sched/fair: Move update_nohz_stats() to the CONFIG_NO_HZ_COMMON block to simplify the code & fix an unused function warning When !CONFIG_NO_HZ_COMMON we get this new GCC warning: kernel/sched/fair.c:8398:13: warning: ‘update_nohz_stats’ defined but not used [-Wunused-function] Move update_nohz_stats() to an already existing CONFIG_NO_HZ_COMMON #ifdef block. Beyond fixing the GCC warning, this also simplifies the update_nohz_stats() function. [ mingo: Rewrote the changelog. ] Fixes: 0826530de3cb ("sched/fair: Remove update of blocked load from newidle_balance") Signed-off-by: YueHaibing Signed-off-by: Ingo Molnar Reviewed-by: Vincent Guittot Link: https://lore.kernel.org/r/20210329144029.29200-1-yuehaib...@huawei.com --- kernel/sched/fair.c | 40 ++-- 1 file changed, 18 insertions(+), 22 deletions(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 49636a4..7ea3b93 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -8430,28 +8430,6 @@ group_type group_classify(unsigned int imbalance_pct, return group_has_spare; } -static bool update_nohz_stats(struct rq *rq) -{ -#ifdef CONFIG_NO_HZ_COMMON - unsigned int cpu = rq->cpu; - - if (!rq->has_blocked_load) - return false; - - if (!cpumask_test_cpu(cpu, nohz.idle_cpus_mask)) - return false; - - if (!time_after(jiffies, READ_ONCE(rq->last_blocked_load_update_tick))) - return true; - - update_blocked_averages(cpu); - - return rq->has_blocked_load; -#else - return false; -#endif -} - /** * update_sg_lb_stats - Update sched_group's statistics for load balancing. * @env: The load balancing environment. @@ -10406,6 +10384,24 @@ out: WRITE_ONCE(nohz.has_blocked, 1); } +static bool update_nohz_stats(struct rq *rq) +{ + unsigned int cpu = rq->cpu; + + if (!rq->has_blocked_load) + return false; + + if (!cpumask_test_cpu(cpu, nohz.idle_cpus_mask)) + return false; + + if (!time_after(jiffies, READ_ONCE(rq->last_blocked_load_update_tick))) + return true; + + update_blocked_averages(cpu); + + return rq->has_blocked_load; +} + /* * Internal function that runs load balance for all idle cpus. The load balance * can be a simple update of blocked load or a complete load balance with
[PATCH -next 1/5] crypto: atmel-tdes - Remove redundant dev_err call in atmel_tdes_probe()
There is a error message within devm_ioremap_resource already, so remove the dev_err call to avoid redundant error message. Signed-off-by: YueHaibing --- drivers/crypto/atmel-tdes.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/crypto/atmel-tdes.c b/drivers/crypto/atmel-tdes.c index 4d63cb13a54f..6f01c51e3c37 100644 --- a/drivers/crypto/atmel-tdes.c +++ b/drivers/crypto/atmel-tdes.c @@ -1217,7 +1217,6 @@ static int atmel_tdes_probe(struct platform_device *pdev) tdes_dd->io_base = devm_ioremap_resource(>dev, tdes_res); if (IS_ERR(tdes_dd->io_base)) { - dev_err(dev, "can't ioremap\n"); err = PTR_ERR(tdes_dd->io_base); goto err_tasklet_kill; } -- 2.17.1
[PATCH -next 5/5] crypto: ccree - Remove redundant dev_err call in init_cc_resources()
There is a error message within devm_ioremap_resource already, so remove the dev_err call to avoid redundant error message. Signed-off-by: YueHaibing --- drivers/crypto/ccree/cc_driver.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/crypto/ccree/cc_driver.c b/drivers/crypto/ccree/cc_driver.c index d0e59e942568..e599ac6dc162 100644 --- a/drivers/crypto/ccree/cc_driver.c +++ b/drivers/crypto/ccree/cc_driver.c @@ -352,10 +352,8 @@ static int init_cc_resources(struct platform_device *plat_dev) req_mem_cc_regs = platform_get_resource(plat_dev, IORESOURCE_MEM, 0); /* Map registers space */ new_drvdata->cc_base = devm_ioremap_resource(dev, req_mem_cc_regs); - if (IS_ERR(new_drvdata->cc_base)) { - dev_err(dev, "Failed to ioremap registers"); + if (IS_ERR(new_drvdata->cc_base)) return PTR_ERR(new_drvdata->cc_base); - } dev_dbg(dev, "Got MEM resource (%s): %pR\n", req_mem_cc_regs->name, req_mem_cc_regs); -- 2.17.1
[PATCH -next 0/5] Remove redundant dev_err call
This patchset remove some redundant dev_err calls YueHaibing (5): crypto: atmel-tdes - Remove redundant dev_err call in atmel_tdes_probe() crypto: img-hash - Remove redundant dev_err call in img_hash_probe() crypto: ux500 - Remove redundant dev_err calls crypto: keembay - Remove redundant dev_err calls crypto: ccree - Remove redundant dev_err call in init_cc_resources() drivers/crypto/atmel-tdes.c | 1 - drivers/crypto/ccree/cc_driver.c | 4 +--- drivers/crypto/img-hash.c | 3 --- drivers/crypto/keembay/keembay-ocs-aes-core.c | 4 +--- drivers/crypto/keembay/keembay-ocs-hcu-core.c | 4 +--- drivers/crypto/ux500/cryp/cryp_core.c | 1 - drivers/crypto/ux500/hash/hash_core.c | 1 - 7 files changed, 3 insertions(+), 15 deletions(-) -- 2.17.1
[PATCH -next 3/5] crypto: ux500 - Remove redundant dev_err calls
There is a error message within devm_ioremap_resource already, so remove the dev_err call to avoid redundant error message. Signed-off-by: YueHaibing --- drivers/crypto/ux500/cryp/cryp_core.c | 1 - drivers/crypto/ux500/hash/hash_core.c | 1 - 2 files changed, 2 deletions(-) diff --git a/drivers/crypto/ux500/cryp/cryp_core.c b/drivers/crypto/ux500/cryp/cryp_core.c index 10fcd682988b..30cdd5253929 100644 --- a/drivers/crypto/ux500/cryp/cryp_core.c +++ b/drivers/crypto/ux500/cryp/cryp_core.c @@ -1291,7 +1291,6 @@ static int ux500_cryp_probe(struct platform_device *pdev) device_data->phybase = res->start; device_data->base = devm_ioremap_resource(dev, res); if (IS_ERR(device_data->base)) { - dev_err(dev, "[%s]: ioremap failed!", __func__); ret = PTR_ERR(device_data->base); goto out; } diff --git a/drivers/crypto/ux500/hash/hash_core.c b/drivers/crypto/ux500/hash/hash_core.c index 7db15258475f..ecb7412e84e3 100644 --- a/drivers/crypto/ux500/hash/hash_core.c +++ b/drivers/crypto/ux500/hash/hash_core.c @@ -1676,7 +1676,6 @@ static int ux500_hash_probe(struct platform_device *pdev) device_data->phybase = res->start; device_data->base = devm_ioremap_resource(dev, res); if (IS_ERR(device_data->base)) { - dev_err(dev, "%s: ioremap() failed!\n", __func__); ret = PTR_ERR(device_data->base); goto out; } -- 2.17.1
[PATCH -next 2/5] crypto: img-hash - Remove redundant dev_err call in img_hash_probe()
devm_platform_ioremap_resource() and devm_ioremap_resource() will print err msg while failing, so the redundant dev_err call can be removed. Signed-off-by: YueHaibing --- drivers/crypto/img-hash.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/crypto/img-hash.c b/drivers/crypto/img-hash.c index e813115d5432..aa4c7b2af3e2 100644 --- a/drivers/crypto/img-hash.c +++ b/drivers/crypto/img-hash.c @@ -963,8 +963,6 @@ static int img_hash_probe(struct platform_device *pdev) hdev->io_base = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(hdev->io_base)) { err = PTR_ERR(hdev->io_base); - dev_err(dev, "can't ioremap, returned %d\n", err); - goto res_err; } @@ -972,7 +970,6 @@ static int img_hash_probe(struct platform_device *pdev) hash_res = platform_get_resource(pdev, IORESOURCE_MEM, 1); hdev->cpu_addr = devm_ioremap_resource(dev, hash_res); if (IS_ERR(hdev->cpu_addr)) { - dev_err(dev, "can't ioremap write port\n"); err = PTR_ERR(hdev->cpu_addr); goto res_err; } -- 2.17.1
[PATCH -next 4/5] crypto: keembay - Remove redundant dev_err calls
There is a error message within devm_ioremap_resource already, so remove the dev_err call to avoid redundant error message. Signed-off-by: YueHaibing --- drivers/crypto/keembay/keembay-ocs-aes-core.c | 4 +--- drivers/crypto/keembay/keembay-ocs-hcu-core.c | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/crypto/keembay/keembay-ocs-aes-core.c b/drivers/crypto/keembay/keembay-ocs-aes-core.c index 2ef312866338..e2a39fdaf623 100644 --- a/drivers/crypto/keembay/keembay-ocs-aes-core.c +++ b/drivers/crypto/keembay/keembay-ocs-aes-core.c @@ -1623,10 +1623,8 @@ static int kmb_ocs_aes_probe(struct platform_device *pdev) } aes_dev->base_reg = devm_ioremap_resource(>dev, aes_mem); - if (IS_ERR(aes_dev->base_reg)) { - dev_err(dev, "Failed to get base address\n"); + if (IS_ERR(aes_dev->base_reg)) return PTR_ERR(aes_dev->base_reg); - } /* Get and request IRQ */ aes_dev->irq = platform_get_irq(pdev, 0); diff --git a/drivers/crypto/keembay/keembay-ocs-hcu-core.c b/drivers/crypto/keembay/keembay-ocs-hcu-core.c index 322c51a6936f..0379dbf32a4c 100644 --- a/drivers/crypto/keembay/keembay-ocs-hcu-core.c +++ b/drivers/crypto/keembay/keembay-ocs-hcu-core.c @@ -1192,10 +1192,8 @@ static int kmb_ocs_hcu_probe(struct platform_device *pdev) } hcu_dev->io_base = devm_ioremap_resource(dev, hcu_mem); - if (IS_ERR(hcu_dev->io_base)) { - dev_err(dev, "Could not io-remap mem resource.\n"); + if (IS_ERR(hcu_dev->io_base)) return PTR_ERR(hcu_dev->io_base); - } init_completion(_dev->irq_done); -- 2.17.1
[PATCH v2 -next] dmaengine: at_xdmac: Remove unused inline function at_xdmac_csize()
commit 765c37d87669 ("dmaengine: at_xdmac: rework slave configuration part") left behind this, so can remove it. Signed-off-by: YueHaibing Reviewed-by: Tudor Ambarus --- v2: Fix commit log --- drivers/dma/at_xdmac.c | 11 --- 1 file changed, 11 deletions(-) diff --git a/drivers/dma/at_xdmac.c b/drivers/dma/at_xdmac.c index fe45ad5d06c4..64a52bf4d737 100644 --- a/drivers/dma/at_xdmac.c +++ b/drivers/dma/at_xdmac.c @@ -344,17 +344,6 @@ static inline int at_xdmac_chan_is_paused(struct at_xdmac_chan *atchan) return test_bit(AT_XDMAC_CHAN_IS_PAUSED, >status); } -static inline int at_xdmac_csize(u32 maxburst) -{ - int csize; - - csize = ffs(maxburst) - 1; - if (csize > 4) - csize = -EINVAL; - - return csize; -}; - static inline bool at_xdmac_chan_is_peripheral_xfer(u32 cfg) { return cfg & AT_XDMAC_CC_TYPE_PER_TRAN; -- 2.17.1
[PATCH -next] dmaengine: at_xdmac: Remove unused inline function at_xdmac_csize()
765c37d87669 ("dmaengine: at_xdmac: rework slave configuration part") left behind this, so can remove it. Signed-off-by: YueHaibing --- drivers/dma/at_xdmac.c | 11 --- 1 file changed, 11 deletions(-) diff --git a/drivers/dma/at_xdmac.c b/drivers/dma/at_xdmac.c index fe45ad5d06c4..64a52bf4d737 100644 --- a/drivers/dma/at_xdmac.c +++ b/drivers/dma/at_xdmac.c @@ -344,17 +344,6 @@ static inline int at_xdmac_chan_is_paused(struct at_xdmac_chan *atchan) return test_bit(AT_XDMAC_CHAN_IS_PAUSED, >status); } -static inline int at_xdmac_csize(u32 maxburst) -{ - int csize; - - csize = ffs(maxburst) - 1; - if (csize > 4) - csize = -EINVAL; - - return csize; -}; - static inline bool at_xdmac_chan_is_peripheral_xfer(u32 cfg) { return cfg & AT_XDMAC_CC_TYPE_PER_TRAN; -- 2.17.1
[PATCH -next] PM: runtime: Replace inline function pm_runtime_callbacks_present()
commit 9a7875461fd0 ("PM: runtime: Replace pm_runtime_callbacks_present()") forget to change the inline version. Fixes: 9a7875461fd0 ("PM: runtime: Replace pm_runtime_callbacks_present()") Signed-off-by: YueHaibing --- include/linux/pm_runtime.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/pm_runtime.h b/include/linux/pm_runtime.h index b492ae00cc90..6c08a085367b 100644 --- a/include/linux/pm_runtime.h +++ b/include/linux/pm_runtime.h @@ -265,7 +265,7 @@ static inline void pm_runtime_no_callbacks(struct device *dev) {} static inline void pm_runtime_irq_safe(struct device *dev) {} static inline bool pm_runtime_is_irq_safe(struct device *dev) { return false; } -static inline bool pm_runtime_callbacks_present(struct device *dev) { return false; } +static inline bool pm_runtime_has_no_callbacks(struct device *dev) { return false; } static inline void pm_runtime_mark_last_busy(struct device *dev) {} static inline void __pm_runtime_use_autosuspend(struct device *dev, bool use) {} -- 2.17.1
[PATCH -next] ide: Remove unused inline function ide_dma_verbose()
commit 3ab7efe8e2cb ("ide: DMA reporting and validity checking fixes (take 3)") left behind this, so can remove it. Signed-off-by: YueHaibing --- include/linux/ide.h | 1 - 1 file changed, 1 deletion(-) diff --git a/include/linux/ide.h b/include/linux/ide.h index 6bc6ba57b505..0242a66158fb 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h @@ -1455,7 +1455,6 @@ static inline u8 ide_max_dma_mode(ide_drive_t *drive) { return 0; } static inline void ide_dma_off_quietly(ide_drive_t *drive) { ; } static inline void ide_dma_off(ide_drive_t *drive) { ; } static inline void ide_dma_on(ide_drive_t *drive) { ; } -static inline void ide_dma_verbose(ide_drive_t *drive) { ; } static inline int ide_set_dma(ide_drive_t *drive) { return 1; } static inline void ide_check_dma_crc(ide_drive_t *drive) { ; } static inline ide_startstop_t ide_dma_intr(ide_drive_t *drive) { return ide_stopped; } -- 2.17.1
[PATCH -next] mfd: twl: Remove unused inline function twl4030charger_usb_en()
There is no caller in tree, so can remove it. Signed-off-by: YueHaibing --- include/linux/mfd/twl.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/include/linux/mfd/twl.h b/include/linux/mfd/twl.h index 089e8942223a..8871cc5188a0 100644 --- a/include/linux/mfd/twl.h +++ b/include/linux/mfd/twl.h @@ -781,8 +781,6 @@ int twl4030_sih_setup(struct device *dev, int module, int irq_base); #define TWL4030_VAUX3_DEV_GRP 0x1F #define TWL4030_VAUX3_DEDICATED0x22 -static inline int twl4030charger_usb_en(int enable) { return 0; } - /*--*/ /* Linux-specific regulator identifiers ... for now, we only support -- 2.17.1
[PATCH -next] freezer: Remove unused inline function try_to_freeze_nowarn()
There is no caller in tree, so can remove it. Signed-off-by: YueHaibing --- include/linux/freezer.h | 1 - 1 file changed, 1 deletion(-) diff --git a/include/linux/freezer.h b/include/linux/freezer.h index 27828145ca09..0621c5f86c39 100644 --- a/include/linux/freezer.h +++ b/include/linux/freezer.h @@ -279,7 +279,6 @@ static inline int freeze_kernel_threads(void) { return -ENOSYS; } static inline void thaw_processes(void) {} static inline void thaw_kernel_threads(void) {} -static inline bool try_to_freeze_nowarn(void) { return false; } static inline bool try_to_freeze(void) { return false; } static inline void freezer_do_not_count(void) {} -- 2.17.1
[PATCH -next] RDMA/uverbs: Fix -Wunused-function warning
make W=1 warns this: In file included from drivers/infiniband/sw/rdmavt/mmap.c:51:0: ./include/rdma/uverbs_ioctl.h:937:1: warning: ‘_uverbs_get_const_unsigned’ defined but not used [-Wunused-function] _uverbs_get_const_unsigned(u64 *to, ^~ ./include/rdma/uverbs_ioctl.h:930:1: warning: ‘_uverbs_get_const_signed’ defined but not used [-Wunused-function] _uverbs_get_const_signed(s64 *to, const struct uverbs_attr_bundle *attrs_bundle, ^~~~ Make these functions inline to fix this warnings. Signed-off-by: YueHaibing --- include/rdma/uverbs_ioctl.h | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/include/rdma/uverbs_ioctl.h b/include/rdma/uverbs_ioctl.h index 3829b6ef4bb6..23bb404aba12 100644 --- a/include/rdma/uverbs_ioctl.h +++ b/include/rdma/uverbs_ioctl.h @@ -926,14 +926,15 @@ uverbs_copy_to_struct_or_zero(const struct uverbs_attr_bundle *bundle, { return -EINVAL; } -static int -_uverbs_get_const_signed(s64 *to, const struct uverbs_attr_bundle *attrs_bundle, +static inline int +_uverbs_get_const_signed(s64 *to, +const struct uverbs_attr_bundle *attrs_bundle, size_t idx, s64 lower_bound, u64 upper_bound, s64 *def_val) { return -EINVAL; } -static int +static inline int _uverbs_get_const_unsigned(u64 *to, const struct uverbs_attr_bundle *attrs_bundle, size_t idx, u64 upper_bound, u64 *def_val) -- 2.17.1
Re: [PATCH -next] powerpc/eeh: Remove unused inline function eeh_dev_phb_init_dynamic()
On 2021/3/26 13:08, Daniel Axtens wrote: > Hi, > >> commit 475028efc708 ("powerpc/eeh: Remove eeh_dev_phb_init_dynamic()") >> left behind this, so can remove it. > > I had a look: the inline that you are removing here is for the > !CONFIG_EEH case, which explains why it was missed the first time. > > This looks like a good change. Out of interest, what tool are you using > to find these unused inlines? If there are many more, it might make > sense to combine future patches removing them into a single patch, but > I'm not sure. Just use some grep skill, will do that if any. > > checkpatch likes this patch, so that's also good :) > > Reviewed-by: Daniel Axtens > > Kind regards, > Daniel > . >
[PATCH -next] powerpc/eeh: Add correct inline functions
pseries_eeh_add_device_early()/pseries_eeh_add_device_tree_early() is never used since adding, however pseries_eeh_init_edev() and pseries_eeh_init_edev_recursive() need their inline versions. Fixes: b6eebb093cad ("powerpc/eeh: Make early EEH init pseries specific") Signed-off-by: YueHaibing --- arch/powerpc/include/asm/eeh.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/include/asm/eeh.h b/arch/powerpc/include/asm/eeh.h index b1a5bba2e0b9..0b6c2a6711d3 100644 --- a/arch/powerpc/include/asm/eeh.h +++ b/arch/powerpc/include/asm/eeh.h @@ -357,8 +357,8 @@ static inline int eeh_phb_pe_create(struct pci_controller *phb) { return 0; } void pseries_eeh_init_edev(struct pci_dn *pdn); void pseries_eeh_init_edev_recursive(struct pci_dn *pdn); #else -static inline void pseries_eeh_add_device_early(struct pci_dn *pdn) { } -static inline void pseries_eeh_add_device_tree_early(struct pci_dn *pdn) { } +static inline void pseries_eeh_init_edev(struct pci_dn *pdn) { } +static inline void pseries_eeh_init_edev_recursive(struct pci_dn *pdn) { } #endif #ifdef CONFIG_PPC64 -- 2.17.1
[PATCH -next] misc/pvpanic: Make some symbols static
Fix sparse warnings: drivers/misc/pvpanic/pvpanic.c:28:18: warning: symbol 'pvpanic_list' was not declared. Should it be static? drivers/misc/pvpanic/pvpanic.c:29:12: warning: symbol 'pvpanic_lock' was not declared. Should it be static? Signed-off-by: YueHaibing --- drivers/misc/pvpanic/pvpanic.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/misc/pvpanic/pvpanic.c b/drivers/misc/pvpanic/pvpanic.c index 804099c2d7fa..65f70a4da8c0 100644 --- a/drivers/misc/pvpanic/pvpanic.c +++ b/drivers/misc/pvpanic/pvpanic.c @@ -25,8 +25,8 @@ MODULE_AUTHOR("Mihai Carabas "); MODULE_DESCRIPTION("pvpanic device driver "); MODULE_LICENSE("GPL"); -struct list_head pvpanic_list; -spinlock_t pvpanic_lock; +static struct list_head pvpanic_list; +static spinlock_t pvpanic_lock; static void pvpanic_send_event(unsigned int event) -- 2.17.1
[PATCH -next] ASoC: dwc: Fix -Wmissing-prototypes warnings
while CONFIG_SND_DESIGNWARE_PCM is not set, building with W=1 shows this: sound/soc/dwc/local.h:127:6: warning: no previous prototype for ‘dw_pcm_push_tx’ [-Wmissing-prototypes] void dw_pcm_push_tx(struct dw_i2s_dev *dev) { } ^~ sound/soc/dwc/local.h:128:6: warning: no previous prototype for ‘dw_pcm_pop_rx’ [-Wmissing-prototypes] void dw_pcm_pop_rx(struct dw_i2s_dev *dev) { } ^ sound/soc/dwc/local.h:129:5: warning: no previous prototype for ‘dw_pcm_register’ [-Wmissing-prototypes] int dw_pcm_register(struct platform_device *pdev) ^~~ Change these to inline functions to fix the warnings. Signed-off-by: YueHaibing --- sound/soc/dwc/local.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sound/soc/dwc/local.h b/sound/soc/dwc/local.h index 91dc70a826f8..1c361eb6127e 100644 --- a/sound/soc/dwc/local.h +++ b/sound/soc/dwc/local.h @@ -124,9 +124,9 @@ void dw_pcm_push_tx(struct dw_i2s_dev *dev); void dw_pcm_pop_rx(struct dw_i2s_dev *dev); int dw_pcm_register(struct platform_device *pdev); #else -void dw_pcm_push_tx(struct dw_i2s_dev *dev) { } -void dw_pcm_pop_rx(struct dw_i2s_dev *dev) { } -int dw_pcm_register(struct platform_device *pdev) +static inline void dw_pcm_push_tx(struct dw_i2s_dev *dev) { } +static inline void dw_pcm_pop_rx(struct dw_i2s_dev *dev) { } +static inline int dw_pcm_register(struct platform_device *pdev) { return -EINVAL; } -- 2.17.1
[PATCH -next] ASoC: amd: acp-da7219-max98357a: Fix -Wunused-variable warning
While ACPI is not set, make W=1 warns: sound/soc/amd/acp-da7219-max98357a.c:684:28: warning: ‘cz_rt5682_card’ defined but not used [-Wunused-variable] static struct snd_soc_card cz_rt5682_card = { ^~ sound/soc/amd/acp-da7219-max98357a.c:671:28: warning: ‘cz_card’ defined but not used [-Wunused-variable] static struct snd_soc_card cz_card = { Use #ifdef block to guard this. Signed-off-by: YueHaibing --- sound/soc/amd/acp-da7219-max98357a.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/sound/soc/amd/acp-da7219-max98357a.c b/sound/soc/amd/acp-da7219-max98357a.c index e65e007fc604..1bf0458e22a8 100644 --- a/sound/soc/amd/acp-da7219-max98357a.c +++ b/sound/soc/amd/acp-da7219-max98357a.c @@ -47,13 +47,15 @@ #define DUAL_CHANNEL 2 #define RT5682_PLL_FREQ (48000 * 512) +extern bool bt_uart_enable; +void *acp_soc_is_rltk_max(struct device *dev); + +#ifdef CONFIG_ACPI static struct snd_soc_jack cz_jack; static struct clk *da7219_dai_wclk; static struct clk *da7219_dai_bclk; static struct clk *rt5682_dai_wclk; static struct clk *rt5682_dai_bclk; -extern bool bt_uart_enable; -void *acp_soc_is_rltk_max(struct device *dev); static int cz_da7219_init(struct snd_soc_pcm_runtime *rtd) { @@ -692,6 +694,7 @@ static struct snd_soc_card cz_rt5682_card = { .controls = cz_mc_controls, .num_controls = ARRAY_SIZE(cz_mc_controls), }; +#endif void *acp_soc_is_rltk_max(struct device *dev) { -- 2.17.1
[PATCH v2 -next] sched/fair: Fix unused function warning
while CONFIG_NO_HZ_COMMON is not enabled, gcc warn this: kernel/sched/fair.c:8398:13: warning: ‘update_nohz_stats’ defined but not used [-Wunused-function] static bool update_nohz_stats(struct rq *rq) ^ Move update_nohz_stats() to #ifdef checking this. Fixes: 0826530de3cb ("sched/fair: Remove update of blocked load from newidle_balance") Signed-off-by: YueHaibing Reviewed-by: Vincent Guittot --- v2: Add Fixes tag, also move update_nohz_stats() closer to its only caller _nohz_idle_balance() --- kernel/sched/fair.c | 40 ++-- 1 file changed, 18 insertions(+), 22 deletions(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 6d73bdbb2d40..2a20ada83cbb 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -8395,28 +8395,6 @@ group_type group_classify(unsigned int imbalance_pct, return group_has_spare; } -static bool update_nohz_stats(struct rq *rq) -{ -#ifdef CONFIG_NO_HZ_COMMON - unsigned int cpu = rq->cpu; - - if (!rq->has_blocked_load) - return false; - - if (!cpumask_test_cpu(cpu, nohz.idle_cpus_mask)) - return false; - - if (!time_after(jiffies, READ_ONCE(rq->last_blocked_load_update_tick))) - return true; - - update_blocked_averages(cpu); - - return rq->has_blocked_load; -#else - return false; -#endif -} - /** * update_sg_lb_stats - Update sched_group's statistics for load balancing. * @env: The load balancing environment. @@ -10380,6 +10358,24 @@ void nohz_balance_enter_idle(int cpu) WRITE_ONCE(nohz.has_blocked, 1); } +static bool update_nohz_stats(struct rq *rq) +{ + unsigned int cpu = rq->cpu; + + if (!rq->has_blocked_load) + return false; + + if (!cpumask_test_cpu(cpu, nohz.idle_cpus_mask)) + return false; + + if (!time_after(jiffies, READ_ONCE(rq->last_blocked_load_update_tick))) + return true; + + update_blocked_averages(cpu); + + return rq->has_blocked_load; +} + /* * Internal function that runs load balance for all idle cpus. The load balance * can be a simple update of blocked load or a complete load balance with -- 2.17.1
[PATCH -next] sched/fair: Fix unused function warning
while CONFIG_NO_HZ_COMMON is not enabled, gcc warn this: kernel/sched/fair.c:8398:13: warning: ‘update_nohz_stats’ defined but not used [-Wunused-function] static bool update_nohz_stats(struct rq *rq) ^ Move update_nohz_stats() to #ifdef block fix this. Signed-off-by: YueHaibing --- kernel/sched/fair.c | 40 ++-- 1 file changed, 18 insertions(+), 22 deletions(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 6d73bdbb2d40..c7a7ef97d167 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -8395,28 +8395,6 @@ group_type group_classify(unsigned int imbalance_pct, return group_has_spare; } -static bool update_nohz_stats(struct rq *rq) -{ -#ifdef CONFIG_NO_HZ_COMMON - unsigned int cpu = rq->cpu; - - if (!rq->has_blocked_load) - return false; - - if (!cpumask_test_cpu(cpu, nohz.idle_cpus_mask)) - return false; - - if (!time_after(jiffies, READ_ONCE(rq->last_blocked_load_update_tick))) - return true; - - update_blocked_averages(cpu); - - return rq->has_blocked_load; -#else - return false; -#endif -} - /** * update_sg_lb_stats - Update sched_group's statistics for load balancing. * @env: The load balancing environment. @@ -10097,6 +10075,24 @@ static inline int on_null_domain(struct rq *rq) } #ifdef CONFIG_NO_HZ_COMMON +static bool update_nohz_stats(struct rq *rq) +{ + unsigned int cpu = rq->cpu; + + if (!rq->has_blocked_load) + return false; + + if (!cpumask_test_cpu(cpu, nohz.idle_cpus_mask)) + return false; + + if (!time_after(jiffies, READ_ONCE(rq->last_blocked_load_update_tick))) + return true; + + update_blocked_averages(cpu); + + return rq->has_blocked_load; +} + /* * idle load balancing details * - When one of the busy CPUs notice that there may be an idle rebalancing -- 2.17.1
[PATCH -next] IB/srpt: Fix passing zero to 'PTR_ERR'
Fix smatch warning: drivers/infiniband/ulp/srpt/ib_srpt.c:2341 srpt_cm_req_recv() warn: passing zero to 'PTR_ERR' Use PTR_ERR_OR_ZERO instead of PTR_ERR Fixes: 847462de3a0a ("IB/srpt: Fix srpt_cm_req_recv() error path (1/2)") Signed-off-by: YueHaibing --- drivers/infiniband/ulp/srpt/ib_srpt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/infiniband/ulp/srpt/ib_srpt.c b/drivers/infiniband/ulp/srpt/ib_srpt.c index 6be60aa5ffe2..3ff24b5048ac 100644 --- a/drivers/infiniband/ulp/srpt/ib_srpt.c +++ b/drivers/infiniband/ulp/srpt/ib_srpt.c @@ -2338,7 +2338,7 @@ static int srpt_cm_req_recv(struct srpt_device *const sdev, if (IS_ERR_OR_NULL(ch->sess)) { WARN_ON_ONCE(ch->sess == NULL); - ret = PTR_ERR(ch->sess); + ret = PTR_ERR_OR_ZERO(ch->sess); ch->sess = NULL; pr_info("Rejected login for initiator %s: ret = %d.\n", ch->sess_name, ret); -- 2.22.0
[PATCH -next] powerpc/smp: Remove unused inline functions
commit 441c19c8a290 ("powerpc/kvm/book3s_hv: Rework the secondary inhibit code") left behind this, so can remove it. Signed-off-by: YueHaibing --- arch/powerpc/include/asm/smp.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/arch/powerpc/include/asm/smp.h b/arch/powerpc/include/asm/smp.h index 7a13bc20f0a0..ad7129a19e8f 100644 --- a/arch/powerpc/include/asm/smp.h +++ b/arch/powerpc/include/asm/smp.h @@ -189,8 +189,6 @@ extern void __cpu_die(unsigned int cpu); #define hard_smp_processor_id()get_hard_smp_processor_id(0) #define smp_setup_cpu_maps() #define thread_group_shares_l2 0 -static inline void inhibit_secondary_onlining(void) {} -static inline void uninhibit_secondary_onlining(void) {} static inline const struct cpumask *cpu_sibling_mask(int cpu) { return cpumask_of(cpu); -- 2.17.1
[PATCH -next] powerpc/eeh: Remove unused inline function eeh_dev_phb_init_dynamic()
commit 475028efc708 ("powerpc/eeh: Remove eeh_dev_phb_init_dynamic()") left behind this, so can remove it. Signed-off-by: YueHaibing --- arch/powerpc/include/asm/eeh.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/arch/powerpc/include/asm/eeh.h b/arch/powerpc/include/asm/eeh.h index b1a5bba2e0b9..ee0e7b8eac60 100644 --- a/arch/powerpc/include/asm/eeh.h +++ b/arch/powerpc/include/asm/eeh.h @@ -333,8 +333,6 @@ static inline bool eeh_enabled(void) static inline void eeh_show_enabled(void) { } -static inline void eeh_dev_phb_init_dynamic(struct pci_controller *phb) { } - static inline int eeh_check_failure(const volatile void __iomem *token) { return 0; -- 2.17.1
[PATCH net-next] netfilter: conntrack: Remove unused variable declaration
commit e97c3e278e95 ("tproxy: split off ipv6 defragmentation to a separate module") left behind this. Signed-off-by: YueHaibing --- include/net/netfilter/ipv6/nf_conntrack_ipv6.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/include/net/netfilter/ipv6/nf_conntrack_ipv6.h b/include/net/netfilter/ipv6/nf_conntrack_ipv6.h index 7b3c873f8839..e95483192d1b 100644 --- a/include/net/netfilter/ipv6/nf_conntrack_ipv6.h +++ b/include/net/netfilter/ipv6/nf_conntrack_ipv6.h @@ -4,7 +4,4 @@ extern const struct nf_conntrack_l4proto nf_conntrack_l4proto_icmpv6; -#include -extern struct ctl_table nf_ct_ipv6_sysctl_table[]; - #endif /* _NF_CONNTRACK_IPV6_H*/ -- 2.17.1
Re: [PATCH v2 -next] IB/mlx5: Add missing error code
On 2021/2/22 21:23, Leon Romanovsky wrote: > On Mon, Feb 22, 2021 at 08:23:43PM +0800, YueHaibing wrote: >> Set err to -ENOMEM if kzalloc fails instead of 0. >> >> Fixes: 759738537142 ("IB/mlx5: Enable subscription for device events over >> DEVX") >> Signed-off-by: YueHaibing >> --- >> drivers/infiniband/hw/mlx5/devx.c | 4 +++- >> 1 file changed, 3 insertions(+), 1 deletion(-) >> > > Thanks, > Acked-by: Leon Romanovsky > > And please don't send new version of patches as a reply-to, it is > annoying like hell. Ok, Got it. > Thanks > . >
[PATCH v2 -next] IB/mlx5: Add missing error code
Set err to -ENOMEM if kzalloc fails instead of 0. Fixes: 759738537142 ("IB/mlx5: Enable subscription for device events over DEVX") Signed-off-by: YueHaibing --- drivers/infiniband/hw/mlx5/devx.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/infiniband/hw/mlx5/devx.c b/drivers/infiniband/hw/mlx5/devx.c index ebc2a4355fa5..3c8e6a25465d 100644 --- a/drivers/infiniband/hw/mlx5/devx.c +++ b/drivers/infiniband/hw/mlx5/devx.c @@ -2073,8 +2073,10 @@ static int UVERBS_HANDLER(MLX5_IB_METHOD_DEVX_SUBSCRIBE_EVENT)( num_alloc_xa_entries++; event_sub = kzalloc(sizeof(*event_sub), GFP_KERNEL); - if (!event_sub) + if (!event_sub) { + err = -ENOMEM; goto err; + } list_add_tail(_sub->event_list, _list); uverbs_uobject_get(_file->uobj); -- 2.20.1
[PATCH -next] IB/mlx5: Add missing error code
Set err to -ENOMEM if kzalloc fails instead of 0. Fixes: 759738537142 ("IB/mlx5: Enable subscription for device events over DEVX") Signed-off-by: YueHaibing --- drivers/infiniband/hw/mlx5/devx.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/infiniband/hw/mlx5/devx.c b/drivers/infiniband/hw/mlx5/devx.c index ebc2a4355fa5..3c8e6a25465d 100644 --- a/drivers/infiniband/hw/mlx5/devx.c +++ b/drivers/infiniband/hw/mlx5/devx.c @@ -2073,8 +2073,10 @@ static int UVERBS_HANDLER(MLX5_IB_METHOD_DEVX_SUBSCRIBE_EVENT)( num_alloc_xa_entries++; event_sub = kzalloc(sizeof(*event_sub), GFP_KERNEL); - if (!event_sub) + if (!event_sub) { + err = -ENOMEM goto err; + } list_add_tail(_sub->event_list, _list); uverbs_uobject_get(_file->uobj); -- 2.20.1
[PATCH] cifs: Fix inconsistent IS_ERR and PTR_ERR
Fix inconsistent IS_ERR and PTR_ERR in cifs_find_swn_reg(). The proper pointer to be passed as argument to PTR_ERR() is share_name. This bug was detected with the help of Coccinelle. Fixes: bf80e5d4259a ("cifs: Send witness register and unregister commands to userspace daemon") Signed-off-by: YueHaibing --- fs/cifs/cifs_swn.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/cifs/cifs_swn.c b/fs/cifs/cifs_swn.c index d35f599aa00e..f2d730fffccb 100644 --- a/fs/cifs/cifs_swn.c +++ b/fs/cifs/cifs_swn.c @@ -272,7 +272,7 @@ static struct cifs_swn_reg *cifs_find_swn_reg(struct cifs_tcon *tcon) if (IS_ERR(share_name)) { int ret; - ret = PTR_ERR(net_name); + ret = PTR_ERR(share_name); cifs_dbg(VFS, "%s: failed to extract share name from target '%s': %d\n", __func__, tcon->treeName, ret); kfree(net_name); -- 2.22.0
[PATCH] nfp: Fix passing zero to 'PTR_ERR'
nfp_cpp_from_nfp6000_pcie() returns ERR_PTR() and never returns NULL. The NULL test should be removed, also return correct err. Fixes: 63461a028f76 ("nfp: add the PF driver") Signed-off-by: YueHaibing --- drivers/net/ethernet/netronome/nfp/nfp_main.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/net/ethernet/netronome/nfp/nfp_main.c b/drivers/net/ethernet/netronome/nfp/nfp_main.c index 7ff2ccbd43b0..e672614d2906 100644 --- a/drivers/net/ethernet/netronome/nfp/nfp_main.c +++ b/drivers/net/ethernet/netronome/nfp/nfp_main.c @@ -724,10 +724,8 @@ static int nfp_pci_probe(struct pci_dev *pdev, } pf->cpp = nfp_cpp_from_nfp6000_pcie(pdev); - if (IS_ERR_OR_NULL(pf->cpp)) { + if (IS_ERR(pf->cpp)) { err = PTR_ERR(pf->cpp); - if (err >= 0) - err = -ENOMEM; goto err_disable_msix; } -- 2.17.1
[PATCH] net: dsa: sja1105: Fix return value check in sja1105_ptp_clock_register()
drivers/net/dsa/sja1105/sja1105_ptp.c:869 sja1105_ptp_clock_register() warn: passing zero to 'PTR_ERR' ptp_clock_register() returns ERR_PTR() and never returns NULL. The NULL test should be removed. Fixes: bb77f36ac21d ("net: dsa: sja1105: Add support for the PTP clock") Signed-off-by: YueHaibing --- drivers/net/dsa/sja1105/sja1105_ptp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/dsa/sja1105/sja1105_ptp.c b/drivers/net/dsa/sja1105/sja1105_ptp.c index 1b90570b257b..1e41d491c854 100644 --- a/drivers/net/dsa/sja1105/sja1105_ptp.c +++ b/drivers/net/dsa/sja1105/sja1105_ptp.c @@ -865,7 +865,7 @@ int sja1105_ptp_clock_register(struct dsa_switch *ds) spin_lock_init(_data->meta_lock); ptp_data->clock = ptp_clock_register(_data->caps, ds->dev); - if (IS_ERR_OR_NULL(ptp_data->clock)) + if (IS_ERR(ptp_data->clock)) return PTR_ERR(ptp_data->clock); ptp_data->cmd.corrclk4ts = true; -- 2.17.1
[PATCH] IB/srpt: Fix passing zero to 'PTR_ERR'
Fix smatch warning: drivers/infiniband/ulp/srpt/ib_srpt.c:2341 srpt_cm_req_recv() warn: passing zero to 'PTR_ERR' Use PTR_ERR_OR_ZERO instead of PTR_ERR Fixes: 847462de3a0a ("IB/srpt: Fix srpt_cm_req_recv() error path (1/2)") Signed-off-by: YueHaibing --- drivers/infiniband/ulp/srpt/ib_srpt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/infiniband/ulp/srpt/ib_srpt.c b/drivers/infiniband/ulp/srpt/ib_srpt.c index 6be60aa5ffe2..3ff24b5048ac 100644 --- a/drivers/infiniband/ulp/srpt/ib_srpt.c +++ b/drivers/infiniband/ulp/srpt/ib_srpt.c @@ -2338,7 +2338,7 @@ static int srpt_cm_req_recv(struct srpt_device *const sdev, if (IS_ERR_OR_NULL(ch->sess)) { WARN_ON_ONCE(ch->sess == NULL); - ret = PTR_ERR(ch->sess); + ret = PTR_ERR_OR_ZERO(ch->sess); ch->sess = NULL; pr_info("Rejected login for initiator %s: ret = %d.\n", ch->sess_name, ret); -- 2.17.1
[PATCH] nbd: Fix passing zero to 'PTR_ERR' warning
Fix smatch warning: drivers/block/nbd.c:698 nbd_read_stat() warn: passing zero to 'ERR_PTR' sock_xmit() never return 0, remove check 0 to fix this warning. Signed-off-by: YueHaibing --- drivers/block/nbd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c index aaae9220f3a0..1620d1217581 100644 --- a/drivers/block/nbd.c +++ b/drivers/block/nbd.c @@ -691,7 +691,7 @@ static struct nbd_cmd *nbd_read_stat(struct nbd_device *nbd, int index) reply.magic = 0; iov_iter_kvec(, READ, , 1, sizeof(reply)); result = sock_xmit(nbd, index, 0, , MSG_WAITALL, NULL); - if (result <= 0) { + if (result < 0) { if (!nbd_disconnected(config)) dev_err(disk_to_dev(nbd->disk), "Receive control failed (result %d)\n", result); -- 2.17.1
[PATCH] loop: Fix passing zero to 'PTR_ERR' warning
Fix smatch warning: drivers/block/loop.c:799 loop_attr_backing_file_show() warn: passing zero to 'PTR_ERR' file_path() never returns 0, so use IS_ERR instead of IS_ERR_OR_NULL to fix this. Signed-off-by: YueHaibing --- drivers/block/loop.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/block/loop.c b/drivers/block/loop.c index 83701c2ae3ca..65d392307c6a 100644 --- a/drivers/block/loop.c +++ b/drivers/block/loop.c @@ -795,7 +795,7 @@ static ssize_t loop_attr_backing_file_show(struct loop_device *lo, char *buf) p = file_path(lo->lo_backing_file, buf, PAGE_SIZE - 1); spin_unlock_irq(>lo_lock); - if (IS_ERR_OR_NULL(p)) + if (IS_ERR(p)) ret = PTR_ERR(p); else { ret = strlen(p); -- 2.17.1
[PATCH] net: macb: Fix passing zero to 'PTR_ERR'
Check PTR_ERR with IS_ERR to fix this. Fixes: cd5afa91f078 ("net: macb: Add null check for PCLK and HCLK") Signed-off-by: YueHaibing --- drivers/net/ethernet/cadence/macb_main.c | 10 ++ 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c index 51f866288582..7b1d195787dc 100644 --- a/drivers/net/ethernet/cadence/macb_main.c +++ b/drivers/net/ethernet/cadence/macb_main.c @@ -3711,19 +3711,13 @@ static int macb_clk_init(struct platform_device *pdev, struct clk **pclk, } if (IS_ERR_OR_NULL(*pclk)) { - err = PTR_ERR(*pclk); - if (!err) - err = -ENODEV; - + err = IS_ERR(*pclk) ? PTR_ERR(*pclk) : -ENODEV; dev_err(>dev, "failed to get macb_clk (%d)\n", err); return err; } if (IS_ERR_OR_NULL(*hclk)) { - err = PTR_ERR(*hclk); - if (!err) - err = -ENODEV; - + err = IS_ERR(*hclk) ? PTR_ERR(*hclk) : -ENODEV; dev_err(>dev, "failed to get hclk (%d)\n", err); return err; } -- 2.17.1
[PATCH net-next] net/mlx5: Fix passing zero to 'PTR_ERR'
Fix smatch warnings: drivers/net/ethernet/mellanox/mlx5/core/esw/acl/egress_lgcy.c:105 esw_acl_egress_lgcy_setup() warn: passing zero to 'PTR_ERR' drivers/net/ethernet/mellanox/mlx5/core/esw/acl/egress_ofld.c:177 esw_acl_egress_ofld_setup() warn: passing zero to 'PTR_ERR' drivers/net/ethernet/mellanox/mlx5/core/esw/acl/ingress_lgcy.c:184 esw_acl_ingress_lgcy_setup() warn: passing zero to 'PTR_ERR' drivers/net/ethernet/mellanox/mlx5/core/esw/acl/ingress_ofld.c:262 esw_acl_ingress_ofld_setup() warn: passing zero to 'PTR_ERR' esw_acl_table_create() never returns NULL, so NULL test should be removed. Signed-off-by: YueHaibing --- drivers/net/ethernet/mellanox/mlx5/core/esw/acl/egress_lgcy.c | 2 +- drivers/net/ethernet/mellanox/mlx5/core/esw/acl/egress_ofld.c | 2 +- drivers/net/ethernet/mellanox/mlx5/core/esw/acl/ingress_lgcy.c | 2 +- drivers/net/ethernet/mellanox/mlx5/core/esw/acl/ingress_ofld.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/esw/acl/egress_lgcy.c b/drivers/net/ethernet/mellanox/mlx5/core/esw/acl/egress_lgcy.c index d46f8b225ebe..2b85d4777303 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/esw/acl/egress_lgcy.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/esw/acl/egress_lgcy.c @@ -101,7 +101,7 @@ int esw_acl_egress_lgcy_setup(struct mlx5_eswitch *esw, vport->egress.acl = esw_acl_table_create(esw, vport->vport, MLX5_FLOW_NAMESPACE_ESW_EGRESS, table_size); - if (IS_ERR_OR_NULL(vport->egress.acl)) { + if (IS_ERR(vport->egress.acl)) { err = PTR_ERR(vport->egress.acl); vport->egress.acl = NULL; goto out; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/esw/acl/egress_ofld.c b/drivers/net/ethernet/mellanox/mlx5/core/esw/acl/egress_ofld.c index c3faae67e4d6..4c74e2690d57 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/esw/acl/egress_ofld.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/esw/acl/egress_ofld.c @@ -173,7 +173,7 @@ int esw_acl_egress_ofld_setup(struct mlx5_eswitch *esw, struct mlx5_vport *vport table_size++; vport->egress.acl = esw_acl_table_create(esw, vport->vport, MLX5_FLOW_NAMESPACE_ESW_EGRESS, table_size); - if (IS_ERR_OR_NULL(vport->egress.acl)) { + if (IS_ERR(vport->egress.acl)) { err = PTR_ERR(vport->egress.acl); vport->egress.acl = NULL; return err; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/esw/acl/ingress_lgcy.c b/drivers/net/ethernet/mellanox/mlx5/core/esw/acl/ingress_lgcy.c index b68976b378b8..d64fad2823e7 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/esw/acl/ingress_lgcy.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/esw/acl/ingress_lgcy.c @@ -180,7 +180,7 @@ int esw_acl_ingress_lgcy_setup(struct mlx5_eswitch *esw, vport->ingress.acl = esw_acl_table_create(esw, vport->vport, MLX5_FLOW_NAMESPACE_ESW_INGRESS, table_size); - if (IS_ERR_OR_NULL(vport->ingress.acl)) { + if (IS_ERR(vport->ingress.acl)) { err = PTR_ERR(vport->ingress.acl); vport->ingress.acl = NULL; return err; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/esw/acl/ingress_ofld.c b/drivers/net/ethernet/mellanox/mlx5/core/esw/acl/ingress_ofld.c index 4e55d7225a26..548c005ea633 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/esw/acl/ingress_ofld.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/esw/acl/ingress_ofld.c @@ -258,7 +258,7 @@ int esw_acl_ingress_ofld_setup(struct mlx5_eswitch *esw, vport->ingress.acl = esw_acl_table_create(esw, vport->vport, MLX5_FLOW_NAMESPACE_ESW_INGRESS, num_ftes); - if (IS_ERR_OR_NULL(vport->ingress.acl)) { + if (IS_ERR(vport->ingress.acl)) { err = PTR_ERR(vport->ingress.acl); vport->ingress.acl = NULL; return err; -- 2.17.1
[PATCH v2] drm/bridge: tpd12s015: Fix irq registering in tpd12s015_probe
gpiod_to_irq() return negative value in case of error, the existing code doesn't handle negative error codes. If the HPD gpio supports IRQs (gpiod_to_irq returns a valid number), we use the IRQ. If it doesn't (gpiod_to_irq returns an error), it gets polled via detect(). Fixes: cff5e6f7e83f ("drm/bridge: Add driver for the TI TPD12S015 HDMI level shifter") Signed-off-by: YueHaibing --- v2: Add checking for >= 0 and update commit message --- drivers/gpu/drm/bridge/ti-tpd12s015.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/bridge/ti-tpd12s015.c b/drivers/gpu/drm/bridge/ti-tpd12s015.c index 514cbf0eac75..e0e015243a60 100644 --- a/drivers/gpu/drm/bridge/ti-tpd12s015.c +++ b/drivers/gpu/drm/bridge/ti-tpd12s015.c @@ -160,7 +160,7 @@ static int tpd12s015_probe(struct platform_device *pdev) /* Register the IRQ if the HPD GPIO is IRQ-capable. */ tpd->hpd_irq = gpiod_to_irq(tpd->hpd_gpio); - if (tpd->hpd_irq) { + if (tpd->hpd_irq >= 0) { ret = devm_request_threaded_irq(>dev, tpd->hpd_irq, NULL, tpd12s015_hpd_isr, IRQF_TRIGGER_RISING | -- 2.17.1
Re: [PATCH] drm/bridge: tpd12s015: Fix irq registering in tpd12s015_probe
On 2020/11/2 14:57, Tomi Valkeinen wrote: > On 31/10/2020 09:19, Sam Ravnborg wrote: >> Hi YueHaibing >> >> Thanks for the fix. Appreciated but please update as per comments below. >> >> On Sat, Oct 31, 2020 at 11:16:48AM +0800, YueHaibing wrote: >>> gpiod_to_irq() return negative value in case of error, >>> the existing code handle negative error codes wrongly. >>> >>> Fixes: cff5e6f7e83f ("drm/bridge: Add driver for the TI TPD12S015 HDMI >>> level shifter") >>> Signed-off-by: YueHaibing >>> --- >>> drivers/gpu/drm/bridge/ti-tpd12s015.c | 2 +- >>> 1 file changed, 1 insertion(+), 1 deletion(-) >>> >>> diff --git a/drivers/gpu/drm/bridge/ti-tpd12s015.c >>> b/drivers/gpu/drm/bridge/ti-tpd12s015.c >>> index 514cbf0eac75..a18d5197c16c 100644 >>> --- a/drivers/gpu/drm/bridge/ti-tpd12s015.c >>> +++ b/drivers/gpu/drm/bridge/ti-tpd12s015.c >>> @@ -160,7 +160,7 @@ static int tpd12s015_probe(struct platform_device *pdev) >>> >>> /* Register the IRQ if the HPD GPIO is IRQ-capable. */ >>> tpd->hpd_irq = gpiod_to_irq(tpd->hpd_gpio); >>> - if (tpd->hpd_irq) { >>> + if (tpd->hpd_irq > 0) { >>> ret = devm_request_threaded_irq(>dev, tpd->hpd_irq, NULL, >>> tpd12s015_hpd_isr, >>> IRQF_TRIGGER_RISING | >> >> The current implmentation will skip devm_request_threaded_irq() in case >> or error - but continue with the rest of the function. So the >> driver fails to return an error code. > > That is intended. If the HPD gpio supports IRQs (gpiod_to_irq returns a valid > number), we use the > IRQ. If it doesn't (gpiod_to_irq returns an error), it gets polled via > detect(). Both are ok. > > I don't know if the gpiod_to_irq never returning 0 is something we should > rely on. The docs say > gpiod_to_irq returns the irq number or an error, so I think checking for >= 0 > matches the docs better. > gpiod_to_irq() now never returns 0, see: https://elixir.bootlin.com/linux/v5.10-rc2/source/drivers/gpio/gpiolib.c#L3183 Also commit 4c37ce8608a8 ("gpio: make gpiod_to_irq() return negative for NO_IRQ") says: commit 4c37ce8608a8c6521726d4cd1d4f54424e8d095f Author: Linus Walleij Date: Mon May 2 13:13:10 2016 +0200 gpio: make gpiod_to_irq() return negative for NO_IRQ If a translation returns zero, that means NO_IRQ, so we should return an error since the function is documented to return a negative code on error. So checking for >0 is enough, my patch is correct. > Tomi >
Re: [PATCH] usb: dwc2: Fix unused label warning
On 2020/11/2 15:04, Minas Harutyunyan wrote: > On 10/31/2020 10:03 AM, YueHaibing wrote: >> drivers/usb/dwc2/platform.c: In function ‘dwc2_driver_probe’: >> drivers/usb/dwc2/platform.c:611:1: warning: label ‘error_debugfs’ defined >> but not used [-Wunused-label] >> error_debugfs: >> ^ >> >> Move label 'error_debugfs' to ifdef block. >> >> Signed-off-by: YueHaibing >> --- >> drivers/usb/dwc2/platform.c | 3 +++ >> 1 file changed, 3 insertions(+) >> >> diff --git a/drivers/usb/dwc2/platform.c b/drivers/usb/dwc2/platform.c >> index e2820676beb1..5f18acac7406 100644 >> --- a/drivers/usb/dwc2/platform.c >> +++ b/drivers/usb/dwc2/platform.c >> @@ -608,10 +608,13 @@ static int dwc2_driver_probe(struct platform_device >> *dev) >> #endif /* CONFIG_USB_DWC2_PERIPHERAL || CONFIG_USB_DWC2_DUAL_ROLE */ >> return 0; >> >> +#if IS_ENABLED(CONFIG_USB_DWC2_PERIPHERAL) || \ >> +IS_ENABLED(CONFIG_USB_DWC2_DUAL_ROLE) >> error_debugfs: >> dwc2_debugfs_exit(hsotg); >> if (hsotg->hcd_enabled) >> dwc2_hcd_remove(hsotg); >> +#endif >> error_drd: >> dwc2_drd_exit(hsotg); >> >> > Thank you for patch. Identical patch submitted by on 10/17/2020 by > Martin Blumenstingl: [PATCH] usb: dwc2: Avoid leaving the error_debugfs > label unused. I'm already ACKed it. Thanks for this info. > Thanks, > Minas >
Re: [PATCH] drm/bridge: tpd12s015: Fix irq registering in tpd12s015_probe
On 2020/10/31 15:19, Sam Ravnborg wrote: > Hi YueHaibing > > Thanks for the fix. Appreciated but please update as per comments below. > > On Sat, Oct 31, 2020 at 11:16:48AM +0800, YueHaibing wrote: >> gpiod_to_irq() return negative value in case of error, >> the existing code handle negative error codes wrongly. >> >> Fixes: cff5e6f7e83f ("drm/bridge: Add driver for the TI TPD12S015 HDMI level >> shifter") >> Signed-off-by: YueHaibing >> --- >> drivers/gpu/drm/bridge/ti-tpd12s015.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/drivers/gpu/drm/bridge/ti-tpd12s015.c >> b/drivers/gpu/drm/bridge/ti-tpd12s015.c >> index 514cbf0eac75..a18d5197c16c 100644 >> --- a/drivers/gpu/drm/bridge/ti-tpd12s015.c >> +++ b/drivers/gpu/drm/bridge/ti-tpd12s015.c >> @@ -160,7 +160,7 @@ static int tpd12s015_probe(struct platform_device *pdev) >> >> /* Register the IRQ if the HPD GPIO is IRQ-capable. */ >> tpd->hpd_irq = gpiod_to_irq(tpd->hpd_gpio); >> -if (tpd->hpd_irq) { >> +if (tpd->hpd_irq > 0) { >> ret = devm_request_threaded_irq(>dev, tpd->hpd_irq, NULL, >> tpd12s015_hpd_isr, >> IRQF_TRIGGER_RISING | > > The current implmentation will skip devm_request_threaded_irq() in case > or error - but continue with the rest of the function. So the > driver fails to return an error code. > > In case of error (negative value) then return early with that error Agree, will resubmit. > value. If gpiod_to_irq() returns 0 assume this is a valid irq and let > the code continue. gpiod_to_irq() never returns 0, so no need check this. > > Please fix and re-submit - or tell me if I am mistaken. > > Sam > . >
[PATCH] usb: dwc2: Fix unused label warning
drivers/usb/dwc2/platform.c: In function ‘dwc2_driver_probe’: drivers/usb/dwc2/platform.c:611:1: warning: label ‘error_debugfs’ defined but not used [-Wunused-label] error_debugfs: ^ Move label 'error_debugfs' to ifdef block. Signed-off-by: YueHaibing --- drivers/usb/dwc2/platform.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/usb/dwc2/platform.c b/drivers/usb/dwc2/platform.c index e2820676beb1..5f18acac7406 100644 --- a/drivers/usb/dwc2/platform.c +++ b/drivers/usb/dwc2/platform.c @@ -608,10 +608,13 @@ static int dwc2_driver_probe(struct platform_device *dev) #endif /* CONFIG_USB_DWC2_PERIPHERAL || CONFIG_USB_DWC2_DUAL_ROLE */ return 0; +#if IS_ENABLED(CONFIG_USB_DWC2_PERIPHERAL) || \ + IS_ENABLED(CONFIG_USB_DWC2_DUAL_ROLE) error_debugfs: dwc2_debugfs_exit(hsotg); if (hsotg->hcd_enabled) dwc2_hcd_remove(hsotg); +#endif error_drd: dwc2_drd_exit(hsotg); -- 2.17.1
[PATCH net-next] openvswitch: Use IS_ERR instead of IS_ERR_OR_NULL
Fix smatch warning: net/openvswitch/meter.c:427 ovs_meter_cmd_set() warn: passing zero to 'PTR_ERR' dp_meter_create() never returns NULL, use IS_ERR instead of IS_ERR_OR_NULL to fix this. Signed-off-by: YueHaibing --- net/openvswitch/meter.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/openvswitch/meter.c b/net/openvswitch/meter.c index 8fbefd52af7f..15424d26e85d 100644 --- a/net/openvswitch/meter.c +++ b/net/openvswitch/meter.c @@ -423,7 +423,7 @@ static int ovs_meter_cmd_set(struct sk_buff *skb, struct genl_info *info) return -EINVAL; meter = dp_meter_create(a); - if (IS_ERR_OR_NULL(meter)) + if (IS_ERR(meter)) return PTR_ERR(meter); reply = ovs_meter_cmd_reply_start(info, OVS_METER_CMD_SET, -- 2.17.1
[PATCH] pstore: Fix passing zero to 'PTR_ERR' warning
Fix smatch warning: fs/pstore/platform.c:320 allocate_buf_for_compression() warn: passing zero to 'PTR_ERR' crypto_alloc_comp() never return NULL, use IS_ERR instead of IS_ERR_OR_NULL to fix this. Signed-off-by: YueHaibing --- fs/pstore/platform.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/pstore/platform.c b/fs/pstore/platform.c index 36714df37d5d..b7a2a2a31dee 100644 --- a/fs/pstore/platform.c +++ b/fs/pstore/platform.c @@ -315,7 +315,7 @@ static void allocate_buf_for_compression(void) } ctx = crypto_alloc_comp(zbackend->name, 0, 0); - if (IS_ERR_OR_NULL(ctx)) { + if (IS_ERR(ctx)) { kfree(buf); pr_err("crypto_alloc_comp('%s') failed: %ld\n", zbackend->name, PTR_ERR(ctx)); -- 2.17.1
[PATCH] mm/zswap: Fix passing zero to 'PTR_ERR' warning
Fix smatch warning: mm/zswap.c:425 zswap_cpu_comp_prepare() warn: passing zero to 'PTR_ERR' crypto_alloc_comp() never return NULL, use IS_ERR instead of IS_ERR_OR_NULL to fix this. Fixes: f1c54846ee45 ("zswap: dynamic pool creation") Signed-off-by: YueHaibing --- mm/zswap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/zswap.c b/mm/zswap.c index 1eced701b3bd..55a2f72557a8 100644 --- a/mm/zswap.c +++ b/mm/zswap.c @@ -421,7 +421,7 @@ static int zswap_cpu_comp_prepare(unsigned int cpu, struct hlist_node *node) return 0; tfm = crypto_alloc_comp(pool->tfm_name, 0, 0); - if (IS_ERR_OR_NULL(tfm)) { + if (IS_ERR(tfm)) { pr_err("could not alloc crypto comp %s : %ld\n", pool->tfm_name, PTR_ERR(tfm)); return -ENOMEM; -- 2.17.1
[PATCH] spi: spi-mem: Fix passing zero to 'PTR_ERR' warning
Fix smatch warning: drivers/spi/spi-mem.c:746 spi_mem_probe() warn: passing zero to 'PTR_ERR' Fixes: 5d27a9c8ea9e ("spi: spi-mem: Extend the SPI mem interface to set a custom memory name") Signed-off-by: YueHaibing --- drivers/spi/spi-mem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/spi/spi-mem.c b/drivers/spi/spi-mem.c index ef53290b7d24..a1b4d085834a 100644 --- a/drivers/spi/spi-mem.c +++ b/drivers/spi/spi-mem.c @@ -743,7 +743,7 @@ static int spi_mem_probe(struct spi_device *spi) mem->name = dev_name(>dev); if (IS_ERR_OR_NULL(mem->name)) - return PTR_ERR(mem->name); + return PTR_ERR_OR_ZERO(mem->name); spi_set_drvdata(spi, mem); -- 2.17.1
[PATCH] drm/bridge: tpd12s015: Fix irq registering in tpd12s015_probe
gpiod_to_irq() return negative value in case of error, the existing code handle negative error codes wrongly. Fixes: cff5e6f7e83f ("drm/bridge: Add driver for the TI TPD12S015 HDMI level shifter") Signed-off-by: YueHaibing --- drivers/gpu/drm/bridge/ti-tpd12s015.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/bridge/ti-tpd12s015.c b/drivers/gpu/drm/bridge/ti-tpd12s015.c index 514cbf0eac75..a18d5197c16c 100644 --- a/drivers/gpu/drm/bridge/ti-tpd12s015.c +++ b/drivers/gpu/drm/bridge/ti-tpd12s015.c @@ -160,7 +160,7 @@ static int tpd12s015_probe(struct platform_device *pdev) /* Register the IRQ if the HPD GPIO is IRQ-capable. */ tpd->hpd_irq = gpiod_to_irq(tpd->hpd_gpio); - if (tpd->hpd_irq) { + if (tpd->hpd_irq > 0) { ret = devm_request_threaded_irq(>dev, tpd->hpd_irq, NULL, tpd12s015_hpd_isr, IRQF_TRIGGER_RISING | -- 2.17.1
[PATCH] sfp: Fix error handing in sfp_probe()
gpiod_to_irq() never return 0, but returns negative in case of error, check it and set gpio_irq to 0. Fixes: 73970055450e ("sfp: add SFP module support") Signed-off-by: YueHaibing --- drivers/net/phy/sfp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/phy/sfp.c b/drivers/net/phy/sfp.c index 1d18c10e8f82..34aa196b7465 100644 --- a/drivers/net/phy/sfp.c +++ b/drivers/net/phy/sfp.c @@ -2389,7 +2389,8 @@ static int sfp_probe(struct platform_device *pdev) continue; sfp->gpio_irq[i] = gpiod_to_irq(sfp->gpio[i]); - if (!sfp->gpio_irq[i]) { + if (sfp->gpio_irq[i] < 0) { + sfp->gpio_irq[i] = 0; sfp->need_poll = true; continue; } -- 2.17.1
[PATCH] serial: mctrl_gpio: Fix passing zero to 'ERR_PTR' warning
drivers/tty/serial/serial_mctrl_gpio.c:214 mctrl_gpio_init() warn: passing zero to 'ERR_PTR' gpiod_to_irq() never return 0, so remove the useless test and make code more clear. Signed-off-by: YueHaibing --- drivers/tty/serial/serial_mctrl_gpio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/tty/serial/serial_mctrl_gpio.c b/drivers/tty/serial/serial_mctrl_gpio.c index fb4781292d40..c41d8911ce95 100644 --- a/drivers/tty/serial/serial_mctrl_gpio.c +++ b/drivers/tty/serial/serial_mctrl_gpio.c @@ -207,7 +207,7 @@ struct mctrl_gpios *mctrl_gpio_init(struct uart_port *port, unsigned int idx) continue; ret = gpiod_to_irq(gpios->gpio[i]); - if (ret <= 0) { + if (ret < 0) { dev_err(port->dev, "failed to find corresponding irq for %s (idx=%d, err=%d)\n", mctrl_gpios_desc[i].name, idx, ret); -- 2.17.1
[PATCH net-next] net/mlx5e: Remove duplicated include
Remove duplicated include. Signed-off-by: YueHaibing --- drivers/net/ethernet/mellanox/mlx5/core/en_rx.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c b/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c index 599f5b5ebc97..58c177756dc4 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c @@ -52,7 +52,6 @@ #include "en/xsk/rx.h" #include "en/health.h" #include "en/params.h" -#include "en/txrx.h" static struct sk_buff * mlx5e_skb_from_cqe_mpwrq_linear(struct mlx5e_rq *rq, struct mlx5e_mpw_info *wi, -- 2.17.1
[PATCH net-next] net: hns3: Remove duplicated include
Remove duplicated include. Signed-off-by: YueHaibing --- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c index 3606240025a8..f990f6915226 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c @@ -4,7 +4,6 @@ #include "hclge_main.h" #include "hclge_dcb.h" #include "hclge_tm.h" -#include "hclge_dcb.h" #include "hnae3.h" #define BW_PERCENT 100 -- 2.17.1
[PATCH net-next] liquidio: cn68xx: Remove duplicated include
Remove duplicated include. Signed-off-by: YueHaibing --- drivers/net/ethernet/cavium/liquidio/cn68xx_device.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/net/ethernet/cavium/liquidio/cn68xx_device.c b/drivers/net/ethernet/cavium/liquidio/cn68xx_device.c index 2a6d1cadac9e..30254e4cf70f 100644 --- a/drivers/net/ethernet/cavium/liquidio/cn68xx_device.c +++ b/drivers/net/ethernet/cavium/liquidio/cn68xx_device.c @@ -27,7 +27,6 @@ #include "cn66xx_device.h" #include "cn68xx_device.h" #include "cn68xx_regs.h" -#include "cn68xx_device.h" static void lio_cn68xx_set_dpi_regs(struct octeon_device *oct) { -- 2.17.1
Re: [PATCH -next] drm/rockchip: cdn-dp: Mark cdn_dp_core_suspend/resume __maybe_unused
ping... On 2020/8/11 10:12, YueHaibing wrote: > If CONFIG_PM is not set, gcc warns: > > drivers/gpu/drm/rockchip/cdn-dp-core.c:1124:12: > warning: ‘cdn_dp_resume’ defined but not used [-Wunused-function] > > Mark them __maybe_unused to fix this. > > Reported-by: Hulk Robot > Signed-off-by: YueHaibing > --- > drivers/gpu/drm/rockchip/cdn-dp-core.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/gpu/drm/rockchip/cdn-dp-core.c > b/drivers/gpu/drm/rockchip/cdn-dp-core.c > index a4a45daf93f2..413b0e90f10f 100644 > --- a/drivers/gpu/drm/rockchip/cdn-dp-core.c > +++ b/drivers/gpu/drm/rockchip/cdn-dp-core.c > @@ -1107,7 +1107,7 @@ static const struct component_ops cdn_dp_component_ops > = { > .unbind = cdn_dp_unbind, > }; > > -static int cdn_dp_suspend(struct device *dev) > +static __maybe_unused int cdn_dp_suspend(struct device *dev) > { > struct cdn_dp_device *dp = dev_get_drvdata(dev); > int ret = 0; > @@ -1121,7 +1121,7 @@ static int cdn_dp_suspend(struct device *dev) > return ret; > } > > -static int cdn_dp_resume(struct device *dev) > +static __maybe_unused int cdn_dp_resume(struct device *dev) > { > struct cdn_dp_device *dp = dev_get_drvdata(dev); > >
[tip: timers/urgent] hrtimer: Remove unused inline function debug_hrtimer_free()
The following commit has been merged into the timers/urgent branch of tip: Commit-ID: 5254cb87c0423f73c8036235795788a132e8956e Gitweb: https://git.kernel.org/tip/5254cb87c0423f73c8036235795788a132e8956e Author:YueHaibing AuthorDate:Wed, 09 Sep 2020 21:48:50 +08:00 Committer: Thomas Gleixner CommitterDate: Mon, 26 Oct 2020 11:39:21 +01:00 hrtimer: Remove unused inline function debug_hrtimer_free() There is no caller in tree, remove it. Signed-off-by: YueHaibing Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/20200909134850.21940-1-yuehaib...@huawei.com --- kernel/time/hrtimer.c | 5 - 1 file changed, 5 deletions(-) diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c index 3624b9b..387b4be 100644 --- a/kernel/time/hrtimer.c +++ b/kernel/time/hrtimer.c @@ -425,11 +425,6 @@ static inline void debug_hrtimer_deactivate(struct hrtimer *timer) debug_object_deactivate(timer, _debug_descr); } -static inline void debug_hrtimer_free(struct hrtimer *timer) -{ - debug_object_free(timer, _debug_descr); -} - static void __hrtimer_init(struct hrtimer *timer, clockid_t clock_id, enum hrtimer_mode mode);
[tip: timers/urgent] timers: Remove unused inline funtion debug_timer_free()
The following commit has been merged into the timers/urgent branch of tip: Commit-ID: 9010e3876e1c3f7b1c3769bee519d6a871589aca Gitweb: https://git.kernel.org/tip/9010e3876e1c3f7b1c3769bee519d6a871589aca Author:YueHaibing AuthorDate:Wed, 09 Sep 2020 21:47:49 +08:00 Committer: Thomas Gleixner CommitterDate: Mon, 26 Oct 2020 11:39:21 +01:00 timers: Remove unused inline funtion debug_timer_free() There is no caller in tree, remove it. Signed-off-by: YueHaibing Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/20200909134749.32300-1-yuehaib...@huawei.com --- kernel/time/timer.c | 5 - 1 file changed, 5 deletions(-) diff --git a/kernel/time/timer.c b/kernel/time/timer.c index de37e33..c3ad64f 100644 --- a/kernel/time/timer.c +++ b/kernel/time/timer.c @@ -732,11 +732,6 @@ static inline void debug_timer_deactivate(struct timer_list *timer) debug_object_deactivate(timer, _debug_descr); } -static inline void debug_timer_free(struct timer_list *timer) -{ - debug_object_free(timer, _debug_descr); -} - static inline void debug_timer_assert_init(struct timer_list *timer) { debug_object_assert_init(timer, _debug_descr);
Re: [PATCH] bpfilter: Fix build error with CONFIG_BPFILTER_UMH
On 2020/10/16 3:57, Alexei Starovoitov wrote: > On Thu, Oct 15, 2020 at 12:26 PM Jakub Kicinski wrote: >> >> On Thu, 15 Oct 2020 12:03:14 -0700 Alexei Starovoitov wrote: >>> On Thu, Oct 15, 2020 at 11:56 AM Jakub Kicinski wrote: How so? It's using in-tree headers instead of system ones. Many samples seem to be doing the same thing. >>> >>> There is no such thing as "usr/include" in the kernel build and source >>> trees. >> >> Hm. I thought bpfilter somehow depends on make headers. But it doesn't >> seem to. Reverting now. > > Thanks! > Right. To explain it a bit further for the author of the patch: > Some samples makefiles use this -I usr/include pattern. > That's different. This local "usr/include" is a result of 'make > headers_install'. I didn't notice this, sorry for the wrong fix. > For samples and such it's ok to depend on that, but bpfilter is > the part of the kernel build. > It cannot depend on the 'make headers_install' step, > so the fix has to be different. Yes, this should rework. > > Also please don't take bpf patches. You had it marked it as netdev in your patchwork :/ >>> >>> It was delegated automatically by the patchwork system. >>> I didn't have time to reassign, but you should have known better >>> when you saw 'bpfilter' in the subject. >> >> The previous committers for bpfilter are almost all Dave, so I checked >> your patchwork to make sure and it was netdev... > > It was my fault. I was sloppy in the past and didn't pay enough attention > to bpfilter and it started to bitrot because Dave was applying patches > with his normal SLAs while I was silent. > . >
[PATCH] bpfilter: Fix build error with CONFIG_BPFILTER_UMH
IF CONFIG_BPFILTER_UMH is set, building fails: In file included from /usr/include/sys/socket.h:33:0, from net/bpfilter/main.c:6: /usr/include/bits/socket.h:390:10: fatal error: asm/socket.h: No such file or directory #include ^~ compilation terminated. scripts/Makefile.userprogs:43: recipe for target 'net/bpfilter/main.o' failed make[2]: *** [net/bpfilter/main.o] Error 1 Add missing include path to fix this. Signed-off-by: YueHaibing --- net/bpfilter/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/bpfilter/Makefile b/net/bpfilter/Makefile index cdac82b8c53a..389ea76ccc0b 100644 --- a/net/bpfilter/Makefile +++ b/net/bpfilter/Makefile @@ -5,7 +5,7 @@ userprogs := bpfilter_umh bpfilter_umh-objs := main.o -userccflags += -I $(srctree)/tools/include/ -I $(srctree)/tools/include/uapi +userccflags += -I $(srctree)/tools/include/ -I $(srctree)/tools/include/uapi -I usr/include/ ifeq ($(CONFIG_BPFILTER_UMH), y) # builtin bpfilter_umh should be linked with -static -- 2.17.1
[tip: irq/core] arm64: Fix -Wunused-function warning when !CONFIG_HOTPLUG_CPU
The following commit has been merged into the irq/core branch of tip: Commit-ID: 9d9edb962e910552c9c008800ec907293a47852e Gitweb: https://git.kernel.org/tip/9d9edb962e910552c9c008800ec907293a47852e Author:YueHaibing AuthorDate:Fri, 18 Sep 2020 20:33:18 +08:00 Committer: Marc Zyngier CommitterDate: Fri, 18 Sep 2020 16:59:20 +01:00 arm64: Fix -Wunused-function warning when !CONFIG_HOTPLUG_CPU If CONFIG_HOTPLUG_CPU is n, gcc warns: arch/arm64/kernel/smp.c:967:13: warning: ‘ipi_teardown’ defined but not used [-Wunused-function] static void ipi_teardown(int cpu) ^~~~ Use #ifdef guard this. Signed-off-by: YueHaibing Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20200918123318.23764-1-yuehaib...@huawei.com --- arch/arm64/kernel/smp.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/arch/arm64/kernel/smp.c b/arch/arm64/kernel/smp.c index b6bde26..82e75fc 100644 --- a/arch/arm64/kernel/smp.c +++ b/arch/arm64/kernel/smp.c @@ -82,9 +82,9 @@ static int nr_ipi __read_mostly = NR_IPI; static struct irq_desc *ipi_desc[NR_IPI] __read_mostly; static void ipi_setup(int cpu); -static void ipi_teardown(int cpu); #ifdef CONFIG_HOTPLUG_CPU +static void ipi_teardown(int cpu); static int op_cpu_kill(unsigned int cpu); #else static inline int op_cpu_kill(unsigned int cpu) @@ -964,6 +964,7 @@ static void ipi_setup(int cpu) enable_percpu_irq(ipi_irq_base + i, 0); } +#ifdef CONFIG_HOTPLUG_CPU static void ipi_teardown(int cpu) { int i; @@ -974,6 +975,7 @@ static void ipi_teardown(int cpu) for (i = 0; i < nr_ipi; i++) disable_percpu_irq(ipi_irq_base + i); } +#endif void __init set_smp_ipi_range(int ipi_base, int n) {
[tip: irq/core] irqchip/ti-sci-intr: Fix unsigned comparison to zero
The following commit has been merged into the irq/core branch of tip: Commit-ID: 8ddf1905a904ca86d71ca1c435e4b0b2a0b70df8 Gitweb: https://git.kernel.org/tip/8ddf1905a904ca86d71ca1c435e4b0b2a0b70df8 Author:YueHaibing AuthorDate:Wed, 26 Aug 2020 11:53:21 +08:00 Committer: Marc Zyngier CommitterDate: Sun, 13 Sep 2020 15:30:00 +01:00 irqchip/ti-sci-intr: Fix unsigned comparison to zero ti_sci_intr_xlate_irq() return -ENOENT on fail, p_hwirq should be int type. Fixes: a5b659bd4bc7 ("irqchip/ti-sci-intr: Add support for INTR being a parent to INTR") Signed-off-by: YueHaibing Signed-off-by: Marc Zyngier Acked-by: Lokesh Vutla Link: https://lore.kernel.org/r/20200826035321.18620-1-yuehaib...@huawei.com --- drivers/irqchip/irq-ti-sci-intr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/irqchip/irq-ti-sci-intr.c b/drivers/irqchip/irq-ti-sci-intr.c index cbc1758..85a72b5 100644 --- a/drivers/irqchip/irq-ti-sci-intr.c +++ b/drivers/irqchip/irq-ti-sci-intr.c @@ -137,8 +137,8 @@ static int ti_sci_intr_alloc_parent_irq(struct irq_domain *domain, struct ti_sci_intr_irq_domain *intr = domain->host_data; struct device_node *parent_node; struct irq_fwspec fwspec; - u16 out_irq, p_hwirq; - int err = 0; + int p_hwirq, err = 0; + u16 out_irq; out_irq = ti_sci_get_free_resource(intr->out_irqs); if (out_irq == TI_SCI_RESOURCE_NULL)
[tip: irq/core] irqchip/ti-sci-inta: Fix unsigned comparison to zero
The following commit has been merged into the irq/core branch of tip: Commit-ID: 4c9b1bfaa5039fee650f4de514a8e70ae976fc2f Gitweb: https://git.kernel.org/tip/4c9b1bfaa5039fee650f4de514a8e70ae976fc2f Author:YueHaibing AuthorDate:Wed, 26 Aug 2020 11:54:30 +08:00 Committer: Marc Zyngier CommitterDate: Sun, 13 Sep 2020 15:30:00 +01:00 irqchip/ti-sci-inta: Fix unsigned comparison to zero ti_sci_inta_xlate_irq() return -ENOENT on fail, p_hwirq should be int type. Fixes: 5c4b585d2910 ("irqchip/ti-sci-inta: Add support for INTA directly connecting to GIC") Signed-off-by: YueHaibing Signed-off-by: Marc Zyngier Acked-by: Lokesh Vutla Link: https://lore.kernel.org/r/20200826035430.21060-1-yuehaib...@huawei.com --- drivers/irqchip/irq-ti-sci-inta.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/irqchip/irq-ti-sci-inta.c b/drivers/irqchip/irq-ti-sci-inta.c index d4e9760..05bf94b 100644 --- a/drivers/irqchip/irq-ti-sci-inta.c +++ b/drivers/irqchip/irq-ti-sci-inta.c @@ -175,8 +175,8 @@ static struct ti_sci_inta_vint_desc *ti_sci_inta_alloc_parent_irq(struct irq_dom struct irq_fwspec parent_fwspec; struct device_node *parent_node; unsigned int parent_virq; - u16 vint_id, p_hwirq; - int ret; + int p_hwirq, ret; + u16 vint_id; vint_id = ti_sci_get_free_resource(inta->vint); if (vint_id == TI_SCI_RESOURCE_NULL)
[tip: sched/core] sched: Remove unused inline function uclamp_bucket_base_value()
The following commit has been merged into the sched/core branch of tip: Commit-ID: 51bd5121c4eb25b911f6bc1ab4de5fe865fe0dcb Gitweb: https://git.kernel.org/tip/51bd5121c4eb25b911f6bc1ab4de5fe865fe0dcb Author:YueHaibing AuthorDate:Tue, 22 Sep 2020 21:24:10 +08:00 Committer: Peter Zijlstra CommitterDate: Fri, 25 Sep 2020 14:23:25 +02:00 sched: Remove unused inline function uclamp_bucket_base_value() There is no caller in tree, so can remove it. Signed-off-by: YueHaibing Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Dietmar Eggemann Link: https://lkml.kernel.org/r/20200922132410.48440-1-yuehaib...@huawei.com --- kernel/sched/core.c | 5 - 1 file changed, 5 deletions(-) diff --git a/kernel/sched/core.c b/kernel/sched/core.c index c36dc1a..dd32d85 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -940,11 +940,6 @@ static inline unsigned int uclamp_bucket_id(unsigned int clamp_value) return clamp_value / UCLAMP_BUCKET_DELTA; } -static inline unsigned int uclamp_bucket_base_value(unsigned int clamp_value) -{ - return UCLAMP_BUCKET_DELTA * uclamp_bucket_id(clamp_value); -} - static inline unsigned int uclamp_none(enum uclamp_id clamp_id) { if (clamp_id == UCLAMP_MIN)
[PATCH -next] sched: Remove unused inline function uclamp_bucket_base_value()
There is no caller in tree, so can remove it. Signed-off-by: YueHaibing --- kernel/sched/core.c | 5 - 1 file changed, 5 deletions(-) diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 2d95dc3f4644..1b06b952dbbe 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -940,11 +940,6 @@ static inline unsigned int uclamp_bucket_id(unsigned int clamp_value) return clamp_value / UCLAMP_BUCKET_DELTA; } -static inline unsigned int uclamp_bucket_base_value(unsigned int clamp_value) -{ - return UCLAMP_BUCKET_DELTA * uclamp_bucket_id(clamp_value); -} - static inline unsigned int uclamp_none(enum uclamp_id clamp_id) { if (clamp_id == UCLAMP_MIN) -- 2.17.1
[PATCH net-next] netfilter: nf_tables_offload: Remove unused macro FLOW_SETUP_BLOCK
commit 9a32669fecfb ("netfilter: nf_tables_offload: support indr block call") left behind this. Signed-off-by: YueHaibing --- net/netfilter/nf_tables_offload.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/net/netfilter/nf_tables_offload.c b/net/netfilter/nf_tables_offload.c index 9ef37c1b7b3b..7c7e06624dc3 100644 --- a/net/netfilter/nf_tables_offload.c +++ b/net/netfilter/nf_tables_offload.c @@ -323,8 +323,6 @@ static int nft_indr_block_offload_cmd(struct nft_base_chain *basechain, return nft_block_setup(basechain, , cmd); } -#define FLOW_SETUP_BLOCK TC_SETUP_BLOCK - static int nft_chain_offload_cmd(struct nft_base_chain *basechain, struct net_device *dev, enum flow_block_command cmd) -- 2.17.1
[PATCH net-next] ipvs: Remove unused macros
They are not used since commit e4ff67513096 ("ipvs: add sync_maxlen parameter for the sync daemon") Signed-off-by: YueHaibing --- net/netfilter/ipvs/ip_vs_sync.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/net/netfilter/ipvs/ip_vs_sync.c b/net/netfilter/ipvs/ip_vs_sync.c index 2b8abbfe018c..16b48064f715 100644 --- a/net/netfilter/ipvs/ip_vs_sync.c +++ b/net/netfilter/ipvs/ip_vs_sync.c @@ -242,9 +242,6 @@ struct ip_vs_sync_thread_data { |IPVS Sync Connection (1) | */ -#define SYNC_MESG_HEADER_LEN 4 -#define MAX_CONNS_PER_SYNCBUFF 255 /* nr_conns in ip_vs_sync_mesg is 8 bit */ - /* Version 0 header */ struct ip_vs_sync_mesg_v0 { __u8nr_conns; -- 2.17.1
[PATCH net-next] tipc: Remove unused macro CF_SERVER
It is no used any more, so can remove it. Signed-off-by: YueHaibing --- net/tipc/topsrv.c | 1 - 1 file changed, 1 deletion(-) diff --git a/net/tipc/topsrv.c b/net/tipc/topsrv.c index 1489cfb941d8..5f6f86051c83 100644 --- a/net/tipc/topsrv.c +++ b/net/tipc/topsrv.c @@ -48,7 +48,6 @@ #define MAX_SEND_MSG_COUNT 25 #define MAX_RECV_MSG_COUNT 25 #define CF_CONNECTED 1 -#define CF_SERVER 2 #define TIPC_SERVER_NAME_LEN 32 -- 2.17.1
[PATCH 2/5] wlcore: Remove unused function no_write_handler()
There is no caller in tree, so can remove it. Signed-off-by: YueHaibing --- drivers/net/wireless/ti/wlcore/debugfs.c | 7 --- 1 file changed, 7 deletions(-) diff --git a/drivers/net/wireless/ti/wlcore/debugfs.c b/drivers/net/wireless/ti/wlcore/debugfs.c index 48adb1876ab9..cce8d75d8b81 100644 --- a/drivers/net/wireless/ti/wlcore/debugfs.c +++ b/drivers/net/wireless/ti/wlcore/debugfs.c @@ -122,13 +122,6 @@ static void chip_op_handler(struct wl1271 *wl, unsigned long value, pm_runtime_put_autosuspend(wl->dev); } - -static inline void no_write_handler(struct wl1271 *wl, - unsigned long value, - unsigned long param) -{ -} - #define WL12XX_CONF_DEBUGFS(param, conf_sub_struct,\ min_val, max_val, write_handler_locked, \ write_handler_arg) \ -- 2.17.1
[PATCH] ath11k: Remove unused function ath11k_htc_restore_tx_skb()
There is no caller in tree, so can remove it. Signed-off-by: YueHaibing --- drivers/net/wireless/ath/ath11k/htc.c | 9 - 1 file changed, 9 deletions(-) diff --git a/drivers/net/wireless/ath/ath11k/htc.c b/drivers/net/wireless/ath/ath11k/htc.c index e9e354fc11fa..4de2350dfbf3 100644 --- a/drivers/net/wireless/ath/ath11k/htc.c +++ b/drivers/net/wireless/ath/ath11k/htc.c @@ -50,15 +50,6 @@ static struct sk_buff *ath11k_htc_build_tx_ctrl_skb(void *ab) return skb; } -static inline void ath11k_htc_restore_tx_skb(struct ath11k_htc *htc, -struct sk_buff *skb) -{ - struct ath11k_skb_cb *skb_cb = ATH11K_SKB_CB(skb); - - dma_unmap_single(htc->ab->dev, skb_cb->paddr, skb->len, DMA_TO_DEVICE); - skb_pull(skb, sizeof(struct ath11k_htc_hdr)); -} - static void ath11k_htc_prepare_tx_skb(struct ath11k_htc_ep *ep, struct sk_buff *skb) { -- 2.17.1
[PATCH -next] arm64: Fix -Wunused-function warning
If CONFIG_HOTPLUG_CPU is n, gcc warns: arch/arm64/kernel/smp.c:967:13: warning: ‘ipi_teardown’ defined but not used [-Wunused-function] static void ipi_teardown(int cpu) ^~~~ Use #ifdef guard this. Signed-off-by: YueHaibing --- arch/arm64/kernel/smp.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/arch/arm64/kernel/smp.c b/arch/arm64/kernel/smp.c index b6bde2675ccc..82e75fc2c903 100644 --- a/arch/arm64/kernel/smp.c +++ b/arch/arm64/kernel/smp.c @@ -82,9 +82,9 @@ static int nr_ipi __read_mostly = NR_IPI; static struct irq_desc *ipi_desc[NR_IPI] __read_mostly; static void ipi_setup(int cpu); -static void ipi_teardown(int cpu); #ifdef CONFIG_HOTPLUG_CPU +static void ipi_teardown(int cpu); static int op_cpu_kill(unsigned int cpu); #else static inline int op_cpu_kill(unsigned int cpu) @@ -964,6 +964,7 @@ static void ipi_setup(int cpu) enable_percpu_irq(ipi_irq_base + i, 0); } +#ifdef CONFIG_HOTPLUG_CPU static void ipi_teardown(int cpu) { int i; @@ -974,6 +975,7 @@ static void ipi_teardown(int cpu) for (i = 0; i < nr_ipi; i++) disable_percpu_irq(ipi_irq_base + i); } +#endif void __init set_smp_ipi_range(int ipi_base, int n) { -- 2.17.1
Re: [PATCH net-next] genetlink: Remove unused function genl_err_attr()
On 2020/9/18 2:34, Cong Wang wrote: > On Wed, Sep 16, 2020 at 9:33 AM YueHaibing wrote: >> >> It is never used, so can remove it. > > This is a bit confusing, it was actually used before, see commit > ab0d76f6823cc3a4e2. Yes,thanks for reminding, will be careful later. > . >
[PATCH v2 net-next] netdev: Remove unused functions
There is no callers in tree, so can remove it. Signed-off-by: YueHaibing Reviewed-by: Saeed Mahameed --- v2: fix title typo 'funtions' --> 'functions' --- include/linux/netdevice.h | 10 -- 1 file changed, 10 deletions(-) diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 157e0242e9ee..909b1fbb0481 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h @@ -4677,16 +4677,6 @@ int netdev_class_create_file_ns(const struct class_attribute *class_attr, void netdev_class_remove_file_ns(const struct class_attribute *class_attr, const void *ns); -static inline int netdev_class_create_file(const struct class_attribute *class_attr) -{ - return netdev_class_create_file_ns(class_attr, NULL); -} - -static inline void netdev_class_remove_file(const struct class_attribute *class_attr) -{ - netdev_class_remove_file_ns(class_attr, NULL); -} - extern const struct kobj_ns_type_operations net_ns_type_operations; const char *netdev_drivername(const struct net_device *dev); -- 2.17.1
[PATCH v2 next] fpga: dfl: n3000-nios: Make m10_n3000_info static
Fix sparse warning: drivers/fpga/dfl-n3000-nios.c:392:23: warning: symbol 'm10_n3000_info' was not declared. Should it be static? Signed-off-by: YueHaibing --- drivers/fpga/dfl-n3000-nios.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/fpga/dfl-n3000-nios.c b/drivers/fpga/dfl-n3000-nios.c index 5088f8f0e0cd..686813b59d33 100644 --- a/drivers/fpga/dfl-n3000-nios.c +++ b/drivers/fpga/dfl-n3000-nios.c @@ -389,7 +389,7 @@ static int n3000_nios_init_done_check(struct n3000_nios *ns) return ret; } -struct spi_board_info m10_n3000_info = { +static struct spi_board_info m10_n3000_info = { .modalias = "m10-n3000", .max_speed_hz = 1250, .bus_num = 0, -- 2.17.1
Re: [PATCH -next] net/sched: Remove unused function qdisc_queue_drop_head()
Pls drop this duplicate. On 2020/9/16 22:16, YueHaibing wrote: > It is not used since commit a09ceb0e0814 ("sched: remove qdisc->drop") > > Signed-off-by: YueHaibing > --- > include/net/sch_generic.h | 6 -- > 1 file changed, 6 deletions(-) > > diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h > index d60e7c39d60c..6c762457122f 100644 > --- a/include/net/sch_generic.h > +++ b/include/net/sch_generic.h > @@ -1047,12 +1047,6 @@ static inline unsigned int > __qdisc_queue_drop_head(struct Qdisc *sch, > return 0; > } > > -static inline unsigned int qdisc_queue_drop_head(struct Qdisc *sch, > - struct sk_buff **to_free) > -{ > - return __qdisc_queue_drop_head(sch, >q, to_free); > -} > - > static inline struct sk_buff *qdisc_peek_head(struct Qdisc *sch) > { > const struct qdisc_skb_head *qh = >q; >
Re: [PATCH -next] fpga: dfl: Make m10_n3000_info static
On 2020/9/17 0:10, Moritz Fischer wrote: > Hi Yue, > > On Wed, Sep 16, 2020 at 10:25:36PM +0800, YueHaibing wrote: >> Fix sparse warning: >> >> drivers/fpga/dfl-n3000-nios.c:392:23: warning: >> symbol 'm10_n3000_info' was not declared. Should it be static? >> >> Signed-off-by: YueHaibing >> --- >> drivers/fpga/dfl-n3000-nios.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/drivers/fpga/dfl-n3000-nios.c b/drivers/fpga/dfl-n3000-nios.c >> index 5088f8f0e0cd..686813b59d33 100644 >> --- a/drivers/fpga/dfl-n3000-nios.c >> +++ b/drivers/fpga/dfl-n3000-nios.c >> @@ -389,7 +389,7 @@ static int n3000_nios_init_done_check(struct n3000_nios >> *ns) >> return ret; >> } >> >> -struct spi_board_info m10_n3000_info = { >> +static struct spi_board_info m10_n3000_info = { >> .modalias = "m10-n3000", >> .max_speed_hz = 1250, >> .bus_num = 0, >> -- >> 2.17.1 >> > Can you resend this with a [PATCH v2] or [PATCH v2 next], neither > lore nor patchwork picks it up in its current form. > > This'll make sure it doesn't get lost. > > While at it could you change the first line to: > > "fpga: dfl: n3000-nios: Make m10_n3000_info static" Sure, will resend. > > Thanks for the patch, > Moritz > . >
[PATCH net-next] net/sched: Remove unused function qdisc_queue_drop_head()
It is not used since commit a09ceb0e0814 ("sched: remove qdisc->drop") Signed-off-by: YueHaibing --- include/net/sch_generic.h | 6 -- 1 file changed, 6 deletions(-) diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h index d60e7c39d60c..6c762457122f 100644 --- a/include/net/sch_generic.h +++ b/include/net/sch_generic.h @@ -1047,12 +1047,6 @@ static inline unsigned int __qdisc_queue_drop_head(struct Qdisc *sch, return 0; } -static inline unsigned int qdisc_queue_drop_head(struct Qdisc *sch, -struct sk_buff **to_free) -{ - return __qdisc_queue_drop_head(sch, >q, to_free); -} - static inline struct sk_buff *qdisc_peek_head(struct Qdisc *sch) { const struct qdisc_skb_head *qh = >q; -- 2.17.1
[PATCH -next] net/sched: Remove unused function qdisc_queue_drop_head()
It is not used since commit a09ceb0e0814 ("sched: remove qdisc->drop") Signed-off-by: YueHaibing --- include/net/sch_generic.h | 6 -- 1 file changed, 6 deletions(-) diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h index d60e7c39d60c..6c762457122f 100644 --- a/include/net/sch_generic.h +++ b/include/net/sch_generic.h @@ -1047,12 +1047,6 @@ static inline unsigned int __qdisc_queue_drop_head(struct Qdisc *sch, return 0; } -static inline unsigned int qdisc_queue_drop_head(struct Qdisc *sch, -struct sk_buff **to_free) -{ - return __qdisc_queue_drop_head(sch, >q, to_free); -} - static inline struct sk_buff *qdisc_peek_head(struct Qdisc *sch) { const struct qdisc_skb_head *qh = >q; -- 2.17.1
[PATCH net-next] netfilter: nf_tables: Remove ununsed function nft_data_debug
It is never used, so can be removed. Signed-off-by: YueHaibing --- include/net/netfilter/nf_tables.h | 7 --- 1 file changed, 7 deletions(-) diff --git a/include/net/netfilter/nf_tables.h b/include/net/netfilter/nf_tables.h index 8ceca0e419b3..c4c526507ddb 100644 --- a/include/net/netfilter/nf_tables.h +++ b/include/net/netfilter/nf_tables.h @@ -148,13 +148,6 @@ static inline void nft_data_copy(u32 *dst, const struct nft_data *src, memcpy(dst, src, len); } -static inline void nft_data_debug(const struct nft_data *data) -{ - pr_debug("data[0]=%x data[1]=%x data[2]=%x data[3]=%x\n", -data->data[0], data->data[1], -data->data[2], data->data[3]); -} - /** * struct nft_ctx - nf_tables rule/set context * -- 2.17.1
[PATCH -next] btrfs: Make btrfs_sysfs_add_fs_devices static
Fix sparse warning: fs/btrfs/sysfs.c:1386:5: warning: symbol 'btrfs_sysfs_add_fs_devices' was not declared. Should it be static? Signed-off-by: YueHaibing --- fs/btrfs/sysfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/btrfs/sysfs.c b/fs/btrfs/sysfs.c index e7b0e10685d9..279d9262b676 100644 --- a/fs/btrfs/sysfs.c +++ b/fs/btrfs/sysfs.c @@ -1383,7 +1383,7 @@ int btrfs_sysfs_add_device(struct btrfs_device *device) return ret; } -int btrfs_sysfs_add_fs_devices(struct btrfs_fs_devices *fs_devices) +static int btrfs_sysfs_add_fs_devices(struct btrfs_fs_devices *fs_devices) { int ret; struct btrfs_device *device; -- 2.17.1
[PATCH -next] fpga: dfl: Make m10_n3000_info static
Fix sparse warning: drivers/fpga/dfl-n3000-nios.c:392:23: warning: symbol 'm10_n3000_info' was not declared. Should it be static? Signed-off-by: YueHaibing --- drivers/fpga/dfl-n3000-nios.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/fpga/dfl-n3000-nios.c b/drivers/fpga/dfl-n3000-nios.c index 5088f8f0e0cd..686813b59d33 100644 --- a/drivers/fpga/dfl-n3000-nios.c +++ b/drivers/fpga/dfl-n3000-nios.c @@ -389,7 +389,7 @@ static int n3000_nios_init_done_check(struct n3000_nios *ns) return ret; } -struct spi_board_info m10_n3000_info = { +static struct spi_board_info m10_n3000_info = { .modalias = "m10-n3000", .max_speed_hz = 1250, .bus_num = 0, -- 2.17.1
[PATCH net-next] genetlink: Remove unused function genl_err_attr()
It is never used, so can remove it. Signed-off-by: YueHaibing --- include/net/genetlink.h | 8 1 file changed, 8 deletions(-) diff --git a/include/net/genetlink.h b/include/net/genetlink.h index 6e5f1e1aa822..b9eb92f3fe86 100644 --- a/include/net/genetlink.h +++ b/include/net/genetlink.h @@ -101,14 +101,6 @@ static inline void genl_info_net_set(struct genl_info *info, struct net *net) #define GENL_SET_ERR_MSG(info, msg) NL_SET_ERR_MSG((info)->extack, msg) -static inline int genl_err_attr(struct genl_info *info, int err, - const struct nlattr *attr) -{ - info->extack->bad_attr = attr; - - return err; -} - enum genl_validate_flags { GENL_DONT_VALIDATE_STRICT = BIT(0), GENL_DONT_VALIDATE_DUMP = BIT(1), -- 2.17.1
[PATCH net-next] netdev: Remove unused funtions
There is no callers in tree, so can remove it. Signed-off-by: YueHaibing --- include/linux/netdevice.h | 10 -- 1 file changed, 10 deletions(-) diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 157e0242e9ee..909b1fbb0481 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h @@ -4677,16 +4677,6 @@ int netdev_class_create_file_ns(const struct class_attribute *class_attr, void netdev_class_remove_file_ns(const struct class_attribute *class_attr, const void *ns); -static inline int netdev_class_create_file(const struct class_attribute *class_attr) -{ - return netdev_class_create_file_ns(class_attr, NULL); -} - -static inline void netdev_class_remove_file(const struct class_attribute *class_attr) -{ - netdev_class_remove_file_ns(class_attr, NULL); -} - extern const struct kobj_ns_type_operations net_ns_type_operations; const char *netdev_drivername(const struct net_device *dev); -- 2.17.1
[PATCH -next] Input: stmfts - Fix a & vs && typo
In stmfts_sysfs_hover_enable_write(), we should check value and sdata->hover_enabled is all true. Fixes: 78bcac7b2ae1 ("Input: add support for the STMicroelectronics FingerTip touchscreen") Signed-off-by: YueHaibing --- drivers/input/touchscreen/stmfts.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/input/touchscreen/stmfts.c b/drivers/input/touchscreen/stmfts.c index df946869d4cd..9a64e1dbc04a 100644 --- a/drivers/input/touchscreen/stmfts.c +++ b/drivers/input/touchscreen/stmfts.c @@ -479,7 +479,7 @@ static ssize_t stmfts_sysfs_hover_enable_write(struct device *dev, mutex_lock(>mutex); - if (value & sdata->hover_enabled) + if (value && sdata->hover_enabled) goto out; if (sdata->running) -- 2.17.1
Re: [PATCH -next] soc: renesas: r8a779a0-sysc: Make r8a779a0_sysc_info static
On 2020/9/15 23:22, Geert Uytterhoeven wrote: > Hi Yue, > > On Tue, Sep 15, 2020 at 4:58 PM YueHaibing wrote: >> Fix sparse warning: >> >> drivers/soc/renesas/r8a779a0-sysc.c:99:33: warning: symbol >> 'r8a779a0_sysc_info' was not declared. Should it be static? >> >> Signed-off-by: YueHaibing > > Thanks for your patch! > > Reviewed-by: Geert Uytterhoeven > > As commit 7f29315cf4211316 ("soc: renesas: r8a779a0-sysc: Add r8a779a0 > support") hasn't been merged into arm-soc yet, is it OK for you if I > just fold your fix into the original commit? Sure, it's ok for me. > > Thanks again! > >> --- a/drivers/soc/renesas/r8a779a0-sysc.c >> +++ b/drivers/soc/renesas/r8a779a0-sysc.c >> @@ -96,7 +96,7 @@ static struct r8a779a0_sysc_area r8a779a0_areas[] >> __initdata = { >> { "a1dsp1", R8A779A0_PD_A1DSP1, R8A779A0_PD_A2CN1 }, >> }; >> >> -const struct r8a779a0_sysc_info r8a779a0_sysc_info __initconst = { >> +static const struct r8a779a0_sysc_info r8a779a0_sysc_info __initconst = { >> .areas = r8a779a0_areas, >> .num_areas = ARRAY_SIZE(r8a779a0_areas), >> }; > > Gr{oetje,eeting}s, > > Geert >
[PATCH -next] soc: renesas: r8a779a0-sysc: Make r8a779a0_sysc_info static
Fix sparse warning: drivers/soc/renesas/r8a779a0-sysc.c:99:33: warning: symbol 'r8a779a0_sysc_info' was not declared. Should it be static? Signed-off-by: YueHaibing --- drivers/soc/renesas/r8a779a0-sysc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/soc/renesas/r8a779a0-sysc.c b/drivers/soc/renesas/r8a779a0-sysc.c index 09dac5742c60..d464ffa1be33 100644 --- a/drivers/soc/renesas/r8a779a0-sysc.c +++ b/drivers/soc/renesas/r8a779a0-sysc.c @@ -96,7 +96,7 @@ static struct r8a779a0_sysc_area r8a779a0_areas[] __initdata = { { "a1dsp1", R8A779A0_PD_A1DSP1, R8A779A0_PD_A2CN1 }, }; -const struct r8a779a0_sysc_info r8a779a0_sysc_info __initconst = { +static const struct r8a779a0_sysc_info r8a779a0_sysc_info __initconst = { .areas = r8a779a0_areas, .num_areas = ARRAY_SIZE(r8a779a0_areas), }; -- 2.17.1
[PATCH -next] clk: imx35: Make mx35_clocks_init static
Fix sparse warning: drivers/clk/imx/clk-imx35.c:251:12: warning: symbol 'mx35_clocks_init' was not declared. Should it be static? Signed-off-by: YueHaibing --- drivers/clk/imx/clk-imx35.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/clk/imx/clk-imx35.c b/drivers/clk/imx/clk-imx35.c index e595f559907f..2594f41d0980 100644 --- a/drivers/clk/imx/clk-imx35.c +++ b/drivers/clk/imx/clk-imx35.c @@ -248,7 +248,7 @@ static void __init _mx35_clocks_init(void) imx_print_silicon_rev("i.MX35", mx35_revision()); } -int __init mx35_clocks_init(void) +static int __init mx35_clocks_init(void) { _mx35_clocks_init(); -- 2.17.1
[PATCH 3/3] clk: imx31: Make mx31_clocks_init static
Fix sparse warning: drivers/clk/imx/clk-imx31.c:135:12: warning: symbol 'mx31_clocks_init' was not declared. Should it be static? Signed-off-by: YueHaibing --- drivers/clk/imx/clk-imx31.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/clk/imx/clk-imx31.c b/drivers/clk/imx/clk-imx31.c index 4bb05e440cdd..c709fe3eec57 100644 --- a/drivers/clk/imx/clk-imx31.c +++ b/drivers/clk/imx/clk-imx31.c @@ -132,7 +132,7 @@ static void __init _mx31_clocks_init(void __iomem *base, unsigned long fref) clk_disable_unprepare(clk[iim_gate]); } -int __init mx31_clocks_init(unsigned long fref) +static int __init mx31_clocks_init(unsigned long fref) { void __iomem *base; -- 2.17.1
[PATCH -next] mm/madvise: remove duplicate include
Remove duplicate header which is included twice. Signed-off-by: YueHaibing --- mm/madvise.c | 1 - 1 file changed, 1 deletion(-) diff --git a/mm/madvise.c b/mm/madvise.c index 460e19d60ba3..9bd21f9019d9 100644 --- a/mm/madvise.c +++ b/mm/madvise.c @@ -30,7 +30,6 @@ #include #include #include -#include #include -- 2.17.1
[PATCH -next] perf metric: Remove duplicate include
Remove duplicate header which is included twice. Signed-off-by: YueHaibing --- tools/perf/tests/parse-metric.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/tools/perf/tests/parse-metric.c b/tools/perf/tests/parse-metric.c index 23db8acc492d..b344decfb91b 100644 --- a/tools/perf/tests/parse-metric.c +++ b/tools/perf/tests/parse-metric.c @@ -11,8 +11,6 @@ #include "debug.h" #include "expr.h" #include "stat.h" -#include -#include static struct pmu_event pme_test[] = { { -- 2.17.1
[PATCH -next] clk: socfpga: agilex: Remove unused variable 'cntr_mux'
drivers/clk/socfpga/clk-agilex.c:24:37: warning: ‘cntr_mux’ defined but not used [-Wunused-const-variable=] static const struct clk_parent_data cntr_mux[] = { ^~~~ There is no caller in tree, so can remove it. Signed-off-by: YueHaibing --- drivers/clk/socfpga/clk-agilex.c | 13 - 1 file changed, 13 deletions(-) diff --git a/drivers/clk/socfpga/clk-agilex.c b/drivers/clk/socfpga/clk-agilex.c index 8fb12cbe0208..bb3e80928ebe 100644 --- a/drivers/clk/socfpga/clk-agilex.c +++ b/drivers/clk/socfpga/clk-agilex.c @@ -21,19 +21,6 @@ static const struct clk_parent_data pll_mux[] = { .name = "f2s-free-clk", }, }; -static const struct clk_parent_data cntr_mux[] = { - { .fw_name = "main_pll", - .name = "main_pll", }, - { .fw_name = "periph_pll", - .name = "periph_pll", }, - { .fw_name = "osc1", - .name = "osc1", }, - { .fw_name = "cb-intosc-hs-div2-clk", - .name = "cb-intosc-hs-div2-clk", }, - { .fw_name = "f2s-free-clk", - .name = "f2s-free-clk", }, -}; - static const struct clk_parent_data boot_mux[] = { { .fw_name = "osc1", .name = "osc1", }, -- 2.17.1
[PATCH -next] agp/uninorth: Make two variable static
Fix sparse warnings: drivers/char/agp/uninorth-agp.c:510:32: warning: symbol 'uninorth_agp_driver' was not declared. Should it be static? drivers/char/agp/uninorth-agp.c:538:32: warning: symbol 'u3_agp_driver' was not declared. Should it be static? Reported-by: Hulk Robot Signed-off-by: YueHaibing --- drivers/char/agp/uninorth-agp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/char/agp/uninorth-agp.c b/drivers/char/agp/uninorth-agp.c index 62de7f4ba864..06db04cdc377 100644 --- a/drivers/char/agp/uninorth-agp.c +++ b/drivers/char/agp/uninorth-agp.c @@ -507,7 +507,7 @@ static const struct aper_size_info_32 u3_sizes[] = {4, 1024, 0, 1} }; -const struct agp_bridge_driver uninorth_agp_driver = { +static const struct agp_bridge_driver uninorth_agp_driver = { .owner = THIS_MODULE, .aperture_sizes = (void *)uninorth_sizes, .size_type = U32_APER_SIZE, @@ -535,7 +535,7 @@ const struct agp_bridge_driver uninorth_agp_driver = { .needs_scratch_page = true, }; -const struct agp_bridge_driver u3_agp_driver = { +static const struct agp_bridge_driver u3_agp_driver = { .owner = THIS_MODULE, .aperture_sizes = (void *)u3_sizes, .size_type = U32_APER_SIZE, -- 2.17.1
[PATCH -next] mfd: mt6360: Remove unused including
Remove including that don't need it. Reported-by: Hulk Robot Signed-off-by: YueHaibing --- drivers/mfd/mt6360-core.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/mfd/mt6360-core.c b/drivers/mfd/mt6360-core.c index e9cacc27d980..4661c1b29a72 100644 --- a/drivers/mfd/mt6360-core.c +++ b/drivers/mfd/mt6360-core.c @@ -13,7 +13,6 @@ #include #include #include -#include #include -- 2.17.1
[PATCH v2 -next] media: marvell-ccic: Fix -Wunused-function warnings
If CONFIG_PM is n, gcc warns: drivers/media/platform/marvell-ccic/mmp-driver.c:324:12: warning: ‘mmpcam_runtime_suspend’ defined but not used [-Wunused-function] static int mmpcam_runtime_suspend(struct device *dev) ^~ drivers/media/platform/marvell-ccic/mmp-driver.c:310:12: warning: ‘mmpcam_runtime_resume’ defined but not used [-Wunused-function] static int mmpcam_runtime_resume(struct device *dev) ^ Mark them as __maybe_unused to fix this. Reported-by: Hulk Robot Signed-off-by: YueHaibing --- v2: Adjust based on https://lore.kernel.org/linux-media/20200909112921.5116-1-weiyongj...@huawei.com/ --- drivers/media/platform/marvell-ccic/mmp-driver.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/platform/marvell-ccic/mmp-driver.c b/drivers/media/platform/marvell-ccic/mmp-driver.c index c4b28a00a3a2..c046a0ff3b85 100644 --- a/drivers/media/platform/marvell-ccic/mmp-driver.c +++ b/drivers/media/platform/marvell-ccic/mmp-driver.c @@ -307,7 +307,7 @@ static int mmpcam_platform_remove(struct platform_device *pdev) * Suspend/resume support. */ -static int mmpcam_runtime_resume(struct device *dev) +static int __maybe_unused mmpcam_runtime_resume(struct device *dev) { struct mmp_camera *cam = dev_get_drvdata(dev); struct mcam_camera *mcam = >mcam; @@ -321,7 +321,7 @@ static int mmpcam_runtime_resume(struct device *dev) return 0; } -static int mmpcam_runtime_suspend(struct device *dev) +static int __maybe_unused mmpcam_runtime_suspend(struct device *dev) { struct mmp_camera *cam = dev_get_drvdata(dev); struct mcam_camera *mcam = >mcam; -- 2.17.1
Re: [PATCH -next] media: marvell-ccic: Fix -Wunused-function warnings
On 2020/9/10 22:57, Lubomir Rintel wrote: > On Thu, Sep 10, 2020 at 05:18:15PM +0800, Yuehaibing wrote: >> On 2020/9/10 16:22, Lubomir Rintel wrote: >>> On Thu, Sep 10, 2020 at 04:09:33PM +0800, YueHaibing wrote: >>>> If CONFIG_PM is n, gcc warns: >>>> >>>> drivers/media/platform/marvell-ccic/mmp-driver.c:347:12: warning: >>>> ‘mmpcam_resume’ defined but not used [-Wunused-function] >>>> static int mmpcam_resume(struct device *dev) >>>> ^ >>>> drivers/media/platform/marvell-ccic/mmp-driver.c:338:12: warning: >>>> ‘mmpcam_suspend’ defined but not used [-Wunused-function] >>>> static int mmpcam_suspend(struct device *dev) >>>> ^~ >>>> drivers/media/platform/marvell-ccic/mmp-driver.c:324:12: warning: >>>> ‘mmpcam_runtime_suspend’ defined but not used [-Wunused-function] >>>> static int mmpcam_runtime_suspend(struct device *dev) >>>> ^~ >>>> drivers/media/platform/marvell-ccic/mmp-driver.c:310:12: warning: >>>> ‘mmpcam_runtime_resume’ defined but not used [-Wunused-function] >>>> static int mmpcam_runtime_resume(struct device *dev) >>>> ^ >>>> >>>> Mark them as __maybe_unused to fix this. >>>> >>>> Reported-by: Hulk Robot >>>> Signed-off-by: YueHaibing >>> >>> Your colleague seems to sent out an equivalent patch: >>> https://lore.kernel.org/lkml/20200910080933.40684-1-yuehaib...@huawei.com/ >> >> This is my patch, paste an wrong link? > > Indeed, sorry for the confusion. > > The original mail only went to linux-media, not lkml, which is why I > picked the wrong one from the archive. Here's the patch: > > https://lore.kernel.org/linux-media/20200909112921.5116-1-weiyongj...@huawei.com/ mmpcam_runtime_suspend/mmpcam_runtime_resume also should be cared, I'll adjust my patch based on it. > > Take care > Lubo > >> >>> >>> Cheers >>> Lubo >>> >>>> --- >>>> drivers/media/platform/marvell-ccic/mmp-driver.c | 8 >>>> 1 file changed, 4 insertions(+), 4 deletions(-) >>>> >>>> diff --git a/drivers/media/platform/marvell-ccic/mmp-driver.c >>>> b/drivers/media/platform/marvell-ccic/mmp-driver.c >>>> index c4b28a00a3a2..032fdddbbecc 100644 >>>> --- a/drivers/media/platform/marvell-ccic/mmp-driver.c >>>> +++ b/drivers/media/platform/marvell-ccic/mmp-driver.c >>>> @@ -307,7 +307,7 @@ static int mmpcam_platform_remove(struct >>>> platform_device *pdev) >>>> * Suspend/resume support. >>>> */ >>>> >>>> -static int mmpcam_runtime_resume(struct device *dev) >>>> +static int __maybe_unused mmpcam_runtime_resume(struct device *dev) >>>> { >>>>struct mmp_camera *cam = dev_get_drvdata(dev); >>>>struct mcam_camera *mcam = >mcam; >>>> @@ -321,7 +321,7 @@ static int mmpcam_runtime_resume(struct device *dev) >>>>return 0; >>>> } >>>> >>>> -static int mmpcam_runtime_suspend(struct device *dev) >>>> +static int __maybe_unused mmpcam_runtime_suspend(struct device *dev) >>>> { >>>>struct mmp_camera *cam = dev_get_drvdata(dev); >>>>struct mcam_camera *mcam = >mcam; >>>> @@ -335,7 +335,7 @@ static int mmpcam_runtime_suspend(struct device *dev) >>>>return 0; >>>> } >>>> >>>> -static int mmpcam_suspend(struct device *dev) >>>> +static int __maybe_unused mmpcam_suspend(struct device *dev) >>>> { >>>>struct mmp_camera *cam = dev_get_drvdata(dev); >>>> >>>> @@ -344,7 +344,7 @@ static int mmpcam_suspend(struct device *dev) >>>>return 0; >>>> } >>>> >>>> -static int mmpcam_resume(struct device *dev) >>>> +static int __maybe_unused mmpcam_resume(struct device *dev) >>>> { >>>>struct mmp_camera *cam = dev_get_drvdata(dev); >>>> >>>> -- >>>> 2.17.1 >>>> >>>> >>> >>> . >>> >> > > . >
Re: [PATCH -next] media: marvell-ccic: Fix -Wunused-function warnings
On 2020/9/10 16:22, Lubomir Rintel wrote: > On Thu, Sep 10, 2020 at 04:09:33PM +0800, YueHaibing wrote: >> If CONFIG_PM is n, gcc warns: >> >> drivers/media/platform/marvell-ccic/mmp-driver.c:347:12: warning: >> ‘mmpcam_resume’ defined but not used [-Wunused-function] >> static int mmpcam_resume(struct device *dev) >> ^ >> drivers/media/platform/marvell-ccic/mmp-driver.c:338:12: warning: >> ‘mmpcam_suspend’ defined but not used [-Wunused-function] >> static int mmpcam_suspend(struct device *dev) >> ^~ >> drivers/media/platform/marvell-ccic/mmp-driver.c:324:12: warning: >> ‘mmpcam_runtime_suspend’ defined but not used [-Wunused-function] >> static int mmpcam_runtime_suspend(struct device *dev) >> ^~ >> drivers/media/platform/marvell-ccic/mmp-driver.c:310:12: warning: >> ‘mmpcam_runtime_resume’ defined but not used [-Wunused-function] >> static int mmpcam_runtime_resume(struct device *dev) >> ^~~~~ >> >> Mark them as __maybe_unused to fix this. >> >> Reported-by: Hulk Robot >> Signed-off-by: YueHaibing > > Your colleague seems to sent out an equivalent patch: > https://lore.kernel.org/lkml/20200910080933.40684-1-yuehaib...@huawei.com/ This is my patch, paste an wrong link? > > Cheers > Lubo > >> --- >> drivers/media/platform/marvell-ccic/mmp-driver.c | 8 >> 1 file changed, 4 insertions(+), 4 deletions(-) >> >> diff --git a/drivers/media/platform/marvell-ccic/mmp-driver.c >> b/drivers/media/platform/marvell-ccic/mmp-driver.c >> index c4b28a00a3a2..032fdddbbecc 100644 >> --- a/drivers/media/platform/marvell-ccic/mmp-driver.c >> +++ b/drivers/media/platform/marvell-ccic/mmp-driver.c >> @@ -307,7 +307,7 @@ static int mmpcam_platform_remove(struct platform_device >> *pdev) >> * Suspend/resume support. >> */ >> >> -static int mmpcam_runtime_resume(struct device *dev) >> +static int __maybe_unused mmpcam_runtime_resume(struct device *dev) >> { >> struct mmp_camera *cam = dev_get_drvdata(dev); >> struct mcam_camera *mcam = >mcam; >> @@ -321,7 +321,7 @@ static int mmpcam_runtime_resume(struct device *dev) >> return 0; >> } >> >> -static int mmpcam_runtime_suspend(struct device *dev) >> +static int __maybe_unused mmpcam_runtime_suspend(struct device *dev) >> { >> struct mmp_camera *cam = dev_get_drvdata(dev); >> struct mcam_camera *mcam = >mcam; >> @@ -335,7 +335,7 @@ static int mmpcam_runtime_suspend(struct device *dev) >> return 0; >> } >> >> -static int mmpcam_suspend(struct device *dev) >> +static int __maybe_unused mmpcam_suspend(struct device *dev) >> { >> struct mmp_camera *cam = dev_get_drvdata(dev); >> >> @@ -344,7 +344,7 @@ static int mmpcam_suspend(struct device *dev) >> return 0; >> } >> >> -static int mmpcam_resume(struct device *dev) >> +static int __maybe_unused mmpcam_resume(struct device *dev) >> { >> struct mmp_camera *cam = dev_get_drvdata(dev); >> >> -- >> 2.17.1 >> >> > > . >
[PATCH -next] media: marvell-ccic: Fix -Wunused-function warnings
If CONFIG_PM is n, gcc warns: drivers/media/platform/marvell-ccic/mmp-driver.c:347:12: warning: ‘mmpcam_resume’ defined but not used [-Wunused-function] static int mmpcam_resume(struct device *dev) ^ drivers/media/platform/marvell-ccic/mmp-driver.c:338:12: warning: ‘mmpcam_suspend’ defined but not used [-Wunused-function] static int mmpcam_suspend(struct device *dev) ^~ drivers/media/platform/marvell-ccic/mmp-driver.c:324:12: warning: ‘mmpcam_runtime_suspend’ defined but not used [-Wunused-function] static int mmpcam_runtime_suspend(struct device *dev) ^~ drivers/media/platform/marvell-ccic/mmp-driver.c:310:12: warning: ‘mmpcam_runtime_resume’ defined but not used [-Wunused-function] static int mmpcam_runtime_resume(struct device *dev) ^ Mark them as __maybe_unused to fix this. Reported-by: Hulk Robot Signed-off-by: YueHaibing --- drivers/media/platform/marvell-ccic/mmp-driver.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/marvell-ccic/mmp-driver.c b/drivers/media/platform/marvell-ccic/mmp-driver.c index c4b28a00a3a2..032fdddbbecc 100644 --- a/drivers/media/platform/marvell-ccic/mmp-driver.c +++ b/drivers/media/platform/marvell-ccic/mmp-driver.c @@ -307,7 +307,7 @@ static int mmpcam_platform_remove(struct platform_device *pdev) * Suspend/resume support. */ -static int mmpcam_runtime_resume(struct device *dev) +static int __maybe_unused mmpcam_runtime_resume(struct device *dev) { struct mmp_camera *cam = dev_get_drvdata(dev); struct mcam_camera *mcam = >mcam; @@ -321,7 +321,7 @@ static int mmpcam_runtime_resume(struct device *dev) return 0; } -static int mmpcam_runtime_suspend(struct device *dev) +static int __maybe_unused mmpcam_runtime_suspend(struct device *dev) { struct mmp_camera *cam = dev_get_drvdata(dev); struct mcam_camera *mcam = >mcam; @@ -335,7 +335,7 @@ static int mmpcam_runtime_suspend(struct device *dev) return 0; } -static int mmpcam_suspend(struct device *dev) +static int __maybe_unused mmpcam_suspend(struct device *dev) { struct mmp_camera *cam = dev_get_drvdata(dev); @@ -344,7 +344,7 @@ static int mmpcam_suspend(struct device *dev) return 0; } -static int mmpcam_resume(struct device *dev) +static int __maybe_unused mmpcam_resume(struct device *dev) { struct mmp_camera *cam = dev_get_drvdata(dev); -- 2.17.1
Re: [PATCH -next] drm/rockchip: cdn-dp: Mark cdn_dp_core_suspend/resume __maybe_unused
ping... On 2020/8/11 10:12, YueHaibing wrote: > If CONFIG_PM is not set, gcc warns: > > drivers/gpu/drm/rockchip/cdn-dp-core.c:1124:12: > warning: ‘cdn_dp_resume’ defined but not used [-Wunused-function] > > Mark them __maybe_unused to fix this. > > Reported-by: Hulk Robot > Signed-off-by: YueHaibing > --- > drivers/gpu/drm/rockchip/cdn-dp-core.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/gpu/drm/rockchip/cdn-dp-core.c > b/drivers/gpu/drm/rockchip/cdn-dp-core.c > index a4a45daf93f2..413b0e90f10f 100644 > --- a/drivers/gpu/drm/rockchip/cdn-dp-core.c > +++ b/drivers/gpu/drm/rockchip/cdn-dp-core.c > @@ -1107,7 +1107,7 @@ static const struct component_ops cdn_dp_component_ops > = { > .unbind = cdn_dp_unbind, > }; > > -static int cdn_dp_suspend(struct device *dev) > +static __maybe_unused int cdn_dp_suspend(struct device *dev) > { > struct cdn_dp_device *dp = dev_get_drvdata(dev); > int ret = 0; > @@ -1121,7 +1121,7 @@ static int cdn_dp_suspend(struct device *dev) > return ret; > } > > -static int cdn_dp_resume(struct device *dev) > +static __maybe_unused int cdn_dp_resume(struct device *dev) > { > struct cdn_dp_device *dp = dev_get_drvdata(dev); > >
[PATCH v2 -next] drm/amdkfd: Fix -Wunused-const-variable warning
If KFD_SUPPORT_IOMMU_V2 is not set, gcc warns: drivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_device.c:121:37: warning: ‘raven_device_info’ defined but not used [-Wunused-const-variable=] static const struct kfd_device_info raven_device_info = { ^ As Huang Rui suggested, Raven already has the fallback path, so it should be out of IOMMU v2 flag. Suggested-by: Huang Rui Signed-off-by: YueHaibing --- drivers/gpu/drm/amd/amdkfd/kfd_device.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_device.c b/drivers/gpu/drm/amd/amdkfd/kfd_device.c index 0e71a0543f98..e3fc6ed7b79c 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_device.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_device.c @@ -503,8 +503,8 @@ static const struct kfd_device_info *kfd_supported_devices[][2] = { #ifdef KFD_SUPPORT_IOMMU_V2 [CHIP_KAVERI] = {_device_info, NULL}, [CHIP_CARRIZO] = {_device_info, NULL}, - [CHIP_RAVEN] = {_device_info, NULL}, #endif + [CHIP_RAVEN] = {_device_info, NULL}, [CHIP_HAWAII] = {_device_info, NULL}, [CHIP_TONGA] = {_device_info, NULL}, [CHIP_FIJI] = {_device_info, _vf_device_info}, -- 2.17.1
[PATCH -next] soundwire: intel: Fix -Wunused-function warning
If CONFIG_PM is not set, build warns: drivers/soundwire/intel.c:488:12: warning: 'intel_link_power_down' defined but not used [-Wunused-function] Mark the functions __maybe_unused and remove the CONFIG_PM dependency. Signed-off-by: YueHaibing --- drivers/soundwire/intel.c | 12 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/soundwire/intel.c b/drivers/soundwire/intel.c index e047910d73f5..48ae8800594a 100644 --- a/drivers/soundwire/intel.c +++ b/drivers/soundwire/intel.c @@ -400,7 +400,7 @@ static void intel_shim_glue_to_master_ip(struct sdw_intel *sdw) } /* this needs to be called with shim_lock */ -static void intel_shim_master_ip_to_glue(struct sdw_intel *sdw) +static void __maybe_unused intel_shim_master_ip_to_glue(struct sdw_intel *sdw) { unsigned int link_id = sdw->instance; void __iomem *shim = sdw->link_res->shim; @@ -485,7 +485,7 @@ static void intel_shim_wake(struct sdw_intel *sdw, bool wake_enable) mutex_unlock(sdw->link_res->shim_lock); } -static int intel_link_power_down(struct sdw_intel *sdw) +static int __maybe_unused intel_link_power_down(struct sdw_intel *sdw) { u32 link_control, spa_mask, cpa_mask; unsigned int link_id = sdw->instance; @@ -1540,8 +1540,6 @@ int intel_master_process_wakeen_event(struct platform_device *pdev) * PM calls */ -#ifdef CONFIG_PM - static int __maybe_unused intel_suspend(struct device *dev) { struct sdw_cdns *cdns = dev_get_drvdata(dev); @@ -1596,7 +1594,7 @@ static int __maybe_unused intel_suspend(struct device *dev) return 0; } -static int intel_suspend_runtime(struct device *dev) +static int __maybe_unused intel_suspend_runtime(struct device *dev) { struct sdw_cdns *cdns = dev_get_drvdata(dev); struct sdw_intel *sdw = cdns_to_intel(cdns); @@ -1751,7 +1749,7 @@ static int __maybe_unused intel_resume(struct device *dev) return ret; } -static int intel_resume_runtime(struct device *dev) +static int __maybe_unused intel_resume_runtime(struct device *dev) { struct sdw_cdns *cdns = dev_get_drvdata(dev); struct sdw_intel *sdw = cdns_to_intel(cdns); @@ -1924,8 +1922,6 @@ static int intel_resume_runtime(struct device *dev) return ret; } -#endif - static const struct dev_pm_ops intel_pm = { SET_SYSTEM_SLEEP_PM_OPS(intel_suspend, intel_resume) SET_RUNTIME_PM_OPS(intel_suspend_runtime, intel_resume_runtime, NULL) -- 2.17.1
[PATCH -next] staging: regulator: hi6421v600-regulator: Remove unused including
Remove including that don't need it. Reported-by: Hulk Robot Signed-off-by: YueHaibing --- drivers/staging/hikey9xx/hi6421v600-regulator.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/staging/hikey9xx/hi6421v600-regulator.c b/drivers/staging/hikey9xx/hi6421v600-regulator.c index 82635ff54a74..614b03c9ddfb 100644 --- a/drivers/staging/hikey9xx/hi6421v600-regulator.c +++ b/drivers/staging/hikey9xx/hi6421v600-regulator.c @@ -36,7 +36,6 @@ #include #include #include -#include #define rdev_dbg(rdev, fmt, arg...)\ pr_debug("%s: %s: " fmt, (rdev)->desc->name, __func__, ##arg) -- 2.17.1
[PATCH] brcmsmac: phytbl_lcn: Remove unused variable 'dot11lcn_gain_tbl_rev1'
drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy/phytbl_lcn.c:108:18: warning: ‘dot11lcn_gain_tbl_rev1’ defined but not used [-Wunused-const-variable=] static const u32 dot11lcn_gain_tbl_rev1[] = { ^~ commit ebcfc66f56a4 ("brcmsmac: phytbl_lcn: Remove unused array 'dot11lcnphytbl_rx_gain_info_rev1'") left behind this, remove it. Reported-by: Hulk Robot Signed-off-by: YueHaibing --- .../brcm80211/brcmsmac/phy/phytbl_lcn.c | 99 --- 1 file changed, 99 deletions(-) diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy/phytbl_lcn.c b/drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy/phytbl_lcn.c index 7526aa441de1..5331b5468e14 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy/phytbl_lcn.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy/phytbl_lcn.c @@ -105,105 +105,6 @@ static const u32 dot11lcn_gain_tbl_rev0[] = { 0x, }; -static const u32 dot11lcn_gain_tbl_rev1[] = { - 0x, - 0x, - 0x, - 0x, - 0x, - 0x, - 0x, - 0x, - 0x0008, - 0x0004, - 0x0008, - 0x0001, - 0x0005, - 0x0009, - 0x000D, - 0x0011, - 0x0051, - 0x0091, - 0x0011, - 0x0051, - 0x0091, - 0x00d1, - 0x0053, - 0x0093, - 0x00d3, - 0x00d7, - 0x0117, - 0x0517, - 0x0917, - 0x0957, - 0x0d57, - 0x1157, - 0x1197, - 0x5197, - 0x9197, - 0xd197, - 0x00011197, - 0x, - 0x, - 0x, - 0x, - 0x, - 0x, - 0x0008, - 0x0004, - 0x0008, - 0x0001, - 0x0005, - 0x0009, - 0x000D, - 0x0011, - 0x0051, - 0x0091, - 0x0011, - 0x0051, - 0x0091, - 0x00d1, - 0x0053, - 0x0093, - 0x00d3, - 0x00d7, - 0x0117, - 0x0517, - 0x0917, - 0x0957, - 0x0d57, - 0x1157, - 0x5157, - 0x9157, - 0xd157, - 0x00011157, - 0x00015157, - 0x00019157, - 0x0001d157, - 0x, - 0x, - 0x, - 0x, - 0x, - 0x, - 0x, - 0x, - 0x, - 0x, - 0x, - 0x, - 0x, - 0x, - 0x, - 0x, - 0x, - 0x, - 0x, - 0x, - 0x, - 0x, -}; - static const u16 dot11lcn_aux_gain_idx_tbl_rev0[] = { 0x0401, 0x0402, -- 2.17.1
[PATCH] brcmsmac: phy_lcn: Remove unused variable lcnphy_rx_iqcomp_table_rev0
drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy/phy_lcn.c:361:25: warning: ‘lcnphy_rx_iqcomp_table_rev0’ defined but not used [-Wunused-const-variable=] struct lcnphy_rx_iqcomp lcnphy_rx_iqcomp_table_rev0[] = { ^~~ commit 38c95e0258a0 ("brcmsmac: phy_lcn: Remove a bunch of unused variables") left behind this, remove it. Reported-by: Hulk Robot Signed-off-by: YueHaibing --- .../broadcom/brcm80211/brcmsmac/phy/phy_lcn.c | 55 --- 1 file changed, 55 deletions(-) diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy/phy_lcn.c b/drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy/phy_lcn.c index b8193c99e864..7071b63042cd 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy/phy_lcn.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy/phy_lcn.c @@ -357,61 +357,6 @@ u16 rxiq_cal_rf_reg[11] = { RADIO_2064_REG12A, }; -static const -struct lcnphy_rx_iqcomp lcnphy_rx_iqcomp_table_rev0[] = { - {1, 0, 0}, - {2, 0, 0}, - {3, 0, 0}, - {4, 0, 0}, - {5, 0, 0}, - {6, 0, 0}, - {7, 0, 0}, - {8, 0, 0}, - {9, 0, 0}, - {10, 0, 0}, - {11, 0, 0}, - {12, 0, 0}, - {13, 0, 0}, - {14, 0, 0}, - {34, 0, 0}, - {38, 0, 0}, - {42, 0, 0}, - {46, 0, 0}, - {36, 0, 0}, - {40, 0, 0}, - {44, 0, 0}, - {48, 0, 0}, - {52, 0, 0}, - {56, 0, 0}, - {60, 0, 0}, - {64, 0, 0}, - {100, 0, 0}, - {104, 0, 0}, - {108, 0, 0}, - {112, 0, 0}, - {116, 0, 0}, - {120, 0, 0}, - {124, 0, 0}, - {128, 0, 0}, - {132, 0, 0}, - {136, 0, 0}, - {140, 0, 0}, - {149, 0, 0}, - {153, 0, 0}, - {157, 0, 0}, - {161, 0, 0}, - {165, 0, 0}, - {184, 0, 0}, - {188, 0, 0}, - {192, 0, 0}, - {196, 0, 0}, - {200, 0, 0}, - {204, 0, 0}, - {208, 0, 0}, - {212, 0, 0}, - {216, 0, 0}, -}; - static const u32 lcnphy_23bitgaincode_table[] = { 0x200100, 0x200200, -- 2.17.1
[PATCH -next] riscv/mm/fault: Fix old style declaration warning
Fix gcc build warning: arch/riscv/mm/fault.c:81:1: warning: ‘inline’ is not at beginning of declaration [-Wold-style-declaration] static void inline vmalloc_fault(struct pt_regs *regs, int code, unsigned long addr) ^~ Reported-by: Hulk Robot Signed-off-by: YueHaibing --- arch/riscv/mm/fault.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/riscv/mm/fault.c b/arch/riscv/mm/fault.c index a23eaf5ce95c..a173432ccf82 100644 --- a/arch/riscv/mm/fault.c +++ b/arch/riscv/mm/fault.c @@ -78,7 +78,7 @@ static inline void bad_area(struct pt_regs *regs, struct mm_struct *mm, int code no_context(regs, addr); } -static void inline vmalloc_fault(struct pt_regs *regs, int code, unsigned long addr) +static inline void vmalloc_fault(struct pt_regs *regs, int code, unsigned long addr) { pgd_t *pgd, *pgd_k; pud_t *pud, *pud_k; -- 2.17.1