[PATCH] crypto: atmel - fix data types for __be{32,64}

2019-10-16 Thread Ben Dooks (Codethink)
The driver uses a couple of buffers that seem to be __be32 or __be64 fields, but declares them as u32. This means there are a number of warnings from sparse due to casting to/from __beXXX. Fix these by changing the types of the buffer and the associated variables.

[PATCH] pstore: make 'pstore_choose_compression' static

2019-10-16 Thread Ben Dooks (Codethink)
The pstore_choose_compression function is not exported so make it static to avoid the following sparse warning: fs/pstore/platform.c:796:13: warning: symbol 'pstore_choose_compression' was not declared. Should it be static? Signed-off-by: Ben Dooks --- Cc: Kees Cook Cc: Anton Vorontsov Cc:

[PATCH] [V2] NFSv4: add declaration of current_stateid

2019-10-16 Thread Ben Dooks (Codethink)
From: Ben Dooks The current_stateid is exported from nfs4state.c but not declared in any of the headers. Add to nfs4_fs.h to remove the following warning: fs/nfs/nfs4state.c:80:20: warning: symbol 'current_stateid' was not declared. Should it be static? Signed-off-by: Ben Dooks --- Cc: Trond

[PATCH] irqchip/gic-v3-its: fix u64 to __le64 warnings

2019-10-17 Thread Ben Dooks (Codethink)
The its_cmd_block struct can either have u64 or __le64 data in it, so make a anonymous union to remove the sparse warnings when converting to/from these. Signed-off-by: Ben Dooks --- Cc: Thomas Gleixner Cc: Jason Cooper Cc: Marc Zyngier Cc: linux-arm-ker...@lists.infradead.org Cc:

[PATCH] pcmcia: include cs_internal.h for missing declarations

2019-10-17 Thread Ben Dooks (Codethink)
Include cs_internal.h (and pcmcia/cistpl.h as required by cs_internal.h) for the declearions of cb_alloc and cb_free to silence the following sparse warnings; drivers/pcmcia/cardbus.c:64:11: warning: symbol 'cb_alloc' was not declared. Should it be static? drivers/pcmcia/cardbus.c:103:6:

[PATCH] pcmcia: include for pcmcia_parse_tuple

2019-10-17 Thread Ben Dooks (Codethink)
Include for pcmcia_parse_tuple declaration to fix the following sparse warning: drivers/pcmcia/cistpl.c:1287:5: warning: symbol 'pcmcia_parse_tuple' was not declared. Should it be static? Signed-off-by: Ben Dooks --- Cc: Dominik Brodowski Cc: Greg Kroah-Hartman Cc:

[PATCH] rapidio: fix missing include of

2019-10-17 Thread Ben Dooks (Codethink)
Include for the missing declarations of functions exported from this file. Fixes the following sparse warnings: drivers/rapidio/rio-driver.c:53:16: warning: symbol 'rio_dev_get' was not declared. Should it be static? drivers/rapidio/rio-driver.c:70:6: warning: symbol 'rio_dev_put' was not

[PATCH] rapidio: fix missing include of

2019-10-17 Thread Ben Dooks (Codethink)
Include for the missing declarations of functions exported from this file. Fixes the following sparse warnings: drivers/rapidio/rio-access.c:59:1: warning: symbol '__rio_local_read_config_8' was not declared. Should it be static? drivers/rapidio/rio-access.c:60:1: warning: symbol

[PATCH] remoteproc: fix argument 2 of rproc_mem_entry_init

2019-10-17 Thread Ben Dooks (Codethink)
The rproc_mem_entry_init() call takes a pointer to a vm as the second argument. The code is currently using a plain 0 as "NULL". Change to using NULL to fix the following sparse warnings: drivers/remoteproc/remoteproc_core.c:339:49: warning: Using plain integer as NULL pointer

[PATCH] ptp_pch: include ethernet driver for external functions

