[PATCH -next v2] tools/testing/nvdimm: Make symbol '__nfit_test_ioremap' static
The sparse tool complains as follows: tools/testing/nvdimm/test/iomap.c:65:14: warning: symbol '__nfit_test_ioremap' was not declared. Should it be static? This symbol is not used outside of iomap.c, so this commit marks it static. Reported-by: Hulk Robot Signed-off-by: Zou Wei --- tools/testing/nvdimm/test/iomap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/nvdimm/test/iomap.c b/tools/testing/nvdimm/test/iomap.c index c62d372..ed563bd 100644 --- a/tools/testing/nvdimm/test/iomap.c +++ b/tools/testing/nvdimm/test/iomap.c @@ -62,7 +62,7 @@ struct nfit_test_resource *get_nfit_res(resource_size_t resource) } EXPORT_SYMBOL(get_nfit_res); -void __iomem *__nfit_test_ioremap(resource_size_t offset, unsigned long size, +static void __iomem *__nfit_test_ioremap(resource_size_t offset, unsigned long size, void __iomem *(*fallback_fn)(resource_size_t, unsigned long)) { struct nfit_test_resource *nfit_res = get_nfit_res(offset); -- 2.6.2
[PATCH -next] tools/testing/nvdimm: Make symbol '__nfit_test_ioremap' static
The sparse tool complains as follows: tools/testing/nvdimm/test/iomap.c:65:14: warning: symbol '__nfit_test_ioremap' was not declared. Should it be static? This symbol is not used outside of security.c, so this commit marks it static. Reported-by: Hulk Robot Signed-off-by: Zou Wei --- tools/testing/nvdimm/test/iomap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/nvdimm/test/iomap.c b/tools/testing/nvdimm/test/iomap.c index c62d372..ed563bd 100644 --- a/tools/testing/nvdimm/test/iomap.c +++ b/tools/testing/nvdimm/test/iomap.c @@ -62,7 +62,7 @@ struct nfit_test_resource *get_nfit_res(resource_size_t resource) } EXPORT_SYMBOL(get_nfit_res); -void __iomem *__nfit_test_ioremap(resource_size_t offset, unsigned long size, +static void __iomem *__nfit_test_ioremap(resource_size_t offset, unsigned long size, void __iomem *(*fallback_fn)(resource_size_t, unsigned long)) { struct nfit_test_resource *nfit_res = get_nfit_res(offset); -- 2.6.2
[PATCH -next] agp: uninorth: Make some symbols static
The sparse tool complains as follows: 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? This symbol is not used outside of uninorth-agp.c, so this commit marks it static. Reported-by: Hulk Robot Signed-off-by: Zou Wei --- 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 62de7f4..06db04c 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.6.2
[PATCH -next] misc: sgi-xp: xp_main: make some symbols static
The sparse tool complains as follows: drivers/misc/sgi-xp/xp_main.c:24:22: warning: symbol 'xp_dbg_name' was not declared. Should it be static? drivers/misc/sgi-xp/xp_main.c:28:15: warning: symbol 'xp_dbg_subname' was not declared. Should it be static? These symbols are not used outside of xp_main.c, so this commit marks them static. Reported-by: Hulk Robot Signed-off-by: Zou Wei --- drivers/misc/sgi-xp/xp_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/misc/sgi-xp/xp_main.c b/drivers/misc/sgi-xp/xp_main.c index cf2965aa5c05..87d156c15f35 100644 --- a/drivers/misc/sgi-xp/xp_main.c +++ b/drivers/misc/sgi-xp/xp_main.c @@ -21,11 +21,11 @@ /* define the XP debug device structures to be used with dev_dbg() et al */ -struct device_driver xp_dbg_name = { +static struct device_driver xp_dbg_name = { .name = "xp" }; -struct device xp_dbg_subname = { +static struct device xp_dbg_subname = { .init_name = "",/* set to "" */ .driver = _dbg_name }; -- 2.17.1
[PATCH -next] mtd: rawnand: rockchip: Use flexible-array member instead of zero-length array
Suppresses the following coccinelle warning: drivers/mtd/nand/raw/rockchip-nand-controller.c:162:4-8: WARNING use flexible-array member instead Signed-off-by: Zou Wei --- drivers/mtd/nand/raw/rockchip-nand-controller.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mtd/nand/raw/rockchip-nand-controller.c b/drivers/mtd/nand/raw/rockchip-nand-controller.c index 796b678cb108..b5405bc7ca3a 100644 --- a/drivers/mtd/nand/raw/rockchip-nand-controller.c +++ b/drivers/mtd/nand/raw/rockchip-nand-controller.c @@ -159,7 +159,7 @@ struct rk_nfc_nand_chip { u32 timing; u8 nsels; - u8 sels[0]; + u8 sels[]; /* Nothing after this field. */ }; -- 2.17.1
[PATCH -next] drm/vmwgfx/vmwgfx_validation: Use flexible-array member instead of zero-length array
Suppresses the following coccinelle warning: drivers/gpu/drm/vmwgfx/vmwgfx_validation.c:85:15-22: WARNING use flexible-array member instead Signed-off-by: Zou Wei --- drivers/gpu/drm/vmwgfx/vmwgfx_validation.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_validation.c b/drivers/gpu/drm/vmwgfx/vmwgfx_validation.c index e7570f422400..f4837130d67b 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_validation.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_validation.c @@ -82,7 +82,7 @@ struct vmw_validation_res_node { u32 reserved : 1; u32 dirty : 1; u32 dirty_set : 1; - unsigned long private[0]; + unsigned long private[]; }; /** -- 2.17.1
[PATCH -next] coresight: etm-perf: Mark format_attr_contextid with static keyword
Fix the following sparse warning: drivers/hwtracing/coresight/coresight-etm-perf.c:61:25: warning: symbol 'format_attr_contextid' was not declared. Should it be static? Signed-off-by: Zou Wei --- drivers/hwtracing/coresight/coresight-etm-perf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/hwtracing/coresight/coresight-etm-perf.c b/drivers/hwtracing/coresight/coresight-etm-perf.c index 0f603b4094f2..bdbb77334329 100644 --- a/drivers/hwtracing/coresight/coresight-etm-perf.c +++ b/drivers/hwtracing/coresight/coresight-etm-perf.c @@ -58,7 +58,7 @@ static ssize_t format_attr_contextid_show(struct device *dev, return sprintf(page, "config:%d\n", pid_fmt); } -struct device_attribute format_attr_contextid = +static struct device_attribute format_attr_contextid = __ATTR(contextid, 0444, format_attr_contextid_show, NULL); static struct attribute *etm_config_formats_attr[] = { -- 2.17.1
[PATCH -next] drm/nouveau/core/client: Mark nvkm_uclient_sclass with static keyword
Fix the following sparse warning: drivers/gpu/drm/nouveau/nvkm/core/client.c:64:1: warning: symbol 'nvkm_uclient_sclass' was not declared. Should it be static? Signed-off-by: Zou Wei --- drivers/gpu/drm/nouveau/nvkm/core/client.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/nouveau/nvkm/core/client.c b/drivers/gpu/drm/nouveau/nvkm/core/client.c index ac671202919e..0c8c55c73b12 100644 --- a/drivers/gpu/drm/nouveau/nvkm/core/client.c +++ b/drivers/gpu/drm/nouveau/nvkm/core/client.c @@ -60,7 +60,7 @@ nvkm_uclient_new(const struct nvkm_oclass *oclass, void *argv, u32 argc, return 0; } -const struct nvkm_sclass +static const struct nvkm_sclass nvkm_uclient_sclass = { .oclass = NVIF_CLASS_CLIENT, .minver = 0, -- 2.17.1
[PATCH -next] drm: Markdrm_send_event_helper with static keyword
Fix the following sparse warning: drivers/gpu/drm/drm_file.c:789:6: warning: symbol 'drm_send_event_helper' was not declared. Should it be static? Signed-off-by: Zou Wei --- drivers/gpu/drm/drm_file.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/drm_file.c b/drivers/gpu/drm/drm_file.c index 7efbccffc2ea..def5df9f19e3 100644 --- a/drivers/gpu/drm/drm_file.c +++ b/drivers/gpu/drm/drm_file.c @@ -786,8 +786,8 @@ EXPORT_SYMBOL(drm_event_cancel_free); * The timestamp variant of dma_fence_signal is used when the caller * sends a valid timestamp. */ -void drm_send_event_helper(struct drm_device *dev, - struct drm_pending_event *e, ktime_t timestamp) +static void drm_send_event_helper(struct drm_device *dev, + struct drm_pending_event *e, ktime_t timestamp) { assert_spin_locked(>event_lock); -- 2.17.1
[PATCH -next] soc / drm: mediatek: Mark mtk_mutex_driver with static keyword
Fix the following sparse warning: drivers/soc/mediatek/mtk-mutex.c:464:24: warning: symbol 'mtk_mutex_driver' was not declared. Should it be static? Signed-off-by: Zou Wei --- drivers/soc/mediatek/mtk-mutex.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/soc/mediatek/mtk-mutex.c b/drivers/soc/mediatek/mtk-mutex.c index f531b11..3a315a6 100644 --- a/drivers/soc/mediatek/mtk-mutex.c +++ b/drivers/soc/mediatek/mtk-mutex.c @@ -461,7 +461,7 @@ static const struct of_device_id mutex_driver_dt_match[] = { }; MODULE_DEVICE_TABLE(of, mutex_driver_dt_match); -struct platform_driver mtk_mutex_driver = { +static struct platform_driver mtk_mutex_driver = { .probe = mtk_mutex_probe, .remove = mtk_mutex_remove, .driver = { -- 2.6.2
[PATCH -next] ACPI: tables: Mark acpi_init_fpdt with static keyword
Fix the following sparse warning: drivers/acpi/acpi_fpdt.c:230:6: warning: symbol 'acpi_init_fpdt' was not declared. Should it be static? Signed-off-by: Zou Wei --- drivers/acpi/acpi_fpdt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/acpi/acpi_fpdt.c b/drivers/acpi/acpi_fpdt.c index b810811..968f9cc 100644 --- a/drivers/acpi/acpi_fpdt.c +++ b/drivers/acpi/acpi_fpdt.c @@ -227,7 +227,7 @@ static int fpdt_process_subtable(u64 address, u32 subtable_type) return 0; } -void acpi_init_fpdt(void) +static void acpi_init_fpdt(void) { acpi_status status; struct acpi_table_header *header; -- 2.6.2
[PATCH -next] usb: core: Remove unused including
Fix the following versioncheck warning: drivers/usb/core/hcd.c:14:1: unused including Reported-by: Hulk Robot Signed-off-by: Zou Wei --- drivers/usb/core/hcd.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c index 3f03813..53bc93d 100644 --- a/drivers/usb/core/hcd.c +++ b/drivers/usb/core/hcd.c @@ -11,7 +11,6 @@ #include #include -#include #include #include #include -- 2.6.2
[PATCH -next] usb: gadget: Remove unused including
Fix the following versioncheck warning: drivers/usb/gadget/udc/aspeed-vhub/hub.c:33:1: unused including Reported-by: Hulk Robot Signed-off-by: Zou Wei --- drivers/usb/gadget/udc/aspeed-vhub/hub.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/usb/gadget/udc/aspeed-vhub/hub.c b/drivers/usb/gadget/udc/aspeed-vhub/hub.c index 396a7d8..b192d57 100644 --- a/drivers/usb/gadget/udc/aspeed-vhub/hub.c +++ b/drivers/usb/gadget/udc/aspeed-vhub/hub.c @@ -30,7 +30,6 @@ #include #include #include -#include #include #include -- 2.6.2
[PATCH -next] kernel/sys.c: Remove unused including
Fix the following versioncheck warning: kernel/sys.c:42:1: unused including Reported-by: Hulk Robot Signed-off-by: Zou Wei --- kernel/sys.c | 1 - 1 file changed, 1 deletion(-) diff --git a/kernel/sys.c b/kernel/sys.c index e6fd8b8..8ecd3c5 100644 --- a/kernel/sys.c +++ b/kernel/sys.c @@ -39,7 +39,6 @@ #include #include #include -#include #include #include -- 2.6.2
[PATCH -next] net/mlx5: Remove unused including
Fix the following versioncheck warning: drivers/net/ethernet/mellanox/mlx5/core/main.c:53:1: unused including Reported-by: Hulk Robot Signed-off-by: Zou Wei --- drivers/net/ethernet/mellanox/mlx5/core/main.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/main.c b/drivers/net/ethernet/mellanox/mlx5/core/main.c index 5c52021..50999da 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/main.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/main.c @@ -50,7 +50,6 @@ #ifdef CONFIG_RFS_ACCEL #include #endif -#include #include #include "mlx5_core.h" #include "lib/eq.h" -- 2.6.2
[PATCH -next] scsi: gdth: Remove unused including
Fix the following versioncheck warning: drivers/scsi/gdth.c:85:1: unused including Reported-by: Hulk Robot Signed-off-by: Zou Wei --- drivers/scsi/gdth.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/scsi/gdth.c b/drivers/scsi/gdth.c index f43bd53..f949001 100644 --- a/drivers/scsi/gdth.c +++ b/drivers/scsi/gdth.c @@ -82,7 +82,6 @@ #include -#include #include #include #include -- 2.6.2
[PATCH -next] media: venus: Mark bufreq_enc with static keyword
Fix the following sparse warning: drivers/media/platform/qcom/venus/hfi_plat_bufs_v6.c:1242:5: warning: symbol 'bufreq_enc' was not declared. Should it be static? Signed-off-by: Zou Wei --- drivers/media/platform/qcom/venus/hfi_plat_bufs_v6.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/platform/qcom/venus/hfi_plat_bufs_v6.c b/drivers/media/platform/qcom/venus/hfi_plat_bufs_v6.c index 072e349..d43d1a5 100644 --- a/drivers/media/platform/qcom/venus/hfi_plat_bufs_v6.c +++ b/drivers/media/platform/qcom/venus/hfi_plat_bufs_v6.c @@ -1239,8 +1239,8 @@ static int bufreq_dec(struct hfi_plat_buffers_params *params, u32 buftype, return 0; } -int bufreq_enc(struct hfi_plat_buffers_params *params, u32 buftype, - struct hfi_buffer_requirements *bufreq) +static int bufreq_enc(struct hfi_plat_buffers_params *params, u32 buftype, + struct hfi_buffer_requirements *bufreq) { enum hfi_version version = params->version; struct enc_bufsize_ops *enc_ops; -- 2.6.2
[PATCH -next] phy: mediatek: Mark mtk_mipi_tx_driver with static keyword
Fix the following sparse warning: drivers/phy/mediatek/phy-mtk-mipi-dsi.c:237:24: warning: symbol 'mtk_mipi_tx_driver' was not declared. Should it be static? Signed-off-by: Zou Wei --- drivers/phy/mediatek/phy-mtk-mipi-dsi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/phy/mediatek/phy-mtk-mipi-dsi.c b/drivers/phy/mediatek/phy-mtk-mipi-dsi.c index 18c4812..eeb357b 100644 --- a/drivers/phy/mediatek/phy-mtk-mipi-dsi.c +++ b/drivers/phy/mediatek/phy-mtk-mipi-dsi.c @@ -234,7 +234,7 @@ static const struct of_device_id mtk_mipi_tx_match[] = { { }, }; -struct platform_driver mtk_mipi_tx_driver = { +static struct platform_driver mtk_mipi_tx_driver = { .probe = mtk_mipi_tx_probe, .remove = mtk_mipi_tx_remove, .driver = { -- 2.6.2
[PATCH -next] media: ti-vpe: cal: Mark cal_camerarx_media_ops with static keyword
Fix the following sparse warning: drivers/media/platform/ti-vpe/cal-camerarx.c:783:32: warning: symbol 'cal_camerarx_media_ops' was not declared. Should it be static? Signed-off-by: Zou Wei --- drivers/media/platform/ti-vpe/cal-camerarx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/platform/ti-vpe/cal-camerarx.c b/drivers/media/platform/ti-vpe/cal-camerarx.c index 1920f36..dd48017 100644 --- a/drivers/media/platform/ti-vpe/cal-camerarx.c +++ b/drivers/media/platform/ti-vpe/cal-camerarx.c @@ -780,7 +780,7 @@ static const struct v4l2_subdev_ops cal_camerarx_subdev_ops = { .pad = _camerarx_pad_ops, }; -struct media_entity_operations cal_camerarx_media_ops = { +static struct media_entity_operations cal_camerarx_media_ops = { .link_validate = v4l2_subdev_link_validate, }; -- 2.6.2
[PATCH -next] vdpa: Mark macaddr_buf with static keyword
Fix the following sparse warning: drivers/vdpa/vdpa_sim/vdpa_sim_net.c:36:4: warning: symbol 'macaddr_buf' was not declared. Should it be static? Reported-by: Hulk Robot Signed-off-by: Zou Wei --- drivers/vdpa/vdpa_sim/vdpa_sim_net.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/vdpa/vdpa_sim/vdpa_sim_net.c b/drivers/vdpa/vdpa_sim/vdpa_sim_net.c index c10b698..f048242 100644 --- a/drivers/vdpa/vdpa_sim/vdpa_sim_net.c +++ b/drivers/vdpa/vdpa_sim/vdpa_sim_net.c @@ -33,7 +33,7 @@ static char *macaddr; module_param(macaddr, charp, 0); MODULE_PARM_DESC(macaddr, "Ethernet MAC address"); -u8 macaddr_buf[ETH_ALEN]; +static u8 macaddr_buf[ETH_ALEN]; static struct vdpasim *vdpasim_net_dev; -- 2.6.2
[PATCH -next] usb: xhci: remove unused variable
Fix variable set but not used compilation warnings: drivers/usb/host/xhci.c:1338:15: warning: variable ‘len’ set but not used [-Wunused-but-set-variable] unsigned int len; ^~~ Signed-off-by: Zou Wei --- drivers/usb/host/xhci.c | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c index 91ab81c..24e5a0f 100644 --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c @@ -1335,7 +1335,6 @@ static bool xhci_urb_temp_buffer_required(struct usb_hcd *hcd, static void xhci_unmap_temp_buf(struct usb_hcd *hcd, struct urb *urb) { - unsigned int len; unsigned int buf_len; enum dma_data_direction dir; @@ -1351,10 +1350,10 @@ static void xhci_unmap_temp_buf(struct usb_hcd *hcd, struct urb *urb) dir); if (usb_urb_dir_in(urb)) - len = sg_pcopy_from_buffer(urb->sg, urb->num_sgs, - urb->transfer_buffer, - buf_len, - 0); + sg_pcopy_from_buffer(urb->sg, urb->num_sgs, +urb->transfer_buffer, +buf_len, +0); urb->transfer_flags &= ~URB_DMA_MAP_SINGLE; kfree(urb->transfer_buffer); -- 2.6.2
[PATCH -next] lib/ubsan.c: Mark type_check_kinds with static keyword
Fix the following sparse warning: lib/ubsan.c:20:12: warning: symbol 'type_check_kinds' was not declared. Should it be static? Signed-off-by: Zou Wei --- lib/ubsan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ubsan.c b/lib/ubsan.c index cb9af3f6..3cfe902 100644 --- a/lib/ubsan.c +++ b/lib/ubsan.c @@ -17,7 +17,7 @@ #include "ubsan.h" -const char *type_check_kinds[] = { +static const char *type_check_kinds[] = { "load of", "store to", "reference binding to", -- 2.6.2
[PATCH -next v2] net/mlx5_core: remove unused including
Remove including that don't need it. Fixes: 17a7612b99e6 ("net/mlx5_core: Clean driver version and name") Signed-off-by: Zou Wei --- drivers/net/ethernet/mellanox/mlx5/core/en_rep.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c b/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c index 989c70c..82ecc161 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c @@ -30,7 +30,6 @@ * SOFTWARE. */ -#include #include #include #include -- 2.6.2
[PATCH -next] usb: cdnsp: Mark cdnsp_gadget_ops with static keyword
Fix the following sparse warning: drivers/usb/cdns3/cdnsp-gadget.c:1546:29: warning: symbol 'cdnsp_gadget_ops' was not declared. Should it be static? Signed-off-by: Zou Wei --- drivers/usb/cdns3/cdnsp-gadget.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/cdns3/cdnsp-gadget.c b/drivers/usb/cdns3/cdnsp-gadget.c index 9716273..c7c5d0a 100644 --- a/drivers/usb/cdns3/cdnsp-gadget.c +++ b/drivers/usb/cdns3/cdnsp-gadget.c @@ -1543,7 +1543,7 @@ static int cdnsp_gadget_pullup(struct usb_gadget *gadget, int is_on) return 0; } -const struct usb_gadget_ops cdnsp_gadget_ops = { +static const struct usb_gadget_ops cdnsp_gadget_ops = { .get_frame = cdnsp_gadget_get_frame, .wakeup = cdnsp_gadget_wakeup, .set_selfpowered= cdnsp_gadget_set_selfpowered, -- 2.6.2
[PATCH -next] platform/x86: ISST: Mark mmio_range_devid_0 and mmio_range_devid_1 with static keyword
Fix the following sparse warnings: drivers/platform/x86/intel_speed_select_if/isst_if_mmio.c:23:24: warning: symbol 'mmio_range_devid_0' was not declared. Should it be static? drivers/platform/x86/intel_speed_select_if/isst_if_mmio.c:28:24: warning: symbol 'mmio_range_devid_1' was not declared. Should it be static? Signed-off-by: Zou Wei --- drivers/platform/x86/intel_speed_select_if/isst_if_mmio.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/platform/x86/intel_speed_select_if/isst_if_mmio.c b/drivers/platform/x86/intel_speed_select_if/isst_if_mmio.c index 2906cfe..ff49025 100644 --- a/drivers/platform/x86/intel_speed_select_if/isst_if_mmio.c +++ b/drivers/platform/x86/intel_speed_select_if/isst_if_mmio.c @@ -20,12 +20,12 @@ struct isst_mmio_range { int end; }; -struct isst_mmio_range mmio_range_devid_0[] = { +static struct isst_mmio_range mmio_range_devid_0[] = { {0x04, 0x14}, {0x20, 0xD0}, }; -struct isst_mmio_range mmio_range_devid_1[] = { +static struct isst_mmio_range mmio_range_devid_1[] = { {0x04, 0x14}, {0x20, 0x11C}, }; -- 2.6.2
[PATCH -next] net/mlx5_core: remove unused including
Remove including that don't need it. Signed-off-by: Zou Wei --- drivers/net/ethernet/mellanox/mlx5/core/en_rep.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c b/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c index 989c70c..82ecc161 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c @@ -30,7 +30,6 @@ * SOFTWARE. */ -#include #include #include #include -- 2.6.2
[PATCH -next] regulator: da9121: Mark some symbols with static keyword
Fix the following sparse warnings: drivers/regulator/da9121-regulator.c:55:21: warning: symbol 'da9121_10A_2phase_current' was not declared. Should it be static? drivers/regulator/da9121-regulator.c:63:21: warning: symbol 'da9121_6A_2phase_current' was not declared. Should it be static? drivers/regulator/da9121-regulator.c:71:21: warning: symbol 'da9121_5A_1phase_current' was not declared. Should it be static? drivers/regulator/da9121-regulator.c:79:21: warning: symbol 'da9121_3A_1phase_current' was not declared. Should it be static? drivers/regulator/da9121-regulator.c:151:32: warning: symbol 'status_event_handling' was not declared. Should it be static? Signed-off-by: Zou Wei --- drivers/regulator/da9121-regulator.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/regulator/da9121-regulator.c b/drivers/regulator/da9121-regulator.c index 3ead6a1..893512c 100644 --- a/drivers/regulator/da9121-regulator.c +++ b/drivers/regulator/da9121-regulator.c @@ -52,7 +52,7 @@ struct da9121_range { int reg_max; }; -struct da9121_range da9121_10A_2phase_current = { +static struct da9121_range da9121_10A_2phase_current = { .val_min = 700, .val_max = 2000, .val_stp = 100, @@ -60,7 +60,7 @@ struct da9121_range da9121_10A_2phase_current = { .reg_max = 14, }; -struct da9121_range da9121_6A_2phase_current = { +static struct da9121_range da9121_6A_2phase_current = { .val_min = 700, .val_max = 1200, .val_stp = 100, @@ -68,7 +68,7 @@ struct da9121_range da9121_6A_2phase_current = { .reg_max = 6, }; -struct da9121_range da9121_5A_1phase_current = { +static struct da9121_range da9121_5A_1phase_current = { .val_min = 350, .val_max = 1000, .val_stp = 50, @@ -76,7 +76,7 @@ struct da9121_range da9121_5A_1phase_current = { .reg_max = 14, }; -struct da9121_range da9121_3A_1phase_current = { +static struct da9121_range da9121_3A_1phase_current = { .val_min = 350, .val_max = 600, .val_stp = 50, @@ -148,7 +148,7 @@ struct status_event_data { * * GPIO0/1/2 are not configured for use by default, so should not be seen. */ -const struct status_event_data status_event_handling[] = { +static const struct status_event_data status_event_handling[] = { DA9xxx_STATUS(0, 0, SG, 0, "Handled E_SG\n"), DA9121_STATUS(0, 0, TEMP_CRIT, (REGULATOR_EVENT_OVER_TEMP|REGULATOR_EVENT_DISABLE), NULL), DA9121_STATUS(0, 0, TEMP_WARN, REGULATOR_EVENT_OVER_TEMP, NULL), -- 2.6.2
[tip: x86/platform] x86/platform/uv: Make uv_pcibus_kset and uv_hubs_kset static
The following commit has been merged into the x86/platform branch of tip: Commit-ID: 0c683e9de0c78ee53e220eac9ee3604ca662737a Gitweb: https://git.kernel.org/tip/0c683e9de0c78ee53e220eac9ee3604ca662737a Author:Zou Wei AuthorDate:Mon, 30 Nov 2020 19:11:53 +08:00 Committer: Borislav Petkov CommitterDate: Thu, 03 Dec 2020 08:53:47 +01:00 x86/platform/uv: Make uv_pcibus_kset and uv_hubs_kset static Fix the following sparse warnings: drivers/platform/x86/uv_sysfs.c:22:13: warning: symbol \ 'uv_pcibus_kset' was not declared. Should it be static? drivers/platform/x86/uv_sysfs.c:23:13: warning: symbol \ 'uv_hubs_kset' was not declared. Should it be static? Signed-off-by: Zou Wei Signed-off-by: Borislav Petkov Acked-by: Hans de Goede Link: https://lkml.kernel.org/r/1606734713-43919-1-git-send-email-zou_...@huawei.com --- drivers/platform/x86/uv_sysfs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/platform/x86/uv_sysfs.c b/drivers/platform/x86/uv_sysfs.c index e17ce8c..c27f5ff 100644 --- a/drivers/platform/x86/uv_sysfs.c +++ b/drivers/platform/x86/uv_sysfs.c @@ -19,8 +19,8 @@ #define INVALID_CNODE -1 struct kobject *sgi_uv_kobj; -struct kset *uv_pcibus_kset; -struct kset *uv_hubs_kset; +static struct kset *uv_pcibus_kset; +static struct kset *uv_hubs_kset; static struct uv_bios_hub_info *hub_buf; static struct uv_bios_port_info **port_buf; static struct uv_hub **uv_hubs;
[PATCH -next v2] firmware: xilinx: Mark pm_api_features_map with static keyword
Fix the following sparse warning: drivers/firmware/xilinx/zynqmp.c:32:1: warning: symbol 'pm_api_features_map' was not declared. Should it be static? Signed-off-by: Zou Wei --- drivers/firmware/xilinx/zynqmp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/firmware/xilinx/zynqmp.c b/drivers/firmware/xilinx/zynqmp.c index d08ac82..fd95ede 100644 --- a/drivers/firmware/xilinx/zynqmp.c +++ b/drivers/firmware/xilinx/zynqmp.c @@ -29,7 +29,7 @@ #define PM_API_FEATURE_CHECK_MAX_ORDER 7 static bool feature_check_enabled; -DEFINE_HASHTABLE(pm_api_features_map, PM_API_FEATURE_CHECK_MAX_ORDER); +static DEFINE_HASHTABLE(pm_api_features_map, PM_API_FEATURE_CHECK_MAX_ORDER); /** * struct pm_api_feature_data - PM API Feature data -- 2.6.2
[PATCH -next] firmware: xilinx: Mark pm_api_features_map with static keyword
Fix the following sparse warning: drivers/firmware/xilinx/zynqmp.c:32:1: warning: symbol 'pm_api_features_map' was not declared. Should it be static? Signed-off-by: Zou Wei --- drivers/firmware/xilinx/zynqmp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/firmware/xilinx/zynqmp.c b/drivers/firmware/xilinx/zynqmp.c index d08ac82..943c2ac5 100644 --- a/drivers/firmware/xilinx/zynqmp.c +++ b/drivers/firmware/xilinx/zynqmp.c @@ -29,7 +29,7 @@ #define PM_API_FEATURE_CHECK_MAX_ORDER 7 static bool feature_check_enabled; -DEFINE_HASHTABLE(pm_api_features_map, PM_API_FEATURE_CHECK_MAX_ORDER); +static EFINE_HASHTABLE(pm_api_features_map, PM_API_FEATURE_CHECK_MAX_ORDER); /** * struct pm_api_feature_data - PM API Feature data -- 2.6.2
[PATCH -next] x86/platform/uv: Mark some symbols with static keyword
Fix the following sparse warnings: drivers/platform/x86/uv_sysfs.c:22:13: warning: symbol 'uv_pcibus_kset' was not declared. Should it be static? drivers/platform/x86/uv_sysfs.c:23:13: warning: symbol 'uv_hubs_kset' was not declared. Should it be static? Signed-off-by: Zou Wei --- drivers/platform/x86/uv_sysfs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/platform/x86/uv_sysfs.c b/drivers/platform/x86/uv_sysfs.c index 54c3425..c780a4b 100644 --- a/drivers/platform/x86/uv_sysfs.c +++ b/drivers/platform/x86/uv_sysfs.c @@ -19,8 +19,8 @@ #define INVALID_CNODE -1 struct kobject *sgi_uv_kobj; -struct kset *uv_pcibus_kset; -struct kset *uv_hubs_kset; +static struct kset *uv_pcibus_kset; +static struct kset *uv_hubs_kset; static struct uv_bios_hub_info *hub_buf; static struct uv_bios_port_info **port_buf; static struct uv_hub **uv_hubs; -- 2.6.2
[PATCH -next v2] sched/topology: Mark some symbols with static keyword
Fix the following sparse warnings: kernel/sched/topology.c:211:1: warning: symbol 'sched_energy_mutex' was not declared. Should it be static? kernel/sched/topology.c:212:6: warning: symbol 'sched_energy_update' was not declared. Should it be static? Fixes: 31f6a8c0a471 ("sched/topology,schedutil: Wrap sched domains rebuild") Signed-off-by: Zou Wei --- kernel/sched/topology.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/sched/topology.c b/kernel/sched/topology.c index 5d3675c..2676687 100644 --- a/kernel/sched/topology.c +++ b/kernel/sched/topology.c @@ -208,8 +208,8 @@ sd_parent_degenerate(struct sched_domain *sd, struct sched_domain *parent) #if defined(CONFIG_ENERGY_MODEL) && defined(CONFIG_CPU_FREQ_GOV_SCHEDUTIL) DEFINE_STATIC_KEY_FALSE(sched_energy_present); unsigned int sysctl_sched_energy_aware = 1; -DEFINE_MUTEX(sched_energy_mutex); -bool sched_energy_update; +static DEFINE_MUTEX(sched_energy_mutex); +static bool sched_energy_update; void rebuild_sched_domains_energy(void) { -- 2.6.2
[PATCH -next] sched/topology: Mark some symbols with static keyword
Fix the following sparse warnings: kernel/sched/topology.c:211:1: warning: symbol 'sched_energy_mutex' was not declared. Should it be static? kernel/sched/topology.c:212:6: warning: symbol 'sched_energy_update' was not declared. Should it be static? Signed-off-by: Zou Wei --- kernel/sched/topology.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/sched/topology.c b/kernel/sched/topology.c index 5d3675c..2676687 100644 --- a/kernel/sched/topology.c +++ b/kernel/sched/topology.c @@ -208,8 +208,8 @@ sd_parent_degenerate(struct sched_domain *sd, struct sched_domain *parent) #if defined(CONFIG_ENERGY_MODEL) && defined(CONFIG_CPU_FREQ_GOV_SCHEDUTIL) DEFINE_STATIC_KEY_FALSE(sched_energy_present); unsigned int sysctl_sched_energy_aware = 1; -DEFINE_MUTEX(sched_energy_mutex); -bool sched_energy_update; +static DEFINE_MUTEX(sched_energy_mutex); +static bool sched_energy_update; void rebuild_sched_domains_energy(void) { -- 2.6.2
[PATCH -next] mm/swap.c: Mark sort_page_lruvec with static keyword
Fix the following sparse warning: mm/swap.c:1018:5: warning: symbol 'sort_page_lruvec' was not declared. Should it be static? Signed-off-by: Zou Wei --- mm/swap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/swap.c b/mm/swap.c index c787b38..5022dfe 100644 --- a/mm/swap.c +++ b/mm/swap.c @@ -1015,7 +1015,7 @@ struct lruvecs { }; /* Sort pvec pages on their lruvec */ -int sort_page_lruvec(struct lruvecs *lruvecs, struct pagevec *pvec) +static int sort_page_lruvec(struct lruvecs *lruvecs, struct pagevec *pvec) { int i, j, nr_lruvec; struct page *page; -- 2.6.2
[PATCH -next] pinctrl: pinctrl-microchip-sgpio: Mark some symbols with static keyword
Fix the following sparse warnings: drivers/pinctrl/pinctrl-microchip-sgpio.c:63:31: warning: symbol 'properties_luton' was not declared. Should it be static? drivers/pinctrl/pinctrl-microchip-sgpio.c:68:31: warning: symbol 'properties_ocelot' was not declared. Should it be static? drivers/pinctrl/pinctrl-microchip-sgpio.c:73:31: warning: symbol 'properties_sparx5' was not declared. Should it be static? Signed-off-by: Zou Wei --- drivers/pinctrl/pinctrl-microchip-sgpio.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/pinctrl/pinctrl-microchip-sgpio.c b/drivers/pinctrl/pinctrl-microchip-sgpio.c index d6c31cc..e182419 100644 --- a/drivers/pinctrl/pinctrl-microchip-sgpio.c +++ b/drivers/pinctrl/pinctrl-microchip-sgpio.c @@ -60,17 +60,17 @@ struct sgpio_properties { #define SGPIO_SPARX5_CLK_FREQGENMASK(19, 8) #define SGPIO_SPARX5_BIT_SOURCE GENMASK(23, 12) -const struct sgpio_properties properties_luton = { +static const struct sgpio_properties properties_luton = { .arch = SGPIO_ARCH_LUTON, .regoff = { 0x00, 0x09, 0x29, 0x2a, 0x2b }, }; -const struct sgpio_properties properties_ocelot = { +static const struct sgpio_properties properties_ocelot = { .arch = SGPIO_ARCH_OCELOT, .regoff = { 0x00, 0x06, 0x26, 0x04, 0x05 }, }; -const struct sgpio_properties properties_sparx5 = { +static const struct sgpio_properties properties_sparx5 = { .arch = SGPIO_ARCH_SPARX5, .regoff = { 0x00, 0x06, 0x26, 0x04, 0x05 }, }; -- 2.6.2
[PATCH -next] scsi: lpfc: Mark lpfc_nvmet_prep_abort_wqe with static keyword
Fix the following sparse warning: drivers/scsi/lpfc/lpfc_nvmet.c:3340:1: warning: symbol 'lpfc_nvmet_prep_abort_wqe' was not declared. Should it be static? Signed-off-by: Zou Wei --- drivers/scsi/lpfc/lpfc_nvmet.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/lpfc/lpfc_nvmet.c b/drivers/scsi/lpfc/lpfc_nvmet.c index c8b9434..a71df87 100644 --- a/drivers/scsi/lpfc/lpfc_nvmet.c +++ b/drivers/scsi/lpfc/lpfc_nvmet.c @@ -3336,7 +3336,7 @@ lpfc_nvmet_unsol_issue_abort(struct lpfc_hba *phba, * * This function is called with hbalock held. **/ -void +static void lpfc_nvmet_prep_abort_wqe(struct lpfc_iocbq *pwqeq, u16 xritag, u8 opt) { union lpfc_wqe128 *wqe = >wqe; -- 2.6.2
[PATCH -next] btrfs: remove unused variable
Fix variable set but not used compilation warnings: fs/btrfs/ctree.c:1581:6: warning: variable ‘parent_level’ set but not used [-Wunused-but-set-variable] int parent_level; ^~~~ fs/btrfs/zoned.c:503:6: warning: variable ‘zone_size’ set but not used [-Wunused-but-set-variable] u64 zone_size; ^ Signed-off-by: Zou Wei --- fs/btrfs/ctree.c | 3 --- fs/btrfs/zoned.c | 2 -- 2 files changed, 5 deletions(-) diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c index 32a57a7..e5a0941 100644 --- a/fs/btrfs/ctree.c +++ b/fs/btrfs/ctree.c @@ -1578,13 +1578,10 @@ int btrfs_realloc_node(struct btrfs_trans_handle *trans, int end_slot; int i; int err = 0; - int parent_level; u32 blocksize; int progress_passed = 0; struct btrfs_disk_key disk_key; - parent_level = btrfs_header_level(parent); - WARN_ON(trans->transaction != fs_info->running_transaction); WARN_ON(trans->transid != fs_info->generation); diff --git a/fs/btrfs/zoned.c b/fs/btrfs/zoned.c index fa9cc61..742f088 100644 --- a/fs/btrfs/zoned.c +++ b/fs/btrfs/zoned.c @@ -500,7 +500,6 @@ int btrfs_sb_log_location_bdev(struct block_device *bdev, int mirror, int rw, unsigned int zone_sectors; u32 sb_zone; int ret; - u64 zone_size; u8 zone_sectors_shift; sector_t nr_sectors = bdev->bd_part->nr_sects; u32 nr_zones; @@ -515,7 +514,6 @@ int btrfs_sb_log_location_bdev(struct block_device *bdev, int mirror, int rw, zone_sectors = bdev_zone_sectors(bdev); if (!is_power_of_2(zone_sectors)) return -EINVAL; - zone_size = zone_sectors << SECTOR_SHIFT; zone_sectors_shift = ilog2(zone_sectors); nr_zones = nr_sectors >> zone_sectors_shift; -- 2.6.2
[PATCH -next] powerpc/powernv/sriov: Fix unsigned comparison to zero
Fixes coccicheck warnings: ./arch/powerpc/platforms/powernv/pci-sriov.c:443:7-10: WARNING: Unsigned expression compared with zero: win < 0 ./arch/powerpc/platforms/powernv/pci-sriov.c:462:7-10: WARNING: Unsigned expression compared with zero: win < 0 Signed-off-by: Zou Wei --- arch/powerpc/platforms/powernv/pci-sriov.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/platforms/powernv/pci-sriov.c b/arch/powerpc/platforms/powernv/pci-sriov.c index c4434f2..92fc861 100644 --- a/arch/powerpc/platforms/powernv/pci-sriov.c +++ b/arch/powerpc/platforms/powernv/pci-sriov.c @@ -422,7 +422,7 @@ static int pnv_pci_vf_assign_m64(struct pci_dev *pdev, u16 num_vfs) { struct pnv_iov_data *iov; struct pnv_phb*phb; - unsigned int win; + intwin; struct resource *res; inti, j; int64_trc; -- 2.6.2
[PATCH -next] ASoC: samsung: fix platform_no_drv_owner.cocci warnings
./sound/soc/samsung/midas_wm1811.c:534:3-8: No need to set .owner here. The core will do it. Remove .owner field if calls are used which set it automatically Generated by: scripts/coccinelle/api/platform_no_drv_owner.cocci Signed-off-by: Zou Wei --- sound/soc/samsung/midas_wm1811.c | 1 - 1 file changed, 1 deletion(-) diff --git a/sound/soc/samsung/midas_wm1811.c b/sound/soc/samsung/midas_wm1811.c index d03340c..1f9a553 100644 --- a/sound/soc/samsung/midas_wm1811.c +++ b/sound/soc/samsung/midas_wm1811.c @@ -531,7 +531,6 @@ static struct platform_driver midas_driver = { .driver = { .name = "midas-audio", .of_match_table = midas_of_match, - .owner = THIS_MODULE, .pm = _soc_pm_ops, }, .probe = midas_probe, -- 2.6.2
[PATCH -next] mm/page_alloc: Mark some symbols with static keyword
Fix the following sparse warnings: mm/page_alloc.c:3040:6: warning: symbol '__drain_all_pages' was not declared. Should it be static? mm/page_alloc.c:6349:6: warning: symbol '__zone_set_pageset_high_and_batch' was not declared. Should it be static? Signed-off-by: Zou Wei --- mm/page_alloc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 63d8d8b..e7548344 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -3037,7 +3037,7 @@ static void drain_local_pages_wq(struct work_struct *work) * that need the guarantee that every CPU has drained can disable the * optimizing racy check. */ -void __drain_all_pages(struct zone *zone, bool force_all_cpus) +static void __drain_all_pages(struct zone *zone, bool force_all_cpus) { int cpu; @@ -6346,7 +6346,7 @@ static void pageset_init(struct per_cpu_pageset *p) pcp->batch = BOOT_PAGESET_BATCH; } -void __zone_set_pageset_high_and_batch(struct zone *zone, unsigned long high, +static void __zone_set_pageset_high_and_batch(struct zone *zone, unsigned long high, unsigned long batch) { struct per_cpu_pageset *p; -- 2.6.2
[PATCH -next] cxgb4: Remove unused variable ret
This patch fixes below warning reported by coccicheck: ./drivers/net/ethernet/chelsio/cxgb4/t4_hw.c:3284:5-8: Unneeded variable: "ret". Return "0" on line 3301 Signed-off-by: Zou Wei --- drivers/net/ethernet/chelsio/cxgb4/t4_hw.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c b/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c index 98d01a7..426d15e 100644 --- a/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c +++ b/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c @@ -3281,8 +3281,6 @@ int t4_get_scfg_version(struct adapter *adapter, u32 *vers) */ int t4_get_version_info(struct adapter *adapter) { - int ret = 0; - #define FIRST_RET(__getvinfo) \ do { \ int __ret = __getvinfo; \ @@ -3298,7 +3296,7 @@ int t4_get_version_info(struct adapter *adapter) FIRST_RET(t4_get_vpd_version(adapter, >params.vpd_vers)); #undef FIRST_RET - return ret; + return 0; } /** -- 2.6.2
[PATCH -next] mfd: altera-sysmgr: Use resource_size function on resource object
./drivers/mfd/altera-sysmgr.c:155:36-39: WARNING: Suspicious code. resource_size is maybe missing with res Generated by: scripts/coccinelle/api/resource_size.cocci Signed-off-by: Zou Wei --- drivers/mfd/altera-sysmgr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mfd/altera-sysmgr.c b/drivers/mfd/altera-sysmgr.c index 41076d1..193a96c 100644 --- a/drivers/mfd/altera-sysmgr.c +++ b/drivers/mfd/altera-sysmgr.c @@ -152,7 +152,7 @@ static int sysmgr_probe(struct platform_device *pdev) if (!base) return -ENOMEM; - sysmgr_config.max_register = res->end - res->start - 3; + sysmgr_config.max_register = resource_size(res) - 3; regmap = devm_regmap_init_mmio(dev, base, _config); } -- 2.6.2
[PATCH -next] mailbox: pcc: fix platform_no_drv_owner.cocci warning
./drivers/mailbox/pcc.c:580:3-8: No need to set .owner here. The core will do it. Remove .owner field if calls are used which set it automatically Generated by: scripts/coccinelle/api/platform_no_drv_owner.cocci Signed-off-by: Zou Wei --- drivers/mailbox/pcc.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/mailbox/pcc.c b/drivers/mailbox/pcc.c index ef9ecd1..4b1a2d2 100644 --- a/drivers/mailbox/pcc.c +++ b/drivers/mailbox/pcc.c @@ -577,7 +577,6 @@ static struct platform_driver pcc_mbox_driver = { .probe = pcc_mbox_probe, .driver = { .name = "PCCT", - .owner = THIS_MODULE, }, }; -- 2.6.2
[PATCH -next] auxdisplay: fix platform_no_drv_owner.cocci warning
./drivers/auxdisplay/lcd2s.c:373:3-8: No need to set .owner here. The core will do it. Remove .owner field if calls are used which set it automatically Generated by: scripts/coccinelle/api/platform_no_drv_owner.cocci Signed-off-by: Zou Wei --- drivers/auxdisplay/lcd2s.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/auxdisplay/lcd2s.c b/drivers/auxdisplay/lcd2s.c index 3eb7f04..38ba0862 100644 --- a/drivers/auxdisplay/lcd2s.c +++ b/drivers/auxdisplay/lcd2s.c @@ -370,7 +370,6 @@ MODULE_DEVICE_TABLE(of, lcd2s_of_table); static struct i2c_driver lcd2s_i2c_driver = { .driver = { .name = "lcd2s", - .owner = THIS_MODULE, #ifdef CONFIG_OF .of_match_table = of_match_ptr(lcd2s_of_table), #endif -- 2.6.2
[PATCH -next] scsi: be2iscsi: Mark beiscsi_attrs with static keyword
Fix the following sparse warning: ./be_main.c:167:25: warning: symbol 'beiscsi_attrs' was not declared. Should it be static? Signed-off-by: Zou Wei --- drivers/scsi/be2iscsi/be_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/be2iscsi/be_main.c b/drivers/scsi/be2iscsi/be_main.c index 202ba92..50e4642 100644 --- a/drivers/scsi/be2iscsi/be_main.c +++ b/drivers/scsi/be2iscsi/be_main.c @@ -164,7 +164,7 @@ DEVICE_ATTR(beiscsi_active_session_count, S_IRUGO, beiscsi_active_session_disp, NULL); DEVICE_ATTR(beiscsi_free_session_count, S_IRUGO, beiscsi_free_session_disp, NULL); -struct device_attribute *beiscsi_attrs[] = { +static struct device_attribute *beiscsi_attrs[] = { _attr_beiscsi_log_enable, _attr_beiscsi_drvr_ver, _attr_beiscsi_adapter_family, -- 2.6.2
[PATCH -next] drm/virtio: Make virtgpu_dmabuf_ops with static keyword
Fix the following sparse warning: ./virtgpu_prime.c:46:33: warning: symbol 'virtgpu_dmabuf_ops' was not declared. Should it be static? Signed-off-by: Zou Wei --- drivers/gpu/drm/virtio/virtgpu_prime.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/virtio/virtgpu_prime.c b/drivers/gpu/drm/virtio/virtgpu_prime.c index 1ef1e2f..807a27a 100644 --- a/drivers/gpu/drm/virtio/virtgpu_prime.c +++ b/drivers/gpu/drm/virtio/virtgpu_prime.c @@ -43,7 +43,7 @@ static int virtgpu_virtio_get_uuid(struct dma_buf *buf, return 0; } -const struct virtio_dma_buf_ops virtgpu_dmabuf_ops = { +static const struct virtio_dma_buf_ops virtgpu_dmabuf_ops = { .ops = { .cache_sgt_mapping = true, .attach = virtio_dma_buf_attach, -- 2.6.2
[PATCH -next] perf intel-bts: use true for bool variables
Fix coccicheck warnings: ./intel-bts.c:472:3-13: WARNING: Assignment of 0/1 to bool variable ./intel-bts.c:515:3-13: WARNING: Assignment of 0/1 to bool variable Reported-by: Hulk Robot Signed-off-by: Zou Wei --- tools/perf/util/intel-bts.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/perf/util/intel-bts.c b/tools/perf/util/intel-bts.c index af1e78d..aa4fad9 100644 --- a/tools/perf/util/intel-bts.c +++ b/tools/perf/util/intel-bts.c @@ -469,7 +469,7 @@ static int intel_bts_process_queue(struct intel_bts_queue *btsq, u64 *timestamp) if (!buffer) { if (!btsq->bts->sampling_mode) - btsq->done = 1; + btsq->done = true; err = 1; goto out_put; } @@ -512,7 +512,7 @@ static int intel_bts_process_queue(struct intel_bts_queue *btsq, u64 *timestamp) *timestamp = btsq->buffer->reference; } else { if (!btsq->bts->sampling_mode) - btsq->done = 1; + btsq->done = true; } out_put: thread__put(thread); -- 2.6.2
[PATCH -next] cpumask: use false and true for bool variables
Fix coccicheck warnings: ./lib/cpumask.c:342:6-13: WARNING: Comparison of 0/1 to bool variable ./lib/cpumask.c:351:33-40: WARNING: Comparison of 0/1 to bool variable ./lib/cpumask.c:406:3-11: WARNING: Assignment of 0/1 to bool variable Reported-by: Hulk Robot Signed-off-by: Zou Wei --- lib/cpumask.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/cpumask.c b/lib/cpumask.c index 34ecb30..74d0cf1 100644 --- a/lib/cpumask.c +++ b/lib/cpumask.c @@ -339,7 +339,7 @@ static int find_nearest_node(int *node_dist, bool *used) /* Choose the first unused node to compare */ for (i = 0; i < nr_node_ids; i++) { - if (used[i] == 0) { + if (used[i] == false) { min_dist = node_dist[i]; node_id = i; break; @@ -348,7 +348,7 @@ static int find_nearest_node(int *node_dist, bool *used) /* Compare and return the nearest node */ for (i = 0; i < nr_node_ids; i++) { - if (node_dist[i] < min_dist && used[i] == 0) { + if (node_dist[i] < min_dist && used[i] == false) { min_dist = node_dist[i]; node_id = i; } @@ -403,7 +403,7 @@ unsigned int cpumask_local_spread(unsigned int i, int node) flags); return cpu; } - used[id] = 1; + used[id] = true; } spin_unlock_irqrestore(_lock, flags); -- 2.6.2
[PATCH -next] mmc: owl-mmc: use true and false for bool variables
Fix coccicheck warnings: ./owl-mmc.c:524:2-18: WARNING: Assignment of 0/1 to bool variable ./owl-mmc.c:528:2-18: WARNING: Assignment of 0/1 to bool variable Reported-by: Hulk Robot Signed-off-by: Zou Wei --- drivers/mmc/host/owl-mmc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/mmc/host/owl-mmc.c b/drivers/mmc/host/owl-mmc.c index 82d2bad..53b81582 100644 --- a/drivers/mmc/host/owl-mmc.c +++ b/drivers/mmc/host/owl-mmc.c @@ -521,11 +521,11 @@ static void owl_mmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) /* Enable DDR mode if requested */ if (ios->timing == MMC_TIMING_UHS_DDR50) { - owl_host->ddr_50 = 1; + owl_host->ddr_50 = true; owl_mmc_update_reg(owl_host->base + OWL_REG_SD_EN, OWL_SD_EN_DDREN, true); } else { - owl_host->ddr_50 = 0; + owl_host->ddr_50 = false; } } -- 2.6.2
[PATCH -next v2] ASoC: mediatek: mt8192: Make some symbols static
Fix the following sparse warnings: ./mt8192-dai-i2s.c:2040:5: warning: symbol 'mt8192_dai_i2s_get_share' was not declared. Should it be static? ./mt8192-dai-i2s.c:2060:5: warning: symbol 'mt8192_dai_i2s_set_priv' was not declared. Should it be static? ./mt8192-afe-gpio.c:15:16: warning: symbol 'aud_pinctrl' was not declared. Should it be static? ./mt8192-afe-pcm.c:70:5: warning: symbol 'mt8192_get_memif_pbuf_size' was not declared. Should it be static? ./mt8192-afe-pcm.c:2137:39: warning: symbol 'mt8192_afe_component' was not declared. Should it be static? Reported-by: Hulk Robot Signed-off-by: Zou Wei --- sound/soc/mediatek/mt8192/mt8192-afe-gpio.c | 2 +- sound/soc/mediatek/mt8192/mt8192-afe-pcm.c | 4 ++-- sound/soc/mediatek/mt8192/mt8192-dai-i2s.c | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/sound/soc/mediatek/mt8192/mt8192-afe-gpio.c b/sound/soc/mediatek/mt8192/mt8192-afe-gpio.c index ea00088..4208820 100644 --- a/sound/soc/mediatek/mt8192/mt8192-afe-gpio.c +++ b/sound/soc/mediatek/mt8192/mt8192-afe-gpio.c @@ -12,7 +12,7 @@ #include "mt8192-afe-common.h" #include "mt8192-afe-gpio.h" -struct pinctrl *aud_pinctrl; +static struct pinctrl *aud_pinctrl; enum mt8192_afe_gpio { MT8192_AFE_GPIO_DAT_MISO_OFF, diff --git a/sound/soc/mediatek/mt8192/mt8192-afe-pcm.c b/sound/soc/mediatek/mt8192/mt8192-afe-pcm.c index 4a4729f..e7fec2d 100644 --- a/sound/soc/mediatek/mt8192/mt8192-afe-pcm.c +++ b/sound/soc/mediatek/mt8192/mt8192-afe-pcm.c @@ -67,7 +67,7 @@ static int mt8192_irq_fs(struct snd_pcm_substream *substream, unsigned int rate) return mt8192_general_rate_transform(afe->dev, rate); } -int mt8192_get_memif_pbuf_size(struct snd_pcm_substream *substream) +static int mt8192_get_memif_pbuf_size(struct snd_pcm_substream *substream) { struct snd_pcm_runtime *runtime = substream->runtime; @@ -2134,7 +2134,7 @@ static int mt8192_afe_component_probe(struct snd_soc_component *component) return mtk_afe_add_sub_dai_control(component); } -const struct snd_soc_component_driver mt8192_afe_component = { +static const struct snd_soc_component_driver mt8192_afe_component = { .name = AFE_PCM_NAME, .probe = mt8192_afe_component_probe, .pointer = mtk_afe_pcm_pointer, diff --git a/sound/soc/mediatek/mt8192/mt8192-dai-i2s.c b/sound/soc/mediatek/mt8192/mt8192-dai-i2s.c index 53c560e..5b29340 100644 --- a/sound/soc/mediatek/mt8192/mt8192-dai-i2s.c +++ b/sound/soc/mediatek/mt8192/mt8192-dai-i2s.c @@ -2037,7 +2037,7 @@ static const struct mtk_afe_i2s_priv mt8192_i2s_priv[DAI_I2S_NUM] = { }, }; -int mt8192_dai_i2s_get_share(struct mtk_base_afe *afe) +static int mt8192_dai_i2s_get_share(struct mtk_base_afe *afe) { struct mt8192_afe_private *afe_priv = afe->platform_priv; const struct device_node *of_node = afe->dev->of_node; @@ -2057,7 +2057,7 @@ int mt8192_dai_i2s_get_share(struct mtk_base_afe *afe) return 0; } -int mt8192_dai_i2s_set_priv(struct mtk_base_afe *afe) +static int mt8192_dai_i2s_set_priv(struct mtk_base_afe *afe) { int i; int ret; -- 2.6.2
[PATCH -next] ASoC: mediatek: mt8192: Make some symbols static
Fix the following sparse warnings: ./mt8192-dai-i2s.c:2040:5: warning: symbol 'mt8192_dai_i2s_get_share' was not declared. Should it be static? ./mt8192-dai-i2s.c:2060:5: warning: symbol 'mt8192_dai_i2s_set_priv' was not declared. Should it be static? Reported-by: Hulk Robot Signed-off-by: Zou Wei --- sound/soc/mediatek/mt8192/mt8192-dai-i2s.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sound/soc/mediatek/mt8192/mt8192-dai-i2s.c b/sound/soc/mediatek/mt8192/mt8192-dai-i2s.c index 53c560e..5b29340 100644 --- a/sound/soc/mediatek/mt8192/mt8192-dai-i2s.c +++ b/sound/soc/mediatek/mt8192/mt8192-dai-i2s.c @@ -2037,7 +2037,7 @@ static const struct mtk_afe_i2s_priv mt8192_i2s_priv[DAI_I2S_NUM] = { }, }; -int mt8192_dai_i2s_get_share(struct mtk_base_afe *afe) +static int mt8192_dai_i2s_get_share(struct mtk_base_afe *afe) { struct mt8192_afe_private *afe_priv = afe->platform_priv; const struct device_node *of_node = afe->dev->of_node; @@ -2057,7 +2057,7 @@ int mt8192_dai_i2s_get_share(struct mtk_base_afe *afe) return 0; } -int mt8192_dai_i2s_set_priv(struct mtk_base_afe *afe) +static int mt8192_dai_i2s_set_priv(struct mtk_base_afe *afe) { int i; int ret; -- 2.6.2
[PATCH -next] clk: imx: scu: Make pd_np with static keyword
Fix the following sparse warning: ./clk-scu.c:23:20: warning: symbol 'pd_np' was not declared. Should it be static? Reported-by: Hulk Robot Signed-off-by: Zou Wei --- drivers/clk/imx/clk-scu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/clk/imx/clk-scu.c b/drivers/clk/imx/clk-scu.c index d0243c5..d10f60e 100644 --- a/drivers/clk/imx/clk-scu.c +++ b/drivers/clk/imx/clk-scu.c @@ -20,7 +20,7 @@ #define IMX_SIP_SET_CPUFREQ0x00 static struct imx_sc_ipc *ccm_ipc_handle; -struct device_node *pd_np; +static struct device_node *pd_np; static struct platform_driver imx_clk_scu_driver; struct imx_scu_clk_node { -- 2.6.2
[PATCH -next] dpaa_eth: use false and true for bool variables
Fix coccicheck warnings: ./dpaa_eth.c:2549:2-22: WARNING: Assignment of 0/1 to bool variable ./dpaa_eth.c:2562:2-22: WARNING: Assignment of 0/1 to bool variable Reported-by: Hulk Robot Signed-off-by: Zou Wei --- drivers/net/ethernet/freescale/dpaa/dpaa_eth.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c index d9c2859..31407c1 100644 --- a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c +++ b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c @@ -2546,7 +2546,7 @@ static void dpaa_eth_napi_enable(struct dpaa_priv *priv) for_each_online_cpu(i) { percpu_priv = per_cpu_ptr(priv->percpu_priv, i); - percpu_priv->np.down = 0; + percpu_priv->np.down = false; napi_enable(_priv->np.napi); } } @@ -2559,7 +2559,7 @@ static void dpaa_eth_napi_disable(struct dpaa_priv *priv) for_each_online_cpu(i) { percpu_priv = per_cpu_ptr(priv->percpu_priv, i); - percpu_priv->np.down = 1; + percpu_priv->np.down = true; napi_disable(_priv->np.napi); } } -- 2.6.2
[PATCH -next] IB/isert: Fix warning Comparison to bool
Fix below warning reported by coccicheck: ./ib_isert.c:1104:12-24: WARNING: Comparison to bool Reported-by: Hulk Robot Signed-off-by: Zou Wei --- drivers/infiniband/ulp/isert/ib_isert.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/infiniband/ulp/isert/ib_isert.c b/drivers/infiniband/ulp/isert/ib_isert.c index bd47894..e47cd02 100644 --- a/drivers/infiniband/ulp/isert/ib_isert.c +++ b/drivers/infiniband/ulp/isert/ib_isert.c @@ -1101,7 +1101,7 @@ isert_handle_scsi_cmd(struct isert_conn *isert_conn, sequence_cmd: rc = iscsit_sequence_cmd(conn, cmd, buf, hdr->cmdsn); - if (!rc && dump_payload == false && unsol_data) + if (!rc && !dump_payload && unsol_data) iscsit_set_unsolicited_dataout(cmd); else if (dump_payload && imm_data) target_put_sess_cmd(>se_cmd); -- 2.6.2
[PATCH -next] clk: imx: gate2: Remove unused variable ret
This patch fixes below warning reported by coccicheck: ./clk-gate2.c:57:5-8: Unneeded variable: "ret". Return "0" on line 68 Reported-by: Hulk Robot Signed-off-by: Zou Wei --- drivers/clk/imx/clk-gate2.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/clk/imx/clk-gate2.c b/drivers/clk/imx/clk-gate2.c index 480a184..f16c401 100644 --- a/drivers/clk/imx/clk-gate2.c +++ b/drivers/clk/imx/clk-gate2.c @@ -54,7 +54,6 @@ static int clk_gate2_enable(struct clk_hw *hw) { struct clk_gate2 *gate = to_clk_gate2(hw); unsigned long flags; - int ret = 0; spin_lock_irqsave(gate->lock, flags); @@ -65,7 +64,7 @@ static int clk_gate2_enable(struct clk_hw *hw) out: spin_unlock_irqrestore(gate->lock, flags); - return ret; + return 0; } static void clk_gate2_disable(struct clk_hw *hw) -- 2.6.2
[PATCH -next] drm/nouveu: remove unused variable
Fix variables set but not used compilation warnings: ./nouveau_bo.c:1313:17: warning: variable ‘dev’ set but not used [-Wunused-but-set-variable] struct device *dev; ^~~ ./nouveau_bo.c:1337:17: warning: variable ‘dev’ set but not used [-Wunused-but-set-variable] struct device *dev; ^~~ Reported-by: Hulk Robot Signed-off-by: Zou Wei --- drivers/gpu/drm/nouveau/nouveau_bo.c | 4 1 file changed, 4 deletions(-) diff --git a/drivers/gpu/drm/nouveau/nouveau_bo.c b/drivers/gpu/drm/nouveau/nouveau_bo.c index 8133377..96f00b5 100644 --- a/drivers/gpu/drm/nouveau/nouveau_bo.c +++ b/drivers/gpu/drm/nouveau/nouveau_bo.c @@ -1310,7 +1310,6 @@ nouveau_ttm_tt_populate(struct ttm_bo_device *bdev, { struct ttm_tt *ttm_dma = (void *)ttm; struct nouveau_drm *drm; - struct device *dev; bool slave = !!(ttm->page_flags & TTM_PAGE_FLAG_SG); if (ttm_tt_is_populated(ttm)) @@ -1324,7 +1323,6 @@ nouveau_ttm_tt_populate(struct ttm_bo_device *bdev, } drm = nouveau_bdev(bdev); - dev = drm->dev->dev; return ttm_pool_alloc(>ttm.bdev.pool, ttm, ctx); } @@ -1334,14 +1332,12 @@ nouveau_ttm_tt_unpopulate(struct ttm_bo_device *bdev, struct ttm_tt *ttm) { struct nouveau_drm *drm; - struct device *dev; bool slave = !!(ttm->page_flags & TTM_PAGE_FLAG_SG); if (slave) return; drm = nouveau_bdev(bdev); - dev = drm->dev->dev; return ttm_pool_free(>ttm.bdev.pool, ttm); } -- 2.6.2
[PATCH -next] drm/amd/pm: remove unused variable
Fix variable set but not used compilation warning: ./vangogh_ppt.c:397:6: warning: variable ‘ret’ set but not used [-Wunused-but-set-variable] int ret = 0; ^~~ Reported-by: Hulk Robot Signed-off-by: Zou Wei --- drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c b/drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c index 6e26025..355ade5 100644 --- a/drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c +++ b/drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c @@ -394,8 +394,6 @@ static int vangogh_get_current_activity_percent(struct smu_context *smu, enum amd_pp_sensors sensor, uint32_t *value) { - int ret = 0; - if (!value) return -EINVAL; -- 2.6.2
[PATCH -next] drm/panfrost: Fix unused variable warning
Fixes the following W=1 kernel build warning: ./panfrost_job.c:617:28: warning: unused variable ‘js’ [-Wunused-variable] struct panfrost_job_slot *js = pfdev->js; ^~ Reported-by: Hulk Robot Signed-off-by: Zou Wei --- drivers/gpu/drm/panfrost/panfrost_job.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/gpu/drm/panfrost/panfrost_job.c b/drivers/gpu/drm/panfrost/panfrost_job.c index 4902bc6..e75b7d2 100644 --- a/drivers/gpu/drm/panfrost/panfrost_job.c +++ b/drivers/gpu/drm/panfrost/panfrost_job.c @@ -613,8 +613,6 @@ int panfrost_job_open(struct panfrost_file_priv *panfrost_priv) void panfrost_job_close(struct panfrost_file_priv *panfrost_priv) { - struct panfrost_device *pfdev = panfrost_priv->pfdev; - struct panfrost_job_slot *js = pfdev->js; int i; for (i = 0; i < NUM_JOB_SLOTS; i++) -- 2.6.2
[PATCH -next v2] usb: Mark sync_all_pins() with static keyword
Fix the following sparse warning: ./brcmstb-usb-pinmap.c:219:6: warning: symbol 'sync_all_pins' was not declared. Should it be static? The sync_all_pins has only call site within brcmstb-usb-pinmap.c Mark it static as suggested. Fixes: 517c4c44b323 ("usb: Add driver to allow any GPIO to be used for 7211 USB signals") Reported-by: Hulk Robot Signed-off-by: Zou Wei --- v2: - Make title more precise. - Shorten the warning path. - Add period. drivers/usb/misc/brcmstb-usb-pinmap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/misc/brcmstb-usb-pinmap.c b/drivers/usb/misc/brcmstb-usb-pinmap.c index 02144c3..cc9618d 100644 --- a/drivers/usb/misc/brcmstb-usb-pinmap.c +++ b/drivers/usb/misc/brcmstb-usb-pinmap.c @@ -216,7 +216,7 @@ static int parse_pins(struct device *dev, struct device_node *dn, return 0; } -void sync_all_pins(struct brcmstb_usb_pinmap_data *pdata) +static void sync_all_pins(struct brcmstb_usb_pinmap_data *pdata) { struct out_pin *pout; struct in_pin *pin; -- 2.6.2
[PATCH -next v3] platform/x86/dell-wmi-sysman: Make some symbols static
Fix the following sparse warnings: ./passobj-attributes.c:38:23: warning: symbol 'po_is_pass_set' was not declared. Should it be static? ./passobj-attributes.c:70:23: warning: symbol 'po_current_password' was not declared. Should it be static? ./passobj-attributes.c:99:23: warning: symbol 'po_new_password' was not declared. Should it be static? ./passobj-attributes.c:103:23: warning: symbol 'po_min_pass_length' was not declared. Should it be static? ./passobj-attributes.c:107:23: warning: symbol 'po_max_pass_length' was not declared. Should it be static? ./passobj-attributes.c:116:23: warning: symbol 'po_mechanism' was not declared. Should it be static? ./passobj-attributes.c:129:23: warning: symbol 'po_role' was not declared. Should it be static? Reported-by: Hulk Robot Signed-off-by: Zou Wei --- v2: - put all of them in a way that each occupies only a single line v3: - shorten the warning paths - put the static codes a single line .../x86/dell-wmi-sysman/passobj-attributes.c| 21 +++-- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/drivers/platform/x86/dell-wmi-sysman/passobj-attributes.c b/drivers/platform/x86/dell-wmi-sysman/passobj-attributes.c index e6199fb..3abcd95 100644 --- a/drivers/platform/x86/dell-wmi-sysman/passobj-attributes.c +++ b/drivers/platform/x86/dell-wmi-sysman/passobj-attributes.c @@ -35,8 +35,7 @@ static ssize_t is_enabled_show(struct kobject *kobj, struct kobj_attribute *attr return ret; } -struct kobj_attribute po_is_pass_set = - __ATTR_RO(is_enabled); +static struct kobj_attribute po_is_pass_set = __ATTR_RO(is_enabled); static ssize_t current_password_store(struct kobject *kobj, struct kobj_attribute *attr, @@ -67,8 +66,7 @@ static ssize_t current_password_store(struct kobject *kobj, return count; } -struct kobj_attribute po_current_password = - __ATTR_WO(current_password); +static struct kobj_attribute po_current_password = __ATTR_WO(current_password); static ssize_t new_password_store(struct kobject *kobj, struct kobj_attribute *attr, @@ -96,16 +94,13 @@ static ssize_t new_password_store(struct kobject *kobj, return ret ? ret : count; } -struct kobj_attribute po_new_password = - __ATTR_WO(new_password); +static struct kobj_attribute po_new_password = __ATTR_WO(new_password); attribute_n_property_show(min_password_length, po); -struct kobj_attribute po_min_pass_length = - __ATTR_RO(min_password_length); +static struct kobj_attribute po_min_pass_length = __ATTR_RO(min_password_length); attribute_n_property_show(max_password_length, po); -struct kobj_attribute po_max_pass_length = - __ATTR_RO(max_password_length); +static struct kobj_attribute po_max_pass_length = __ATTR_RO(max_password_length); static ssize_t mechanism_show(struct kobject *kobj, struct kobj_attribute *attr, char *buf) @@ -113,8 +108,7 @@ static ssize_t mechanism_show(struct kobject *kobj, struct kobj_attribute *attr, return sprintf(buf, "password\n"); } -struct kobj_attribute po_mechanism = - __ATTR_RO(mechanism); +static struct kobj_attribute po_mechanism = __ATTR_RO(mechanism); static ssize_t role_show(struct kobject *kobj, struct kobj_attribute *attr, char *buf) @@ -126,8 +120,7 @@ static ssize_t role_show(struct kobject *kobj, struct kobj_attribute *attr, return -EIO; } -struct kobj_attribute po_role = - __ATTR_RO(role); +static struct kobj_attribute po_role = __ATTR_RO(role); static struct attribute *po_attrs[] = { _is_pass_set.attr, -- 2.6.2
[PATCH -next] usb: Make sync_all_pins static
Fix the following sparse warning: drivers/usb/misc/brcmstb-usb-pinmap.c:219:6: warning: symbol 'sync_all_pins' was not declared. Should it be static? The sync_all_pins has only call site within brcmstb-usb-pinmap.c It should be static Fixes: 517c4c44b323 ("usb: Add driver to allow any GPIO to be used for 7211 USB signals") Reported-by: Hulk Robot Signed-off-by: Zou Wei --- drivers/usb/misc/brcmstb-usb-pinmap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/misc/brcmstb-usb-pinmap.c b/drivers/usb/misc/brcmstb-usb-pinmap.c index 02144c3..cc9618d 100644 --- a/drivers/usb/misc/brcmstb-usb-pinmap.c +++ b/drivers/usb/misc/brcmstb-usb-pinmap.c @@ -216,7 +216,7 @@ static int parse_pins(struct device *dev, struct device_node *dn, return 0; } -void sync_all_pins(struct brcmstb_usb_pinmap_data *pdata) +static void sync_all_pins(struct brcmstb_usb_pinmap_data *pdata) { struct out_pin *pout; struct in_pin *pin; -- 2.6.2
[PATCH -next v2] platform/x86/dell-wmi-sysman: Make some symbols static
Fix the following sparse warnings: drivers/platform/x86/dell-wmi-sysman/passobj-attributes.c:38:23: warning: symbol 'po_is_pass_set' was not declared. Should it be static? drivers/platform/x86/dell-wmi-sysman/passobj-attributes.c:70:23: warning: symbol 'po_current_password' was not declared. Should it be static? drivers/platform/x86/dell-wmi-sysman/passobj-attributes.c:99:23: warning: symbol 'po_new_password' was not declared. Should it be static? drivers/platform/x86/dell-wmi-sysman/passobj-attributes.c:103:23: warning: symbol 'po_min_pass_length' was not declared. Should it be static? drivers/platform/x86/dell-wmi-sysman/passobj-attributes.c:107:23: warning: symbol 'po_max_pass_length' was not declared. Should it be static? drivers/platform/x86/dell-wmi-sysman/passobj-attributes.c:116:23: warning: symbol 'po_mechanism' was not declared. Should it be static? drivers/platform/x86/dell-wmi-sysman/passobj-attributes.c:129:23: warning: symbol 'po_role' was not declared. Should it be static? Reported-by: Hulk Robot Signed-off-by: Zou Wei --- v2: - put all of them in a way that each occupies only a single line drivers/platform/x86/dell-wmi-sysman/passobj-attributes.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/platform/x86/dell-wmi-sysman/passobj-attributes.c b/drivers/platform/x86/dell-wmi-sysman/passobj-attributes.c index e6199fb..81562b1 100644 --- a/drivers/platform/x86/dell-wmi-sysman/passobj-attributes.c +++ b/drivers/platform/x86/dell-wmi-sysman/passobj-attributes.c @@ -35,7 +35,7 @@ static ssize_t is_enabled_show(struct kobject *kobj, struct kobj_attribute *attr return ret; } -struct kobj_attribute po_is_pass_set = +static struct kobj_attribute po_is_pass_set = __ATTR_RO(is_enabled); static ssize_t current_password_store(struct kobject *kobj, @@ -67,7 +67,7 @@ static ssize_t current_password_store(struct kobject *kobj, return count; } -struct kobj_attribute po_current_password = +static struct kobj_attribute po_current_password = __ATTR_WO(current_password); static ssize_t new_password_store(struct kobject *kobj, @@ -96,15 +96,15 @@ static ssize_t new_password_store(struct kobject *kobj, return ret ? ret : count; } -struct kobj_attribute po_new_password = +static struct kobj_attribute po_new_password = __ATTR_WO(new_password); attribute_n_property_show(min_password_length, po); -struct kobj_attribute po_min_pass_length = +static struct kobj_attribute po_min_pass_length = __ATTR_RO(min_password_length); attribute_n_property_show(max_password_length, po); -struct kobj_attribute po_max_pass_length = +static struct kobj_attribute po_max_pass_length = __ATTR_RO(max_password_length); static ssize_t mechanism_show(struct kobject *kobj, struct kobj_attribute *attr, @@ -113,7 +113,7 @@ static ssize_t mechanism_show(struct kobject *kobj, struct kobj_attribute *attr, return sprintf(buf, "password\n"); } -struct kobj_attribute po_mechanism = +static struct kobj_attribute po_mechanism = __ATTR_RO(mechanism); static ssize_t role_show(struct kobject *kobj, struct kobj_attribute *attr, @@ -126,7 +126,7 @@ static ssize_t role_show(struct kobject *kobj, struct kobj_attribute *attr, return -EIO; } -struct kobj_attribute po_role = +static struct kobj_attribute po_role = __ATTR_RO(role); static struct attribute *po_attrs[] = { -- 2.6.2
[PATCH -next] dma-buf: heaps: Make sys_heap static
Fix the following sparse warning: drivers/dma-buf/heaps/system_heap.c:23:17: warning: symbol 'sys_heap' was not declared. Should it be static? sys_heap has only call within system_heap.c It should be static Reported-by: Hulk Robot Signed-off-by: Zou Wei --- drivers/dma-buf/heaps/system_heap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/dma-buf/heaps/system_heap.c b/drivers/dma-buf/heaps/system_heap.c index 0bf688e..41502bf 100644 --- a/drivers/dma-buf/heaps/system_heap.c +++ b/drivers/dma-buf/heaps/system_heap.c @@ -20,7 +20,7 @@ #include "heap-helpers.h" -struct dma_heap *sys_heap; +static struct dma_heap *sys_heap; static void system_heap_free(struct heap_helper_buffer *buffer) { -- 2.6.2
[PATCH -next] drm/amdgpu/swsmu: Remove unused static struct 'navi10_i2c_algo'
Fixes the following W=1 kernel build warning(s): drivers/gpu/drm/amd/amdgpu/../pm/swsmu/smu11/navi10_ppt.c:2527:35: warning: ‘navi10_i2c_algo’ defined but not used [-Wunused-const-variable=] static const struct i2c_algorithm navi10_i2c_algo = { ^~~ Reported-by: Hulk Robot Signed-off-by: Zou Wei --- drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c | 6 -- 1 file changed, 6 deletions(-) diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c b/drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c index ef1a62e..bec63f2 100644 --- a/drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c +++ b/drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c @@ -2523,12 +2523,6 @@ static u32 navi10_i2c_func(struct i2c_adapter *adap) return I2C_FUNC_I2C | I2C_FUNC_SMBUS_EMUL; } - -static const struct i2c_algorithm navi10_i2c_algo = { - .master_xfer = navi10_i2c_xfer, - .functionality = navi10_i2c_func, -}; - static ssize_t navi10_get_gpu_metrics(struct smu_context *smu, void **table) { -- 2.6.2
[PATCH -next] platform/surface: remove status assignment without reading
The status local variable is assigned but never read: drivers/platform/surface/surface3-wmi.c:60:14: warning: variable ‘status’ set but not used [-Wunused-but-set-variable] acpi_status status; ^~ Reported-by: Hulk Robot Signed-off-by: Zou Wei --- drivers/platform/surface/surface3-wmi.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/platform/surface/surface3-wmi.c b/drivers/platform/surface/surface3-wmi.c index 130b6f5..ae1416c 100644 --- a/drivers/platform/surface/surface3-wmi.c +++ b/drivers/platform/surface/surface3-wmi.c @@ -57,12 +57,10 @@ static DEFINE_MUTEX(s3_wmi_lock); static int s3_wmi_query_block(const char *guid, int instance, int *ret) { struct acpi_buffer output = { ACPI_ALLOCATE_BUFFER, NULL }; - acpi_status status; union acpi_object *obj; int error = 0; mutex_lock(_wmi_lock); - status = wmi_query_block(guid, instance, ); obj = output.pointer; -- 2.6.2
[PATCH -next] platform/x86/dell-wmi-sysman: Make wmi_sysman_kobj_sysfs_ops static
Fix the following sparse warning: drivers/platform/x86/dell-wmi-sysman/sysman.c:258:24: warning: symbol 'wmi_sysman_kobj_sysfs_ops' was not declared. Should it be static? wmi_sysman_kobj_sysfs_ops has only call within sysman.c It should be static Reported-by: Hulk Robot Signed-off-by: Zou Wei --- drivers/platform/x86/dell-wmi-sysman/sysman.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/platform/x86/dell-wmi-sysman/sysman.c b/drivers/platform/x86/dell-wmi-sysman/sysman.c index 3842575..c6862c3 100644 --- a/drivers/platform/x86/dell-wmi-sysman/sysman.c +++ b/drivers/platform/x86/dell-wmi-sysman/sysman.c @@ -255,7 +255,7 @@ static ssize_t wmi_sysman_attr_store(struct kobject *kobj, struct attribute *att return ret; } -const struct sysfs_ops wmi_sysman_kobj_sysfs_ops = { +static const struct sysfs_ops wmi_sysman_kobj_sysfs_ops = { .show = wmi_sysman_attr_show, .store = wmi_sysman_attr_store, }; -- 2.6.2
[PATCH -next] platform/x86/dell-wmi-sysman: Make some symbols static
Fix the following sparse warnings: drivers/platform/x86/dell-wmi-sysman/passobj-attributes.c:38:23: warning: symbol 'po_is_pass_set' was not declared. Should it be static? drivers/platform/x86/dell-wmi-sysman/passobj-attributes.c:70:23: warning: symbol 'po_current_password' was not declared. Should it be static? drivers/platform/x86/dell-wmi-sysman/passobj-attributes.c:99:23: warning: symbol 'po_new_password' was not declared. Should it be static? drivers/platform/x86/dell-wmi-sysman/passobj-attributes.c:103:23: warning: symbol 'po_min_pass_length' was not declared. Should it be static? drivers/platform/x86/dell-wmi-sysman/passobj-attributes.c:107:23: warning: symbol 'po_max_pass_length' was not declared. Should it be static? drivers/platform/x86/dell-wmi-sysman/passobj-attributes.c:116:23: warning: symbol 'po_mechanism' was not declared. Should it be static? drivers/platform/x86/dell-wmi-sysman/passobj-attributes.c:129:23: warning: symbol 'po_role' was not declared. Should it be static? po_is_pass_set, po_current_password, po_new_password, po_min_pass_length, po_max_pass_length, po_mechanism and po_role have only call within passobj-attributes.c They should be static Reported-by: Hulk Robot Signed-off-by: Zou Wei --- drivers/platform/x86/dell-wmi-sysman/passobj-attributes.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/platform/x86/dell-wmi-sysman/passobj-attributes.c b/drivers/platform/x86/dell-wmi-sysman/passobj-attributes.c index e6199fb..81562b1 100644 --- a/drivers/platform/x86/dell-wmi-sysman/passobj-attributes.c +++ b/drivers/platform/x86/dell-wmi-sysman/passobj-attributes.c @@ -35,7 +35,7 @@ static ssize_t is_enabled_show(struct kobject *kobj, struct kobj_attribute *attr return ret; } -struct kobj_attribute po_is_pass_set = +static struct kobj_attribute po_is_pass_set = __ATTR_RO(is_enabled); static ssize_t current_password_store(struct kobject *kobj, @@ -67,7 +67,7 @@ static ssize_t current_password_store(struct kobject *kobj, return count; } -struct kobj_attribute po_current_password = +static struct kobj_attribute po_current_password = __ATTR_WO(current_password); static ssize_t new_password_store(struct kobject *kobj, @@ -96,15 +96,15 @@ static ssize_t new_password_store(struct kobject *kobj, return ret ? ret : count; } -struct kobj_attribute po_new_password = +static struct kobj_attribute po_new_password = __ATTR_WO(new_password); attribute_n_property_show(min_password_length, po); -struct kobj_attribute po_min_pass_length = +static struct kobj_attribute po_min_pass_length = __ATTR_RO(min_password_length); attribute_n_property_show(max_password_length, po); -struct kobj_attribute po_max_pass_length = +static struct kobj_attribute po_max_pass_length = __ATTR_RO(max_password_length); static ssize_t mechanism_show(struct kobject *kobj, struct kobj_attribute *attr, @@ -113,7 +113,7 @@ static ssize_t mechanism_show(struct kobject *kobj, struct kobj_attribute *attr, return sprintf(buf, "password\n"); } -struct kobj_attribute po_mechanism = +static struct kobj_attribute po_mechanism = __ATTR_RO(mechanism); static ssize_t role_show(struct kobject *kobj, struct kobj_attribute *attr, @@ -126,7 +126,7 @@ static ssize_t role_show(struct kobject *kobj, struct kobj_attribute *attr, return -EIO; } -struct kobj_attribute po_role = +static struct kobj_attribute po_role = __ATTR_RO(role); static struct attribute *po_attrs[] = { -- 2.6.2
[PATCH -next] net: stmmac: platform: remove useless if/else
Fix the following coccinelle report: ./drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c:233:6-8: WARNING: possible condition with no effect (if == else) Both branches are the same, so remove the else if/else altogether. Reported-by: Hulk Robot Signed-off-by: Zou Wei --- drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c index af34a4c..f6c69d0 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c @@ -230,8 +230,6 @@ static int stmmac_mtl_setup(struct platform_device *pdev, plat->tx_sched_algorithm = MTL_TX_ALGORITHM_WFQ; else if (of_property_read_bool(tx_node, "snps,tx-sched-dwrr")) plat->tx_sched_algorithm = MTL_TX_ALGORITHM_DWRR; - else if (of_property_read_bool(tx_node, "snps,tx-sched-sp")) - plat->tx_sched_algorithm = MTL_TX_ALGORITHM_SP; else plat->tx_sched_algorithm = MTL_TX_ALGORITHM_SP; -- 2.6.2
[PATCH -next] net: nvidia: forcedeth: remove useless if/else
Fix the following coccinelle report: ./drivers/net/ethernet/nvidia/forcedeth.c:3479:8-10: WARNING: possible condition with no effect (if == else) Both branches are the same, so remove the else if/else altogether. Reported-by: Hulk Robot Signed-off-by: Zou Wei --- drivers/net/ethernet/nvidia/forcedeth.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/net/ethernet/nvidia/forcedeth.c b/drivers/net/ethernet/nvidia/forcedeth.c index 2fc10a3..87ed7e1 100644 --- a/drivers/net/ethernet/nvidia/forcedeth.c +++ b/drivers/net/ethernet/nvidia/forcedeth.c @@ -3476,9 +3476,6 @@ static int nv_update_linkspeed(struct net_device *dev) } else if (adv_lpa & LPA_10FULL) { newls = NVREG_LINKSPEED_FORCE|NVREG_LINKSPEED_10; newdup = 1; - } else if (adv_lpa & LPA_10HALF) { - newls = NVREG_LINKSPEED_FORCE|NVREG_LINKSPEED_10; - newdup = 0; } else { newls = NVREG_LINKSPEED_FORCE|NVREG_LINKSPEED_10; newdup = 0; -- 2.6.2
[PATCH -next] coresight: core: Remove unneeded semicolon
Fixes coccicheck warning: ./drivers/hwtracing/coresight/coresight-core.c:421:4-5: Unneeded semicolon Reported-by: Hulk Robot Signed-off-by: Zou Wei --- drivers/hwtracing/coresight/coresight-core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/hwtracing/coresight/coresight-core.c b/drivers/hwtracing/coresight/coresight-core.c index cc9e802..29c83ea 100644 --- a/drivers/hwtracing/coresight/coresight-core.c +++ b/drivers/hwtracing/coresight/coresight-core.c @@ -418,7 +418,7 @@ static int coresight_enable_source(struct coresight_device *csdev, u32 mode) if (ret) { coresight_control_assoc_ectdev(csdev, false); return ret; - }; + } } csdev->enable = true; } -- 2.6.2
[PATCH -next] drm/i915: Remove unused variable ret
This patch fixes below warnings reported by coccicheck ./drivers/gpu/drm/i915/i915_debugfs.c:789:5-8: Unneeded variable: "ret". Return "0" on line 1012 Reported-by: Hulk Robot Signed-off-by: Zou Wei --- drivers/gpu/drm/i915/i915_debugfs.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c index ea46916..200f6b8 100644 --- a/drivers/gpu/drm/i915/i915_debugfs.c +++ b/drivers/gpu/drm/i915/i915_debugfs.c @@ -786,7 +786,6 @@ static int i915_frequency_info(struct seq_file *m, void *unused) struct intel_uncore *uncore = _priv->uncore; struct intel_rps *rps = _priv->gt.rps; intel_wakeref_t wakeref; - int ret = 0; wakeref = intel_runtime_pm_get(_priv->runtime_pm); @@ -1009,7 +1008,7 @@ static int i915_frequency_info(struct seq_file *m, void *unused) seq_printf(m, "Max pixel clock frequency: %d kHz\n", dev_priv->max_dotclk_freq); intel_runtime_pm_put(_priv->runtime_pm, wakeref); - return ret; + return 0; } static int i915_ring_freq_table(struct seq_file *m, void *unused) -- 2.6.2
[PATCH -next] mm/hugetlb: Make is_aligned_hugepage_range static
Fix the following sparse warning: arch/mips/mm/hugetlbpage.c:64:5: warning: symbol 'is_aligned_hugepage_range' was not declared. Should it be static? Reported-by: Hulk Robot Signed-off-by: Zou Wei --- arch/mips/mm/hugetlbpage.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/mips/mm/hugetlbpage.c b/arch/mips/mm/hugetlbpage.c index 77ffece..774c988 100644 --- a/arch/mips/mm/hugetlbpage.c +++ b/arch/mips/mm/hugetlbpage.c @@ -61,7 +61,7 @@ pte_t *huge_pte_offset(struct mm_struct *mm, unsigned long addr, /* * This function checks for proper alignment of input addr and len parameters. */ -int is_aligned_hugepage_range(unsigned long addr, unsigned long len) +static int is_aligned_hugepage_range(unsigned long addr, unsigned long len) { if (len & ~HPAGE_MASK) return -EINVAL; -- 2.6.2
[PATCH -next] phy: cpcap-usb: Use IRQF_ONESHOT
Fixes coccicheck error: ./drivers/phy/motorola/phy-cpcap-usb.c:365:9-34: ERROR: Threaded IRQ with no primary handler requested without IRQF_ONESHOT Reported-by: Hulk Robot Signed-off-by: Zou Wei --- drivers/phy/motorola/phy-cpcap-usb.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/phy/motorola/phy-cpcap-usb.c b/drivers/phy/motorola/phy-cpcap-usb.c index 089db0d..442522b 100644 --- a/drivers/phy/motorola/phy-cpcap-usb.c +++ b/drivers/phy/motorola/phy-cpcap-usb.c @@ -364,7 +364,8 @@ static int cpcap_usb_init_irq(struct platform_device *pdev, error = devm_request_threaded_irq(ddata->dev, irq, NULL, cpcap_phy_irq_thread, - IRQF_SHARED, + IRQF_SHARED | + IRQF_ONESHOT, name, ddata); if (error) { dev_err(ddata->dev, "could not get irq %s: %i\n", -- 2.6.2
[PATCH -next] mm, page_alloc: Fix old-style function definition
Fix warning: mm/page_alloc.c:763:6: warning: old-style function definition [-Wold-style-definition] void init_mem_debugging() ^~ Reported-by: Hulk Robot Signed-off-by: Zou Wei --- mm/page_alloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index f80dc59..470b18d 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -760,7 +760,7 @@ static inline void clear_page_guard(struct zone *zone, struct page *page, * order of appearance. So we need to first gather the full picture of what was * enabled, and then make decisions. */ -void init_mem_debugging() +void init_mem_debugging(void) { if (_init_on_alloc_enabled_early) { if (page_poisoning_enabled()) { -- 2.6.2
[PATCH -next] drm/amd/display: remove useless if/else
Fix the following coccinelle report: ./drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c:1367:3-5: WARNING: possible condition with no effect (if == else) Both branches are the same, so remove the if/else altogether. Fixes: 81875979f0b2 ("drm/amd/display: Remove extra pairs of parentheses in dce_calcs.c") Reported-by: Hulk Robot Signed-off-by: Zou Wei --- drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c | 11 --- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c b/drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c index 2c6db37..e4f29cd 100644 --- a/drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c +++ b/drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c @@ -1364,13 +1364,10 @@ static void calculate_bandwidth( /*if stutter and dram clock state change are gated before cursor then the cursor latency hiding does not limit stutter or dram clock state change*/ for (i = 0; i <= maximum_number_of_surfaces - 1; i++) { if (data->enable[i]) { - if (dceip->graphics_lb_nodownscaling_multi_line_prefetching == 1) { - data->maximum_latency_hiding[i] = bw_add(data->minimum_latency_hiding[i], bw_mul(bw_frc_to_fixed(5, 10), data->total_dmifmc_urgent_latency)); - } - else { - /*maximum_latency_hiding(i) = minimum_latency_hiding(i) + 1 / vsr(i) * h_total(i) / pixel_rate(i) + 0.5 * total_dmifmc_urgent_latency*/ - data->maximum_latency_hiding[i] = bw_add(data->minimum_latency_hiding[i], bw_mul(bw_frc_to_fixed(5, 10), data->total_dmifmc_urgent_latency)); - } + /*maximum_latency_hiding(i) = minimum_latency_hiding(i) + 1 / vsr(i) **/ + /* h_total(i) / pixel_rate(i) + 0.5 * total_dmifmc_urgent_latency*/ + data->maximum_latency_hiding[i] = bw_add(data->minimum_latency_hiding[i], + bw_mul(bw_frc_to_fixed(5, 10), data->total_dmifmc_urgent_latency)); data->maximum_latency_hiding_with_cursor[i] = bw_min2(data->maximum_latency_hiding[i], data->cursor_latency_hiding[i]); } } -- 2.6.2
[PATCH -next] firmware: tegra: Use memdup_user() as a cleanup
Fix coccicheck warning which recommends to use memdup_user(). This patch fixes the following coccicheck warning: ./drivers/firmware/tegra/bpmp-debugfs.c:335:11-18: WARNING opportunity for memdup_user Fixes: 5e37b9c137ee ("firmware: tegra: Add support for in-band debug") Reported-by: Hulk Robot Signed-off-by: Zou Wei --- drivers/firmware/tegra/bpmp-debugfs.c | 9 +++-- 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/firmware/tegra/bpmp-debugfs.c b/drivers/firmware/tegra/bpmp-debugfs.c index c1bbba9..7234136 100644 --- a/drivers/firmware/tegra/bpmp-debugfs.c +++ b/drivers/firmware/tegra/bpmp-debugfs.c @@ -332,12 +332,9 @@ static ssize_t bpmp_debug_store(struct file *file, const char __user *buf, if (!filename) return -ENOENT; - databuf = kmalloc(count, GFP_KERNEL); - if (!databuf) - return -ENOMEM; - - if (copy_from_user(databuf, buf, count)) { - err = -EFAULT; + databuf = memdup_user(buf, count); + if (IS_ERR(databuf)) { + err = PTR_ERR(databuf); goto free_ret; } -- 2.6.2
[PATCH -next] net: wan: sdla: Use bitwise instead of arithmetic
Fix the following coccinelle warnings: ./drivers/net/wan/sdla.c:841:38-39: WARNING: sum of probable bitmasks, consider | Reported-by: Hulk Robot Signed-off-by: Zou Wei --- drivers/net/wan/sdla.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/wan/sdla.c b/drivers/net/wan/sdla.c index bc2c1c7..cf43f4c 100644 --- a/drivers/net/wan/sdla.c +++ b/drivers/net/wan/sdla.c @@ -838,7 +838,8 @@ static void sdla_receive(struct net_device *dev) case SDLA_S502A: case SDLA_S502E: if (success) - __sdla_read(dev, SDLA_502_RCV_BUF + SDLA_502_DATA_OFS, skb_put(skb,len), len); + __sdla_read(dev, SDLA_502_RCV_BUF | SDLA_502_DATA_OFS, + skb_put(skb, len), len); SDLA_WINDOW(dev, SDLA_502_RCV_BUF); cmd->opp_flag = 0; -- 2.6.2
[PATCH -next] drm/tilcdc: fix platform_no_drv_owner.cocci warnings
./drivers/gpu/drm/tilcdc/tilcdc_panel.c:402:3-8: No need to set .owner here. The core will do it. Remove .owner field if calls are used which set it automatically Generated by: scripts/coccinelle/api/platform_no_drv_owner.cocci Fixes: 0d4bbaf9f3e5 ("drm/tilcdc: add support for LCD panels (v5)") Reported-by: Hulk Robot Signed-off-by: Zou Wei --- drivers/gpu/drm/tilcdc/tilcdc_panel.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/gpu/drm/tilcdc/tilcdc_panel.c b/drivers/gpu/drm/tilcdc/tilcdc_panel.c index 00efc30..4235780 100644 --- a/drivers/gpu/drm/tilcdc/tilcdc_panel.c +++ b/drivers/gpu/drm/tilcdc/tilcdc_panel.c @@ -399,7 +399,6 @@ static struct platform_driver panel_driver = { .probe = panel_probe, .remove = panel_remove, .driver = { - .owner = THIS_MODULE, .name = "tilcdc-panel", .of_match_table = panel_of_match, }, -- 2.6.2
[PATCH -next] firmware: ti_sci: Remove unneeded semicolon
Fixes coccicheck warning: ./drivers/firmware/ti_sci.c:1759:2-3: Unneeded semicolon ./drivers/firmware/ti_sci.c:2191:2-3: Unneeded semicolon Fixes: 9c19fb6895be ("firmware: ti_sci: Add support for RM core ops") Fixes: 68608b5e5063 ("firmware: ti_sci: Add resource management APIs for ringacc, psi-l and udma") Signed-off-by: Zou Wei --- drivers/firmware/ti_sci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/firmware/ti_sci.c b/drivers/firmware/ti_sci.c index 896f53e..e0c8adf 100644 --- a/drivers/firmware/ti_sci.c +++ b/drivers/firmware/ti_sci.c @@ -1756,7 +1756,7 @@ static int ti_sci_get_resource_range(const struct ti_sci_handle *handle, } else { *range_start = resp->range_start; *range_num = resp->range_num; - }; + } fail: ti_sci_put_one_xfer(>minfo, xfer); @@ -2188,7 +2188,7 @@ static int ti_sci_cmd_ring_get_config(const struct ti_sci_handle *handle, *size = resp->size; if (order_id) *order_id = resp->order_id; - }; + } fail: ti_sci_put_one_xfer(>minfo, xfer); -- 2.6.2
[PATCH -next] dma-buf: heaps: Remove unused variable ret
This patch fixes below warnings reported by coccicheck ./drivers/dma-buf/heaps/heap-helpers.c:202:5-8: Unneeded variable: "ret". Return "0" on line 215 Signed-off-by: Zou Wei --- drivers/dma-buf/heaps/heap-helpers.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/dma-buf/heaps/heap-helpers.c b/drivers/dma-buf/heaps/heap-helpers.c index d0696cf..7969510 100644 --- a/drivers/dma-buf/heaps/heap-helpers.c +++ b/drivers/dma-buf/heaps/heap-helpers.c @@ -199,7 +199,6 @@ static int dma_heap_dma_buf_begin_cpu_access(struct dma_buf *dmabuf, { struct heap_helper_buffer *buffer = dmabuf->priv; struct dma_heaps_attachment *a; - int ret = 0; mutex_lock(>lock); @@ -212,7 +211,7 @@ static int dma_heap_dma_buf_begin_cpu_access(struct dma_buf *dmabuf, } mutex_unlock(>lock); - return ret; + return 0; } static int dma_heap_dma_buf_end_cpu_access(struct dma_buf *dmabuf, -- 2.6.2
[PATCH -next] clk: mediatek: fix platform_no_drv_owner.cocci warnings
./drivers/clk/mediatek/clk-mt6765.c:912:3-8: No need to set .owner here. The core will do it. Remove .owner field if calls are used which set it automatically Generated by: scripts/coccinelle/api/platform_no_drv_owner.cocci Fixes: 1aca9939bf72 ("clk: mediatek: Add MT6765 clock support") Signed-off-by: Zou Wei --- drivers/clk/mediatek/clk-mt6765.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/clk/mediatek/clk-mt6765.c b/drivers/clk/mediatek/clk-mt6765.c index db8db1b..d77ea5a 100644 --- a/drivers/clk/mediatek/clk-mt6765.c +++ b/drivers/clk/mediatek/clk-mt6765.c @@ -909,7 +909,6 @@ static struct platform_driver clk_mt6765_drv = { .probe = clk_mt6765_probe, .driver = { .name = "clk-mt6765", - .owner = THIS_MODULE, .of_match_table = of_match_clk_mt6765, }, }; -- 2.6.2
[PATCH -next] ACPICA: Remove unneeded semicolon
Fixes coccicheck warning: ./drivers/acpi/acpica/nsalloc.c:297:2-3: Unneeded semicolon Signed-off-by: Zou Wei --- drivers/acpi/acpica/nsalloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/acpi/acpica/nsalloc.c b/drivers/acpi/acpica/nsalloc.c index fe9b363..83d26ab 100644 --- a/drivers/acpi/acpica/nsalloc.c +++ b/drivers/acpi/acpica/nsalloc.c @@ -294,7 +294,7 @@ void acpi_ns_delete_children(struct acpi_namespace_node *parent_node) node_to_delete = next_node; next_node = next_node->peer; acpi_ns_delete_node(node_to_delete); - }; + } /* Clear the parent's child pointer */ -- 2.6.2
[tip: core/rcu] locktorture: Use true and false to assign to bool variables
The following commit has been merged into the core/rcu branch of tip: Commit-ID: d02c6b52d12fa30eeabfaf5aefe12078eacb94b2 Gitweb: https://git.kernel.org/tip/d02c6b52d12fa30eeabfaf5aefe12078eacb94b2 Author:Zou Wei AuthorDate:Mon, 13 Apr 2020 20:02:59 +08:00 Committer: Paul E. McKenney CommitterDate: Mon, 29 Jun 2020 12:01:44 -07:00 locktorture: Use true and false to assign to bool variables This commit fixes the following coccicheck warnings: kernel/locking/locktorture.c:689:6-10: WARNING: Assignment of 0/1 to bool variable kernel/locking/locktorture.c:907:2-20: WARNING: Assignment of 0/1 to bool variable kernel/locking/locktorture.c:938:3-20: WARNING: Assignment of 0/1 to bool variable kernel/locking/locktorture.c:668:2-19: WARNING: Assignment of 0/1 to bool variable kernel/locking/locktorture.c:674:2-19: WARNING: Assignment of 0/1 to bool variable kernel/locking/locktorture.c:634:2-20: WARNING: Assignment of 0/1 to bool variable kernel/locking/locktorture.c:640:2-20: WARNING: Assignment of 0/1 to bool variable Reported-by: Hulk Robot Signed-off-by: Zou Wei Signed-off-by: Paul E. McKenney --- kernel/locking/locktorture.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/kernel/locking/locktorture.c b/kernel/locking/locktorture.c index 5efbfc6..8ff6f50 100644 --- a/kernel/locking/locktorture.c +++ b/kernel/locking/locktorture.c @@ -631,13 +631,13 @@ static int lock_torture_writer(void *arg) cxt.cur_ops->writelock(); if (WARN_ON_ONCE(lock_is_write_held)) lwsp->n_lock_fail++; - lock_is_write_held = 1; + lock_is_write_held = true; if (WARN_ON_ONCE(lock_is_read_held)) lwsp->n_lock_fail++; /* rare, but... */ lwsp->n_lock_acquired++; cxt.cur_ops->write_delay(); - lock_is_write_held = 0; + lock_is_write_held = false; cxt.cur_ops->writeunlock(); stutter_wait("lock_torture_writer"); @@ -665,13 +665,13 @@ static int lock_torture_reader(void *arg) schedule_timeout_uninterruptible(1); cxt.cur_ops->readlock(); - lock_is_read_held = 1; + lock_is_read_held = true; if (WARN_ON_ONCE(lock_is_write_held)) lrsp->n_lock_fail++; /* rare, but... */ lrsp->n_lock_acquired++; cxt.cur_ops->read_delay(); - lock_is_read_held = 0; + lock_is_read_held = false; cxt.cur_ops->readunlock(); stutter_wait("lock_torture_reader"); @@ -686,7 +686,7 @@ static int lock_torture_reader(void *arg) static void __torture_print_stats(char *page, struct lock_stress_stats *statp, bool write) { - bool fail = 0; + bool fail = false; int i, n_stress; long max = 0, min = statp ? statp[0].n_lock_acquired : 0; long long sum = 0; @@ -904,7 +904,7 @@ static int __init lock_torture_init(void) /* Initialize the statistics so that each run gets its own numbers. */ if (nwriters_stress) { - lock_is_write_held = 0; + lock_is_write_held = false; cxt.lwsa = kmalloc_array(cxt.nrealwriters_stress, sizeof(*cxt.lwsa), GFP_KERNEL); @@ -935,7 +935,7 @@ static int __init lock_torture_init(void) } if (nreaders_stress) { - lock_is_read_held = 0; + lock_is_read_held = false; cxt.lrsa = kmalloc_array(cxt.nrealreaders_stress, sizeof(*cxt.lrsa), GFP_KERNEL);
[tip: perf/core] libtraceevent: Remove unneeded semicolon
The following commit has been merged into the perf/core branch of tip: Commit-ID: eebe80c982546ce1041b7dcf3c461406f1e7e88f Gitweb: https://git.kernel.org/tip/eebe80c982546ce1041b7dcf3c461406f1e7e88f Author:Zou Wei AuthorDate:Tue, 28 Apr 2020 17:12:01 +08:00 Committer: Arnaldo Carvalho de Melo CommitterDate: Thu, 30 Apr 2020 10:48:32 -03:00 libtraceevent: Remove unneeded semicolon Fixes coccicheck warning: tools/lib/traceevent/kbuffer-parse.c:441:2-3: Unneeded semicolon Reported-by: Hulk Robot Signed-off-by: Zou Wei Acked-by: Steven Rostedt (VMware) Link: http://lore.kernel.org/lkml/1588065121-71236-1-git-send-email-zou_...@huawei.com Signed-off-by: Arnaldo Carvalho de Melo --- tools/lib/traceevent/kbuffer-parse.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/lib/traceevent/kbuffer-parse.c b/tools/lib/traceevent/kbuffer-parse.c index b887e74..27f3b07 100644 --- a/tools/lib/traceevent/kbuffer-parse.c +++ b/tools/lib/traceevent/kbuffer-parse.c @@ -438,7 +438,7 @@ void *kbuffer_translate_data(int swap, void *data, unsigned int *size) case KBUFFER_TYPE_TIME_EXTEND: case KBUFFER_TYPE_TIME_STAMP: return NULL; - }; + } *size = length;
[tip: perf/core] perf report: Fix warning assignment of 0/1 to bool variable
The following commit has been merged into the perf/core branch of tip: Commit-ID: 6fa9c3e779b89612c56f8ee0096b2252d906357a Gitweb: https://git.kernel.org/tip/6fa9c3e779b89612c56f8ee0096b2252d906357a Author:Zou Wei AuthorDate:Sun, 26 Apr 2020 20:38:03 +08:00 Committer: Arnaldo Carvalho de Melo CommitterDate: Thu, 30 Apr 2020 10:48:33 -03:00 perf report: Fix warning assignment of 0/1 to bool variable Fixes coccicheck warning: tools/perf/builtin-report.c:1403:2-34: WARNING: Assignment of 0/1 to bool variable Reported-by: Hulk Robot Signed-off-by: Zou Wei Cc: Alexander Shishkin Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lore.kernel.org/lkml/1587904683-3510-1-git-send-email-zou_...@huawei.com Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/builtin-report.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c index 0c32767..7da1342 100644 --- a/tools/perf/builtin-report.c +++ b/tools/perf/builtin-report.c @@ -1413,7 +1413,7 @@ repeat: } if (branch_call_mode) { callchain_param.key = CCKEY_ADDRESS; - callchain_param.branch_callstack = 1; + callchain_param.branch_callstack = true; symbol_conf.use_callchain = true; callchain_register_param(_param); if (sort_order == NULL)
[tip: perf/core] perf tools: Remove unneeded semicolons
The following commit has been merged into the perf/core branch of tip: Commit-ID: 8284bbeab75f1842dc11531356115c4d09abebc0 Gitweb: https://git.kernel.org/tip/8284bbeab75f1842dc11531356115c4d09abebc0 Author:Zou Wei AuthorDate:Tue, 28 Apr 2020 17:18:43 +08:00 Committer: Arnaldo Carvalho de Melo CommitterDate: Thu, 30 Apr 2020 10:48:32 -03:00 perf tools: Remove unneeded semicolons Fixes coccicheck warnings: tools/perf/builtin-diff.c:1565:2-3: Unneeded semicolon tools/perf/builtin-lock.c:778:2-3: Unneeded semicolon tools/perf/builtin-mem.c:126:2-3: Unneeded semicolon tools/perf/util/intel-pt-decoder/intel-pt-pkt-decoder.c:555:2-3: Unneeded semicolon tools/perf/util/ordered-events.c:317:2-3: Unneeded semicolon tools/perf/util/synthetic-events.c:1131:2-3: Unneeded semicolon tools/perf/util/trace-event-read.c:78:2-3: Unneeded semicolon Reported-by: Hulk Robot Signed-off-by: Zou Wei Cc: Alexander Shishkin Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lore.kernel.org/lkml/1588065523-71423-1-git-send-email-zou_...@huawei.com Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/builtin-diff.c | 2 +- tools/perf/builtin-lock.c | 2 +- tools/perf/builtin-mem.c| 2 +- tools/perf/util/intel-pt-decoder/intel-pt-pkt-decoder.c | 2 +- tools/perf/util/ordered-events.c| 2 +- tools/perf/util/synthetic-events.c | 2 +- tools/perf/util/trace-event-read.c | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/tools/perf/builtin-diff.c b/tools/perf/builtin-diff.c index c94a002..59d40f0 100644 --- a/tools/perf/builtin-diff.c +++ b/tools/perf/builtin-diff.c @@ -1562,7 +1562,7 @@ hpp__entry_pair(struct hist_entry *he, struct hist_entry *pair, default: BUG_ON(1); - }; + } } static void diff --git a/tools/perf/builtin-lock.c b/tools/perf/builtin-lock.c index 474dfd5..543d82f 100644 --- a/tools/perf/builtin-lock.c +++ b/tools/perf/builtin-lock.c @@ -775,7 +775,7 @@ static void dump_threads(void) pr_info("%10d: %s\n", st->tid, thread__comm_str(t)); node = rb_next(node); thread__put(t); - }; + } } static void dump_map(void) diff --git a/tools/perf/builtin-mem.c b/tools/perf/builtin-mem.c index a13f581..68a7eb8 100644 --- a/tools/perf/builtin-mem.c +++ b/tools/perf/builtin-mem.c @@ -123,7 +123,7 @@ static int __cmd_record(int argc, const char **argv, struct perf_mem *mem) rec_argv[i++] = "-e"; rec_argv[i++] = perf_mem_events__name(j); - }; + } if (all_user) rec_argv[i++] = "--all-user"; diff --git a/tools/perf/util/intel-pt-decoder/intel-pt-pkt-decoder.c b/tools/perf/util/intel-pt-decoder/intel-pt-pkt-decoder.c index 0ccf10a..4ce1099 100644 --- a/tools/perf/util/intel-pt-decoder/intel-pt-pkt-decoder.c +++ b/tools/perf/util/intel-pt-decoder/intel-pt-pkt-decoder.c @@ -552,7 +552,7 @@ static int intel_pt_do_get_packet(const unsigned char *buf, size_t len, break; default: break; - }; + } if (!(byte & BIT(0))) { if (byte == 0) diff --git a/tools/perf/util/ordered-events.c b/tools/perf/util/ordered-events.c index 359db2b..48c8f60 100644 --- a/tools/perf/util/ordered-events.c +++ b/tools/perf/util/ordered-events.c @@ -314,7 +314,7 @@ static int __ordered_events__flush(struct ordered_events *oe, enum oe_flush how, case OE_FLUSH__NONE: default: break; - }; + } pr_oe_time(oe->next_flush, "next_flush - ordered_events__flush PRE %s, nr_events %u\n", str[how], oe->nr_events); diff --git a/tools/perf/util/synthetic-events.c b/tools/perf/util/synthetic-events.c index 1ea9ada..89b3906 100644 --- a/tools/perf/util/synthetic-events.c +++ b/tools/perf/util/synthetic-events.c @@ -1181,7 +1181,7 @@ void cpu_map_data__synthesize(struct perf_record_cpu_map_data *data, struct perf synthesize_mask((struct perf_record_record_cpu_map *)data->data, map, max); default: break; - }; + } } static struct perf_record_cpu_map *cpu_map_event__new(struct perf_cpu_map *map) diff --git a/tools/perf/util/trace-event-read.c b/tools/perf/util/trace-event-read.c index 8593d3c..f507dff 100644 --- a/tools/perf/util/trace-event-read.c +++ b/tools/perf/util/trace-event-read.c @@ -75,7 +75,7 @@ static void skip(int size) r = size > BUFSIZ ? BUFSIZ : size; do_read(buf, r); size -= r; - }; + } } static unsigned int read4(struct tep_handle *pevent)
[tip: perf/core] perf c2c: Remove unneeded semicolon
The following commit has been merged into the perf/core branch of tip: Commit-ID: 2cca512ad2fe14d060838eaf8581cda600764141 Gitweb: https://git.kernel.org/tip/2cca512ad2fe14d060838eaf8581cda600764141 Author:Zou Wei AuthorDate:Tue, 28 Apr 2020 16:58:56 +08:00 Committer: Arnaldo Carvalho de Melo CommitterDate: Thu, 30 Apr 2020 10:48:32 -03:00 perf c2c: Remove unneeded semicolon Fixes coccicheck warnings: tools/perf/builtin-c2c.c:1712:2-3: Unneeded semicolon tools/perf/builtin-c2c.c:1928:2-3: Unneeded semicolon tools/perf/builtin-c2c.c:2962:2-3: Unneeded semicolon Reported-by: Hulk Robot Signed-off-by: Zou Wei Cc: Alexander Shishkin Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lore.kernel.org/lkml/1588064336-70456-1-git-send-email-zou_...@huawei.com Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/builtin-c2c.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/perf/builtin-c2c.c b/tools/perf/builtin-c2c.c index 0d544c4..0e14c18 100644 --- a/tools/perf/builtin-c2c.c +++ b/tools/perf/builtin-c2c.c @@ -1709,7 +1709,7 @@ static struct c2c_dimension *get_dimension(const char *name) if (!strcmp(dim->name, name)) return dim; - }; + } return NULL; } @@ -1925,7 +1925,7 @@ static bool he__display(struct hist_entry *he, struct c2c_stats *stats) FILTER_HITM(tot_hitm); default: break; - }; + } #undef FILTER_HITM @@ -2959,7 +2959,7 @@ static int perf_c2c__record(int argc, const char **argv) rec_argv[i++] = "-e"; rec_argv[i++] = perf_mem_events__name(j); - }; + } if (all_user) rec_argv[i++] = "--all-user";
[PATCH -next] drm/udl: Make udl_handle_damage static
Fix the following sparse warning: drivers/gpu/drm/udl/udl_modeset.c:269:5: warning: symbol 'udl_handle_damage' was not declared. Should it be static? Reported-by: Hulk Robot Signed-off-by: Zou Wei --- drivers/gpu/drm/udl/udl_modeset.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/udl/udl_modeset.c b/drivers/gpu/drm/udl/udl_modeset.c index 99518a8..fef43f4 100644 --- a/drivers/gpu/drm/udl/udl_modeset.c +++ b/drivers/gpu/drm/udl/udl_modeset.c @@ -266,8 +266,8 @@ static int udl_aligned_damage_clip(struct drm_rect *clip, int x, int y, return 0; } -int udl_handle_damage(struct drm_framebuffer *fb, int x, int y, - int width, int height) +static int udl_handle_damage(struct drm_framebuffer *fb, int x, int y, +int width, int height) { struct drm_device *dev = fb->dev; struct dma_buf_attachment *import_attach = fb->obj[0]->import_attach; -- 2.6.2
[PATCH -next] scsi: aacraid: Make some symbols static
Fix the following sparse warnings: drivers/scsi/aacraid/linit.c:867:6: warning: symbol 'aac_tmf_callback' was not declared. Should it be static? drivers/scsi/aacraid/linit.c:1081:5: warning: symbol 'aac_eh_host_reset' was not declared. Should it be static? drivers/scsi/aacraid/commsup.c:2354:5: warning: symbol 'aac_send_safw_hostttime' was not declared. Should it be static? drivers/scsi/aacraid/commsup.c:2383:5: warning: symbol 'aac_send_hosttime' was not declared. Should it be static? Reported-by: Hulk Robot Signed-off-by: Zou Wei --- drivers/scsi/aacraid/commsup.c | 4 ++-- drivers/scsi/aacraid/linit.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/scsi/aacraid/commsup.c b/drivers/scsi/aacraid/commsup.c index ddd73f6..8ee4e1a 100644 --- a/drivers/scsi/aacraid/commsup.c +++ b/drivers/scsi/aacraid/commsup.c @@ -2351,7 +2351,7 @@ static int aac_send_wellness_command(struct aac_dev *dev, char *wellness_str, goto out; } -int aac_send_safw_hostttime(struct aac_dev *dev, struct timespec64 *now) +static int aac_send_safw_hostttime(struct aac_dev *dev, struct timespec64 *now) { struct tm cur_tm; char wellness_str[] = "TD\010\0\0\0\0\0\0\0\0\0DW\0\0ZZ"; @@ -2380,7 +2380,7 @@ int aac_send_safw_hostttime(struct aac_dev *dev, struct timespec64 *now) return ret; } -int aac_send_hosttime(struct aac_dev *dev, struct timespec64 *now) +static int aac_send_hosttime(struct aac_dev *dev, struct timespec64 *now) { int ret = -ENOMEM; struct fib *fibptr; diff --git a/drivers/scsi/aacraid/linit.c b/drivers/scsi/aacraid/linit.c index a0a2b3a..a308e86 100644 --- a/drivers/scsi/aacraid/linit.c +++ b/drivers/scsi/aacraid/linit.c @@ -864,7 +864,7 @@ static u8 aac_eh_tmf_hard_reset_fib(struct aac_hba_map_info *info, return HBA_IU_TYPE_SATA_REQ; } -void aac_tmf_callback(void *context, struct fib *fibptr) +static void aac_tmf_callback(void *context, struct fib *fibptr) { struct aac_hba_resp *err = &((struct aac_native_hba *)fibptr->hw_fib_va)->resp.err; @@ -1078,7 +1078,7 @@ static int aac_eh_bus_reset(struct scsi_cmnd* cmd) * @scsi_cmd: SCSI command block causing the reset * */ -int aac_eh_host_reset(struct scsi_cmnd *cmd) +static int aac_eh_host_reset(struct scsi_cmnd *cmd) { struct scsi_device * dev = cmd->device; struct Scsi_Host * host = dev->host; -- 2.6.2
[PATCH -next] drm/amdgpu: Fix warning Comparison to bool
fix below warnings reported by coccicheck drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c:630:5-11: WARNING: Comparison to bool Reported-by: Hulk Robot Signed-off-by: Zou Wei --- drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c b/drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c index b544baf..10080e4 100644 --- a/drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c +++ b/drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c @@ -627,7 +627,7 @@ static void sdma_v5_0_enable(struct amdgpu_device *adev, bool enable) u32 f32_cntl; int i; - if (enable == false) { + if (!enable) { sdma_v5_0_gfx_stop(adev); sdma_v5_0_rlc_stop(adev); } -- 2.6.2
[PATCH -next] drm/amd/display: Fix unsigned comparison to zero
Fixes coccicheck warning: drivers/gpu/drm/amd/display/dc/dcn21/dcn21_resource.c:1398:60-61: WARNING: Unsigned expression compared with zero: j >= 0 Fixes: 238387774232 ("drm/amd/display: fix rn soc bb update") Reported-by: Hulk Robot Signed-off-by: Zou Wei --- drivers/gpu/drm/amd/display/dc/dcn21/dcn21_resource.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/display/dc/dcn21/dcn21_resource.c b/drivers/gpu/drm/amd/display/dc/dcn21/dcn21_resource.c index ceaf70a..419cdde 100644 --- a/drivers/gpu/drm/amd/display/dc/dcn21/dcn21_resource.c +++ b/drivers/gpu/drm/amd/display/dc/dcn21/dcn21_resource.c @@ -1384,7 +1384,8 @@ static void update_bw_bounding_box(struct dc *dc, struct clk_bw_params *bw_param struct dcn21_resource_pool *pool = TO_DCN21_RES_POOL(dc->res_pool); struct clk_limit_table *clk_table = _params->clk_table; struct _vcs_dpi_voltage_scaling_st clock_limits[DC__VOLTAGE_STATES]; - unsigned int i, j, closest_clk_lvl; + unsigned int i, closest_clk_lvl; + int j; // Default clock levels are used for diags, which may lead to overclocking. if (!IS_DIAG_DC(dc->ctx->dce_environment)) { -- 2.6.2
[PATCH -next] KVM: MIPS/Emulate: Remove unneeded semicolon
Fixes coccicheck warnings: arch/mips/kvm/emulate.c:1793:3-4: Unneeded semicolon arch/mips/kvm/emulate.c:1968:3-4: Unneeded semicolon Reported-by: Hulk Robot Signed-off-by: Zou Wei --- arch/mips/kvm/emulate.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/mips/kvm/emulate.c b/arch/mips/kvm/emulate.c index 754094b..5c88bd1 100644 --- a/arch/mips/kvm/emulate.c +++ b/arch/mips/kvm/emulate.c @@ -1790,7 +1790,7 @@ static enum emulation_result kvm_mips_guest_cache_op(int (*fn)(unsigned long), return EMULATE_EXCEPT; default: break; - }; + } } } @@ -1965,7 +1965,7 @@ enum emulation_result kvm_mips_emulate_inst(u32 cause, u32 *opc, break; default: goto unknown; - }; + } break; unknown: #endif -- 2.6.2
[PATCH -next] KVM: MIPS/VZ: Remove unneeded semicolon
Fixes coccicheck warnings: arch/mips/kvm/vz.c:1186:4-5: Unneeded semicolon arch/mips/kvm/vz.c:1195:3-4: Unneeded semicolon arch/mips/kvm/vz.c:1949:3-4: Unneeded semicolon arch/mips/kvm/vz.c:1121:2-3: Unneeded semicolon arch/mips/kvm/vz.c:2188:3-4: Unneeded semicolon Reported-by: Hulk Robot Signed-off-by: Zou Wei --- arch/mips/kvm/vz.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/arch/mips/kvm/vz.c b/arch/mips/kvm/vz.c index dde2088..389dd0f 100644 --- a/arch/mips/kvm/vz.c +++ b/arch/mips/kvm/vz.c @@ -1118,7 +1118,7 @@ static enum emulation_result kvm_vz_gpsi_cache(union mips_instruction inst, break; default: break; - }; + } kvm_err("@ %#lx/%#lx CACHE (cache: %#x, op: %#x, base[%d]: %#lx, offset: %#x\n", curr_pc, vcpu->arch.gprs[31], cache, op, base, arch->gprs[base], @@ -1183,7 +1183,7 @@ static enum emulation_result kvm_trap_vz_handle_gpsi(u32 cause, u32 *opc, trace_kvm_hwr(vcpu, KVM_TRACE_RDHWR, KVM_TRACE_HWR(rd, sel), 0); goto unknown; - }; + } trace_kvm_hwr(vcpu, KVM_TRACE_RDHWR, KVM_TRACE_HWR(rd, sel), arch->gprs[rt]); @@ -1192,7 +1192,7 @@ static enum emulation_result kvm_trap_vz_handle_gpsi(u32 cause, u32 *opc, break; default: goto unknown; - }; + } break; unknown: @@ -1946,7 +1946,7 @@ static int kvm_vz_get_one_reg(struct kvm_vcpu *vcpu, default: *v = (long)kvm_read_c0_guest_prid(cop0); break; - }; + } break; case KVM_REG_MIPS_CP0_EBASE: *v = kvm_vz_read_gc0_ebase(); @@ -2185,7 +2185,7 @@ static int kvm_vz_set_one_reg(struct kvm_vcpu *vcpu, default: kvm_write_c0_guest_prid(cop0, v); break; - }; + } break; case KVM_REG_MIPS_CP0_EBASE: kvm_vz_write_gc0_ebase(v); -- 2.6.2
[PATCH -next] dlm: Remove unneeded semicolon
Fixes coccicheck warning: fs/dlm/rcom.c:566:2-3: Unneeded semicolon Reported-by: Hulk Robot Signed-off-by: Zou Wei --- fs/dlm/rcom.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/dlm/rcom.c b/fs/dlm/rcom.c index e3d9f72..4daf5dc 100644 --- a/fs/dlm/rcom.c +++ b/fs/dlm/rcom.c @@ -563,7 +563,7 @@ void dlm_receive_rcom(struct dlm_ls *ls, struct dlm_rcom *rc, int nodeid) lock = 1; reply = 1; break; - }; + } spin_lock(>ls_recover_lock); status = ls->ls_recover_status; -- 2.6.2
[PATCH -next] NTFS: Remove unneeded semicolon
Fixes coccicheck warnings: fs/ntfs/lcnalloc.c:902:2-3: Unneeded semicolon fs/ntfs/super.c:1615:2-3: Unneeded semicolon fs/ntfs/super.c:1684:2-3: Unneeded semicolon Reported-by: Hulk Robot Signed-off-by: Zou Wei --- fs/ntfs/lcnalloc.c | 2 +- fs/ntfs/super.c| 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/fs/ntfs/lcnalloc.c b/fs/ntfs/lcnalloc.c index eda9972..66c2b29 100644 --- a/fs/ntfs/lcnalloc.c +++ b/fs/ntfs/lcnalloc.c @@ -899,7 +899,7 @@ s64 __ntfs_cluster_free(ntfs_inode *ni, const VCN start_vcn, s64 count, } /* We have freed @to_free real clusters. */ real_freed = to_free; - }; + } /* Go to the next run and adjust the number of clusters left to free. */ ++rl; if (count >= 0) diff --git a/fs/ntfs/super.c b/fs/ntfs/super.c index 7dc3bc6..d78d312 100644 --- a/fs/ntfs/super.c +++ b/fs/ntfs/super.c @@ -1612,7 +1612,7 @@ static bool load_and_init_attrdef(ntfs_volume *vol) memcpy((u8*)vol->attrdef + (index++ << PAGE_SHIFT), page_address(page), size); ntfs_unmap_page(page); - }; + } if (size == PAGE_SIZE) { size = i_size & ~PAGE_MASK; if (size) @@ -1681,7 +1681,7 @@ static bool load_and_init_upcase(ntfs_volume *vol) memcpy((char*)vol->upcase + (index++ << PAGE_SHIFT), page_address(page), size); ntfs_unmap_page(page); - }; + } if (size == PAGE_SIZE) { size = i_size & ~PAGE_MASK; if (size) -- 2.6.2
[PATCH -next] hpfs: Remove unneeded semicolon
Fixes coccicheck warning: fs/hpfs/buffer.c:56:2-3: Unneeded semicolon Reported-by: Hulk Robot Signed-off-by: Zou Wei --- fs/hpfs/buffer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/hpfs/buffer.c b/fs/hpfs/buffer.c index e285d6b..d392468 100644 --- a/fs/hpfs/buffer.c +++ b/fs/hpfs/buffer.c @@ -53,7 +53,7 @@ void hpfs_prefetch_sectors(struct super_block *s, unsigned secno, int n) return; } brelse(bh); - }; + } blk_start_plug(); while (n > 0) { -- 2.6.2
[PATCH -next v3] hinic: Use ARRAY_SIZE for nic_vf_cmd_msg_handler
fix coccinelle warning, use ARRAY_SIZE drivers/net/ethernet/huawei/hinic/hinic_sriov.c:713:43-44: WARNING: Use ARRAY_SIZE v1-->v2: remove cmd_number v2-->v3: preserve the reverse christmas tree ordering of local variables Reported-by: Hulk Robot Signed-off-by: Zou Wei --- drivers/net/ethernet/huawei/hinic/hinic_sriov.c | 8 +++- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/net/ethernet/huawei/hinic/hinic_sriov.c b/drivers/net/ethernet/huawei/hinic/hinic_sriov.c index b24788e..c851145 100644 --- a/drivers/net/ethernet/huawei/hinic/hinic_sriov.c +++ b/drivers/net/ethernet/huawei/hinic/hinic_sriov.c @@ -704,17 +704,15 @@ int nic_pf_mbox_handler(void *hwdev, u16 vf_id, u8 cmd, void *buf_in, struct hinic_hwdev *dev = hwdev; struct hinic_func_to_io *nic_io; struct hinic_pfhwdev *pfhwdev; - u32 i, cmd_number; int err = 0; + u32 i; if (!hwdev) return -EFAULT; - cmd_number = sizeof(nic_vf_cmd_msg_handler) / - sizeof(struct vf_cmd_msg_handle); pfhwdev = container_of(dev, struct hinic_pfhwdev, hwdev); nic_io = >func_to_io; - for (i = 0; i < cmd_number; i++) { + for (i = 0; i < ARRAY_SIZE(nic_vf_cmd_msg_handler); i++) { vf_msg_handle = _vf_cmd_msg_handler[i]; if (cmd == vf_msg_handle->cmd && vf_msg_handle->cmd_msg_handler) { @@ -725,7 +723,7 @@ int nic_pf_mbox_handler(void *hwdev, u16 vf_id, u8 cmd, void *buf_in, break; } } - if (i == cmd_number) + if (i == ARRAY_SIZE(nic_vf_cmd_msg_handler)) err = hinic_msg_to_mgmt(>pf_to_mgmt, HINIC_MOD_L2NIC, cmd, buf_in, in_size, buf_out, out_size, HINIC_MGMT_MSG_SYNC); -- 2.6.2
[PATCH -next] drm/dp_mst: use false for bool variable
Fixes coccicheck warning: drivers/gpu/drm/drm_dp_mst_topology.c:2229:6-13: WARNING: Assignment of 0/1 to bool variable Reported-by: Hulk Robot Signed-off-by: Zou Wei --- drivers/gpu/drm/drm_dp_mst_topology.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c b/drivers/gpu/drm/drm_dp_mst_topology.c index 1e26b89..1ce13c5 100644 --- a/drivers/gpu/drm/drm_dp_mst_topology.c +++ b/drivers/gpu/drm/drm_dp_mst_topology.c @@ -2226,7 +2226,7 @@ drm_dp_mst_handle_link_address_port(struct drm_dp_mst_branch *mstb, struct drm_dp_mst_port *port; int old_ddps = 0, ret; u8 new_pdt = DP_PEER_DEVICE_NONE; - bool new_mcs = 0; + bool new_mcs = false; bool created = false, send_link_addr = false, changed = false; port = drm_dp_get_port(mstb, port_msg->port_number); -- 2.6.2
[PATCH -next v2] hinic: Use ARRAY_SIZE for nic_vf_cmd_msg_handler
fix coccinelle warning, use ARRAY_SIZE drivers/net/ethernet/huawei/hinic/hinic_sriov.c:713:43-44: WARNING: Use ARRAY_SIZE -- v1-->v2: remove cmd_number Reported-by: Hulk Robot Signed-off-by: Zou Wei --- drivers/net/ethernet/huawei/hinic/hinic_sriov.c | 8 +++- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/net/ethernet/huawei/hinic/hinic_sriov.c b/drivers/net/ethernet/huawei/hinic/hinic_sriov.c index b24788e..af70cca 100644 --- a/drivers/net/ethernet/huawei/hinic/hinic_sriov.c +++ b/drivers/net/ethernet/huawei/hinic/hinic_sriov.c @@ -704,17 +704,15 @@ int nic_pf_mbox_handler(void *hwdev, u16 vf_id, u8 cmd, void *buf_in, struct hinic_hwdev *dev = hwdev; struct hinic_func_to_io *nic_io; struct hinic_pfhwdev *pfhwdev; - u32 i, cmd_number; + u32 i; int err = 0; if (!hwdev) return -EFAULT; - cmd_number = sizeof(nic_vf_cmd_msg_handler) / - sizeof(struct vf_cmd_msg_handle); pfhwdev = container_of(dev, struct hinic_pfhwdev, hwdev); nic_io = >func_to_io; - for (i = 0; i < cmd_number; i++) { + for (i = 0; i < ARRAY_SIZE(nic_vf_cmd_msg_handler); i++) { vf_msg_handle = _vf_cmd_msg_handler[i]; if (cmd == vf_msg_handle->cmd && vf_msg_handle->cmd_msg_handler) { @@ -725,7 +723,7 @@ int nic_pf_mbox_handler(void *hwdev, u16 vf_id, u8 cmd, void *buf_in, break; } } - if (i == cmd_number) + if (i == ARRAY_SIZE(nic_vf_cmd_msg_handler)) err = hinic_msg_to_mgmt(>pf_to_mgmt, HINIC_MOD_L2NIC, cmd, buf_in, in_size, buf_out, out_size, HINIC_MGMT_MSG_SYNC); -- 2.6.2
[PATCH -next] hinic: Use kmemdup instead of kzalloc and memcpy
Fixes coccicheck warnings: drivers/net/ethernet/huawei/hinic/hinic_hw_mbox.c:452:17-24: WARNING opportunity for kmemdup drivers/net/ethernet/huawei/hinic/hinic_hw_mbox.c:458:23-30: WARNING opportunity for kmemdup Reported-by: Hulk Robot Signed-off-by: Zou Wei --- drivers/net/ethernet/huawei/hinic/hinic_hw_mbox.c | 9 +++-- 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/net/ethernet/huawei/hinic/hinic_hw_mbox.c b/drivers/net/ethernet/huawei/hinic/hinic_hw_mbox.c index f8626df..a39cc16 100644 --- a/drivers/net/ethernet/huawei/hinic/hinic_hw_mbox.c +++ b/drivers/net/ethernet/huawei/hinic/hinic_hw_mbox.c @@ -449,18 +449,15 @@ static void recv_mbox_handler(struct hinic_mbox_func_to_func *func_to_func, return; } - rcv_mbox_temp = kzalloc(sizeof(*rcv_mbox_temp), GFP_KERNEL); + rcv_mbox_temp = kmemdup(recv_mbox, sizeof(*rcv_mbox_temp), GFP_KERNEL); if (!rcv_mbox_temp) return; - memcpy(rcv_mbox_temp, recv_mbox, sizeof(*rcv_mbox_temp)); - - rcv_mbox_temp->mbox = kzalloc(MBOX_MAX_BUF_SZ, GFP_KERNEL); + rcv_mbox_temp->mbox = kmemdup(recv_mbox->mbox, MBOX_MAX_BUF_SZ, + GFP_KERNEL); if (!rcv_mbox_temp->mbox) goto err_alloc_rcv_mbox_msg; - memcpy(rcv_mbox_temp->mbox, recv_mbox->mbox, MBOX_MAX_BUF_SZ); - rcv_mbox_temp->buf_out = kzalloc(MBOX_MAX_BUF_SZ, GFP_KERNEL); if (!rcv_mbox_temp->buf_out) goto err_alloc_rcv_mbox_buf; -- 2.6.2