2019-10-18 Thread Ben Dooks (Codethink)
or if not, where should the declarations go? Signed-off-by: Ben Dooks (Codethink) --- Cc: Richard Cochran Cc: net...@vger.kernel.org Cc: linux-kernel@vger.kernel.org --- drivers/ptp/ptp_pch.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/ptp/ptp_pch.c b/drivers/ptp/ptp_pch.c index

[PATCH] cpu-topology: declare parse_acpi_topology in

2019-10-22 Thread Ben Dooks (Codethink)
The parse_acpi_topology() is not declared anywhere which causes the following sparse warning: drivers/base/arch_topology.c:522:19: warning: symbol 'parse_acpi_topology' was not declared. Should it be static? Signed-off-by: Ben Dooks (Codethink) --- Cc: Sudeep Holla Cc: linux-kernel

[PATCH] xdp: fix type of string pointer in __XDP_ACT_SYM_TAB

2019-10-22 Thread Ben Dooks (Codethink)
integer as NULL pointer ./include/trace/events/xdp.h:356:1: warning: Using plain integer as NULL pointer ./include/trace/events/xdp.h:390:1: warning: Using plain integer as NULL pointer Signed-off-by: Ben Dooks (Codethink) --- Cc: Alexei Starovoitov Cc: Daniel Borkmann Cc: Martin KaFai Lau Cc: Song

[PATCH] timers/sched_clock: include local timekeeping.h for missing declarations

2019-10-22 Thread Ben Dooks (Codethink)
: symbol 'sched_clock_resume' was not declared. Should it be static? Signed-off-by: Ben Dooks (Codethink) --- Cc: Thomas Gleixner Cc: linux-kernel@vger.kernel.org --- kernel/time/sched_clock.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kernel/time/sched_clock.c b/kernel/time/sched_clock.c

[PATCH] ipv6: include for missing declarations

2019-10-22 Thread Ben Dooks (Codethink)
'in6_dev_finish_destroy' was not declared. Should it be static? Signed-off-by: Ben Dooks (Codethink) --- Cc: "David S. Miller" Cc: Alexey Kuznetsov Cc: Hideaki YOSHIFUJI Cc: net...@vger.kernel.org Cc: linux-kernel@vger.kernel.org --- net/ipv6/addrconf_core.c | 1 + 1 file changed, 1

[PATCH] pinctrl: amd: fix __iomem annotation in amd_gpio_irq_handler()

2019-10-22 Thread Ben Dooks (Codethink)
] * drivers/pinctrl/pinctrl-amd.c:587:25: warning: incorrect type in argument 2 (different address spaces) drivers/pinctrl/pinctrl-amd.c:587:25:expected void volatile [noderef] *addr drivers/pinctrl/pinctrl-amd.c:587:25:got unsigned int [usertype] * Signed-off-by: Ben Dooks (Codethink

[PATCH] net: hwbm: if CONFIG_NET_HWBM unset, make stub functions static

2019-10-22 Thread Ben Dooks (Codethink)
? Signed-off-by: Ben Dooks (Codethink) --- Cc: "David S. Miller" Cc: net...@vger.kernel.org Cc: linux-kernel@vger.kernel.org --- include/net/hwbm.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/net/hwbm.h b/include/net/hwbm.h index 81643cf8a1c4..cb

[PATCH] net: mvneta: make stub functions static inline

2019-10-22 Thread Ben Dooks (Codethink)
it be static? drivers/net/ethernet/marvell/mvneta_bm.h:182:6: warning: symbol 'mvneta_bm_put' was not declared. Should it be static? Signed-off-by: Ben Dooks (Codethink) --- Cc: "David S. Miller" Cc: net...@vger.kernel.org Cc: linux-kernel@vger.kernel.org --- drivers/net/ethern

[PATCH] [V2] net: hwbm: if CONFIG_NET_HWBM unset, make stub functions static

2019-10-22 Thread Ben Dooks (Codethink)
? ./include/net/hwbm.h:25:5: warning: symbol 'hwbm_pool_refill' was not declared. Should it be static? ./include/net/hwbm.h:26:5: warning: symbol 'hwbm_pool_add' was not declared. Should it be static? Signed-off-by: Ben Dooks (Codethink) --- Cc: "David S. Miller" Cc: net...@vger.kernel.org

[PATCH] xfs: add mising include of xfs_pnfs.h for missing declarations

2019-10-22 Thread Ben Dooks (Codethink)
: warning: symbol 'xfs_fs_get_uuid' was not declared. Should it be static? fs/xfs/xfs_pnfs.c:77:1: warning: symbol 'xfs_fs_map_blocks' was not declared. Should it be static? fs/xfs/xfs_pnfs.c:226:1: warning: symbol 'xfs_fs_commit_blocks' was not declared. Should it be static? Signed-off-by: Ben Dooks

[PATCH] [V2] net: mvneta: make stub functions static inline

2019-10-23 Thread Ben Dooks (Codethink)
it be static? drivers/net/ethernet/marvell/mvneta_bm.h:182:6: warning: symbol 'mvneta_bm_put' was not declared. Should it be static? Signed-off-by: Ben Dooks (Codethink) --- Cc: "David S. Miller" Cc: net...@vger.kernel.org Cc: linux-kernel@vger.kernel.org v2: - fixup formatting of chan

[PATCH] [V3] net: hwbm: if CONFIG_NET_HWBM unset, make stub functions static

2019-10-23 Thread Ben Dooks (Codethink)
? ./include/net/hwbm.h:25:5: warning: symbol 'hwbm_pool_refill' was not declared. Should it be static? ./include/net/hwbm.h:26:5: warning: symbol 'hwbm_pool_add' was not declared. Should it be static? Signed-off-by: Ben Dooks (Codethink) --- Cc: "David S. Miller" Cc: net...@vger.kernel.org

[PATCH] USB: musb: fix __iomem in trace functions

2019-10-15 Thread Ben Dooks (Codethink)
The trace functions should have __iomem on the addr pointers. Add __iomem to avoid the following warnings from sparse: drivers/usb/musb/musb_core.c:253:55: warning: incorrect type in argument 2 (different address spaces) drivers/usb/musb/musb_core.c:253:55:expected void const *addr

[PATCH] usb: xhci: fix __le32/__le64 accessors in debugfs code

2019-10-15 Thread Ben Dooks (Codethink)
It looks like some of the xhci debug code is passing u32 to functions directly from __le32/__le64 fields. Fix this by using le{32,64}_to_cpu() on these to fix the following sparse warnings; drivers/usb/host/xhci-debugfs.c:205:62: warning: incorrect type in argument 1 (different base types)

[PATCH] usb: renesas_usbhs: fix type of buf

2019-10-15 Thread Ben Dooks (Codethink)
Fix the type of buf in __usbhsg_recip_send_status to be __le16 to avoid the following sparse warning: drivers/usb/renesas_usbhs/mod_gadget.c:335:14: warning: incorrect type in assignment (different base types) drivers/usb/renesas_usbhs/mod_gadget.c:335:14:expected unsigned short

[PATCH] decompressor: fix undeclared items

2019-10-15 Thread Ben Dooks (Codethink)
The follow items are not declared but also not exported so use __attribute__((__externally_visible__)) to silence the following sparse warnings: ./include/linux/decompress/mm.h:31:30: warning: symbol 'malloc_ptr' was not declared. Should it be static? ./include/linux/decompress/mm.h:32:20:

[PATCH] usb: renesas_usbhs: fix __le16 warnings

2019-10-15 Thread Ben Dooks (Codethink)
Fix the warnings generated by casting to/from __le16 without using the correct functions. Fixes the following sparse warnings: drivers/usb/renesas_usbhs/common.c:165:25: warning: incorrect type in assignment (different base types) drivers/usb/renesas_usbhs/common.c:165:25:expected

[PATCH] power: reset: fix __le32 cast in reset code

2019-10-15 Thread Ben Dooks (Codethink)
The writel() takes standard integers, not __le32 so fix the following sparse warnings by removing the cpu_to_le32() calls. drivers/power/reset/at91-reset.c:134:9: warning: cast from restricted __le32 drivers/power/reset/at91-reset.c:143:9: warning: cast from restricted __le32 This has made no

[PATCH 2/2] phy: phy-brcm-usb-init: fix use of integer as pointer

2019-10-15 Thread Ben Dooks (Codethink)
The xhci_ec_base variable is a pointer, so don't compare it with an integer. Signed-off-by: Ben Dooks --- Cc: Al Cooper Cc: Kishon Vijay Abraham I Cc: linux-kernel@vger.kernel.org Cc: bcm-kernel-feedback-l...@broadcom.com --- drivers/phy/broadcom/phy-brcm-usb-init.c | 2 +- 1 file changed, 1

[PATCH 1/2] phy: phy-brcm-usb-init: fix __iomem annotations

2019-10-15 Thread Ben Dooks (Codethink)
The register address should have __iomem attributes so fix this to remove the following sparse warnings: drivers/phy/broadcom/phy-brcm-usb-init.c:459:30: warning: cast removes address space '' of expression drivers/phy/broadcom/phy-brcm-usb-init.c:459:30: warning: incorrect type in argument 2

[PATCH] pci: iproc-msi: fix __iomem annotation in decode_msi_hwirq()

2019-10-15 Thread Ben Dooks (Codethink)
Fix __iomem attribute on msg variable passed to readl() in the decode_msi_hwirq() function. Fixes the following sparse warning: drivers/pci/controller/pcie-iproc-msi.c:301:17: warning: incorrect type in argument 1 (different address spaces) drivers/pci/controller/pcie-iproc-msi.c:301:17:

[PATCH] PCI: mvebu: make mvebu_pci_bridge_emul_ops static

2019-10-15 Thread Ben Dooks (Codethink)
The mvebu_pci_bridge_emul_ops is not exported outside of the driver, so make it static to avoid the following sparse warning: drivers/pci/controller/pci-mvebu.c:557:28: warning: symbol 'mvebu_pci_bridge_emul_ops' was not declared. Should it be static? Signed-off-by: Ben Dooks --- Cc: Thomas

[PATCH] PCI: mvebu: mvebu_pcie_map_registers __iomem fix

2019-10-15 Thread Ben Dooks (Codethink)
Fix the return type of mvebu_pcie_map_registers in the error path to have __iomem on it. Fixes the following sparse warning: drivers/pci/controller/pci-mvebu.c:716:31: warning: incorrect type in return expression (different address spaces) drivers/pci/controller/pci-mvebu.c:716:31:expected

[PATCH] davinci_cpdma: make cpdma_chan_split_pool static

2019-10-15 Thread Ben Dooks (Codethink)
The cpdma_chan_split_pool() function is not used outside of the driver, so make it static to avoid the following sparse warning: drivers/net/ethernet/ti/davinci_cpdma.c:725:5: warning: symbol 'cpdma_chan_split_pool' was not declared. Should it be static? Signed-off-by: Ben Dooks --- Cc:

[PATCH] net: stmmac: make tc_flow_parsers static

2019-10-15 Thread Ben Dooks (Codethink)
The tc_flow_parsers is not used outside of the driver, so make it static to avoid the following sparse warning: drivers/net/ethernet/stmicro/stmmac/stmmac_tc.c:516:3: warning: symbol 'tc_flow_parsers' was not declared. Should it be static? Signed-off-by: Ben Dooks --- Cc: Giuseppe Cavallaro

[PATCH] net: stmmac: fix argument to stmmac_pcs_ctrl_ane()

2019-10-15 Thread Ben Dooks (Codethink)
The stmmac_pcs_ctrl_ane() expects a register address as argument 1, but for some reason the mac_device_info is being passed. Fix the warning (and possible bug) from sparse: drivers/net/ethernet/stmicro/stmmac/stmmac_main.c:2613:17: warning: incorrect type in argument 1 (different address

[PATCH] [V2] PCI: sysfs: remove pci_bridge_groups and pcie_dev_groups

2019-10-16 Thread Ben Dooks (Codethink)
From: Ben Dooks The pci_bridge_groups and pcie_dev_groups objects are not exported and not used at-all, so remove them to fix the following warnings from sparse: drivers/pci/pci-sysfs.c:1546:30: warning: symbol 'pci_bridge_groups' was not declared. Should it be static?

[PATCH] net: stmmac: fix argument to stmmac_pcs_ctrl_ane()

2019-10-16 Thread Ben Dooks (Codethink)
The stmmac_pcs_ctrl_ane() expects a register address as argument 1, but for some reason the mac_device_info is being passed. Fix the warning (and possible bug) from sparse: drivers/net/ethernet/stmicro/stmmac/stmmac_main.c:2613:17: warning: incorrect type in argument 1 (different address

[PATCH] mm: include for vm_committed_as_batch

2019-10-16 Thread Ben Dooks (Codethink)
mm_init.c needs to include for the definition of vm_committed_as_batch. Fixes the following sparse warning: mm/mm_init.c:141:5: warning: symbol 'vm_committed_as_batch' was not declared. Should it be static? Signed-off-by: Ben Dooks --- Cc: Andrew Morton Cc: linux...@kvack.org Cc:

[PATCH] mm: huge_pte_offset() returns pte_t *, not integer

2019-10-16 Thread Ben Dooks (Codethink)
The huge_pte_offset() returns a pte_t *, not an integer so when huge-tlb is off, the replacement inline macro should return a pte_t * too. This fixes the following sparse warning: mm/page_vma_mapped.c:156:29: warning: Using plain integer as NULL pointer Signed-off-by: Ben Dooks --- Cc: Mike

[PATCH] fsnotify/fdinfo: exportfs_encode_inode_fh() takes pointer as 4th argument

2019-10-16 Thread Ben Dooks (Codethink)
The call to exportfs_encode_inode_fh() takes an pointer as the 4th argument, so replace the integer 0 with the NULL pointer. This fixes the following sparse warning: fs/notify/fdinfo.c:53:87: warning: Using plain integer as NULL pointer Signed-off-by: Ben Dooks --- Cc: Jan Kara Cc: Amir

[PATCH] ubifs: force prandom result to __le32

2019-10-16 Thread Ben Dooks (Codethink)
In set_dent_cookie() the result of prandom_u32() is assinged to an __le32 type. Make this a forced conversion to remove the following sparse warning: fs/ubifs/journal.c:506:30: warning: incorrect type in assignment (different base types) fs/ubifs/journal.c:506:30:expected restricted __le32

[PATCH] ubifs: possible missed le64_to_cpu() in journal

2019-10-16 Thread Ben Dooks (Codethink)
In the ubifs_jnl_write_inode() functon, it calls ubifs_iget() with xent->inum. The xent->inum is __le64, but the ubifs_iget() takes native cpu endian. I think that this should be changed to passing le64_to_cpu(xent->inum) to fix the following sparse warning: fs/ubifs/journal.c:902:58: warning:

[PATCH] ubifs: fix type of sup->hash_algo

2019-10-16 Thread Ben Dooks (Codethink)
The sup->hash_algo is a __le16, and whilst 0x is the same in __le16 and u16, it would be better to use cpu_to_le16() anyway (which should deal with constants) and silence the following sparse warning: fs/ubifs/sb.c:187:32: warning: incorrect type in assignment (different base types)

[PATCH] fs/direct-io: include internal.h for sb_init_dio_done_wq

2019-10-16 Thread Ben Dooks (Codethink)
The sb_init_dio_done_wq() is declared in internal.h but fs/direct-io.c does not include this file. Fix the warning by including internal.h fs/direct-io.c:612:5: warning: symbol 'sb_init_dio_done_wq' was not declared. Should it be static? Signed-off-by: Ben Dooks --- Cc: Alexander Viro Cc:

[PATCH] char/random: include for add_hwgenerator_randomness

2019-10-16 Thread Ben Dooks (Codethink)
The add_hwgenerator_randomness() is declared in but this is not being included in drivers/char/random.c so fix the following sparse warning by including it: drivers/char/random.c:2489:6: warning: symbol 'add_hwgenerator_randomness' was not declared. Should it be static? Signed-off-by: Ben

[PATCH] net: bpf: add static in net/core/filter.c

2019-10-16 Thread Ben Dooks (Codethink)
There are a number of structs in net/core/filter.c that are not exported or declared outside of the file. Fix the following warnings by making these all static: net/core/filter.c:8465:31: warning: symbol 'sk_filter_verifier_ops' was not declared. Should it be static? net/core/filter.c:8472:27:

[PATCH] net: bpf: type fixes for __be16/__be32

2019-10-16 Thread Ben Dooks (Codethink)
In bpf_skb_load_helper_8_no_cache and bpf_skb_load_helper_16_no_cache they read a u16/u32 where actually these are __be16 and __be32. Fix the following by making the types match: net/core/filter.c:215:32: warning: cast to restricted __be16 net/core/filter.c:215:32: warning: cast to restricted

[PATCH] kthread: make __kthread_queue_delayed_work static

2019-10-16 Thread Ben Dooks (Codethink)
The __kthread_queue_delayed_work is not exported so make it static, to avoid the following sparse warning: kernel/kthread.c:869:6: warning: symbol '__kthread_queue_delayed_work' was not declared. Should it be static? Signed-off-by: Ben Dooks --- Cc: linux-kernel@vger.kernel.org Cc:

[PATCH] RFC: Bluetooth: missed cpu_to_le16 conversion in hci_init4_req

2019-10-16 Thread Ben Dooks (Codethink)
It looks like in hci_init4_req() the request is being initialised from cpu-endian data but the packet is specified to be little-endian. This causes an warning from sparse due to __le16 to u16 conversion. Fix this by using cpu_to_le16() on the two fields in the packet.

[PATCH] crypto: inside-secure - fix unexported warnings

2019-10-16 Thread Ben Dooks (Codethink)
The safexcel_pci_remove, pcireg_rc and ofreg_rc are not exported or declared externally so make them static. This avoids the following sparse warnings: drivers/crypto/inside-secure/safexcel.c:1760:6: warning: symbol 'safexcel_pci_remove' was not declared. Should it be static?

[PATCH] RFC: cpu-topology: declare parse_acpi_topology in

2019-10-21 Thread Ben Dooks (Codethink)
The parse_acpi_topology() is not declared anywhere which causes the following sparse warning: drivers/base/arch_topology.c:522:19: warning: symbol 'parse_acpi_topology' was not declared. Should it be static? RFC: is this the best place to put it? Signed-off-by: Ben Dooks (Codethink) --- Cc

[tip: timers/urgent] timers/sched_clock: Include local timekeeping.h for missing declarations

2019-10-23 Thread tip-bot2 for Ben Dooks (Codethink)
The following commit has been merged into the timers/urgent branch of tip: Commit-ID: 086ee46b08634a999bcd1707eabe3b0dc1806674 Gitweb: https://git.kernel.org/tip/086ee46b08634a999bcd1707eabe3b0dc1806674 Author:Ben Dooks (Codethink) AuthorDate:Tue, 22 Oct 2019 14:12:26 +01