Convert 'alloc_obj' family to use the new default GFP_KERNEL argumentThis was done entirely with mindless brute force, using git grep -l '\<k[vmz]*alloc_objs*(.*, GFP_KERNEL)' | xargs
Convert 'alloc_obj' family to use the new default GFP_KERNEL argumentThis was done entirely with mindless brute force, using git grep -l '\<k[vmz]*alloc_objs*(.*, GFP_KERNEL)' | xargs sed -i 's/\(alloc_objs*(.*\), GFP_KERNEL)/\1)/'to convert the new alloc_obj() users that had a simple GFP_KERNELargument to just drop that argument.Note that due to the extreme simplicity of the scripting, any slightlymore complex cases spread over multiple lines would not be triggered:they definitely exist, but this covers the vast bulk of the cases, andthe resulting diff is also then easier to check automatically.For the same reason the 'flex' versions will be done as a separateconversion.Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
show more ...
treewide: Replace kmalloc with kmalloc_obj for non-scalar typesThis is the result of running the Coccinelle script fromscripts/coccinelle/api/kmalloc_objs.cocci. The script is designed toavoid sc
treewide: Replace kmalloc with kmalloc_obj for non-scalar typesThis is the result of running the Coccinelle script fromscripts/coccinelle/api/kmalloc_objs.cocci. The script is designed toavoid scalar types (which need careful case-by-case checking), andinstead replace kmalloc-family calls that allocate struct or unionobject instances:Single allocations: kmalloc(sizeof(TYPE), ...)are replaced with: kmalloc_obj(TYPE, ...)Array allocations: kmalloc_array(COUNT, sizeof(TYPE), ...)are replaced with: kmalloc_objs(TYPE, COUNT, ...)Flex array allocations: kmalloc(struct_size(PTR, FAM, COUNT), ...)are replaced with: kmalloc_flex(*PTR, FAM, COUNT, ...)(where TYPE may also be *VAR)The resulting allocations no longer return "void *", instead returning"TYPE *".Signed-off-by: Kees Cook <kees@kernel.org>
net/fungible: Remove unused fun_create_queuefun_create_queue was added in 2022 bycommit e1ffcc66818f ("net/fungible: Add service module for Fungibledrivers")but hasn't been used.Remove it.Al
net/fungible: Remove unused fun_create_queuefun_create_queue was added in 2022 bycommit e1ffcc66818f ("net/fungible: Add service module for Fungibledrivers")but hasn't been used.Remove it.Also remove the static helper functions it was the only user of.Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/fungible: Avoid -Wflex-array-member-not-at-end warningUse the `DEFINE_RAW_FLEX()` helper for an on-stack definition ofa flexible structure where the size of the flexible-array memberis known
net/fungible: Avoid -Wflex-array-member-not-at-end warningUse the `DEFINE_RAW_FLEX()` helper for an on-stack definition ofa flexible structure where the size of the flexible-array memberis known at compile-time, and refactor the rest of the code,accordingly.So, with these changes, fix the following warning:drivers/net/ethernet/fungible/funcore/fun_dev.c:550:43: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end]Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>Link: https://patch.msgid.link/ZrDwEugW7DR/FlP5@cuteSigned-off-by: Jakub Kicinski <kuba@kernel.org>
net/fungible: Remove redundant pci_clear_masterRemove pci_clear_master to simplify the code,the bus-mastering is also cleared in do_pci_disable_device,like this:./drivers/pci/pci.c:2197static v
net/fungible: Remove redundant pci_clear_masterRemove pci_clear_master to simplify the code,the bus-mastering is also cleared in do_pci_disable_device,like this:./drivers/pci/pci.c:2197static void do_pci_disable_device(struct pci_dev *dev){ u16 pci_command; pci_read_config_word(dev, PCI_COMMAND, &pci_command); if (pci_command & PCI_COMMAND_MASTER) { pci_command &= ~PCI_COMMAND_MASTER; pci_write_config_word(dev, PCI_COMMAND, pci_command); } pcibios_disable_device(dev);}.And dev->is_busmaster is set to 0 in pci_disable_device.Signed-off-by: Cai Huoqing <cai.huoqing@linux.dev>Acked-by: Dimitris Michailidis <dmichail@fungible.com>Signed-off-by: David S. Miller <davem@davemloft.net>
net/fungible: Drop redundant pci_enable_pcie_error_reporting()pci_enable_pcie_error_reporting() enables the device to send ERR_*Messages. Since f26e58bf6f54 ("PCI/AER: Enable error reporting when
net/fungible: Drop redundant pci_enable_pcie_error_reporting()pci_enable_pcie_error_reporting() enables the device to send ERR_*Messages. Since f26e58bf6f54 ("PCI/AER: Enable error reporting when AER isnative"), the PCI core does this for all devices during enumeration, so thedriver doesn't need to do it itself.Remove the redundant pci_enable_pcie_error_reporting() call from thedriver. Also remove the corresponding pci_disable_pcie_error_reporting()from the driver .remove() path.Note that this only controls ERR_* Messages from the device. An ERR_*Message may cause the Root Port to generate an interrupt, depending on theAER Root Error Command register managed by the AER service driver.Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>Acked-by: Dimitris Michailidis <dmichail@fungible.com>Acked-by: Jesse Brandeburg <jesse.brandeburg@intel.com>Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/funeth: Support for ethtool -mAdd the FW command for reading port module memory pages and implementethtool's get_module_eeprom_by_page operation.Signed-off-by: Dimitris Michailidis <dmichail
net/funeth: Support for ethtool -mAdd the FW command for reading port module memory pages and implementethtool's get_module_eeprom_by_page operation.Signed-off-by: Dimitris Michailidis <dmichail@fungible.com>Link: https://lore.kernel.org/r/20220627182000.8198-1-dmichail@fungible.comSigned-off-by: Jakub Kicinski <kuba@kernel.org>
net/fungible: Fix reference to __udivdi3 on 32b builds32b builds with CONFIG_PHYS_ADDR_T_64BIT=y, such as i386 PAE,raise a linker error due to a 64b division:ld: drivers/net/ethernet/fungible/fu
net/fungible: Fix reference to __udivdi3 on 32b builds32b builds with CONFIG_PHYS_ADDR_T_64BIT=y, such as i386 PAE,raise a linker error due to a 64b division:ld: drivers/net/ethernet/fungible/funcore/fun_dev.o: in function`fun_dev_enable':(.text+0xe1a): undefined reference to `__udivdi3'The divisor in the offendinng expression is a power of 2. Change it touse an explicit right shift.Fixes: e1ffcc66818f ("net/fungible: Add service module for Fungible drivers")Reported-by: Randy Dunlap <rdunlap@infradead.org>Signed-off-by: Dimitris Michailidis <dmichail@fungible.com>Link: https://lore.kernel.org/r/20220401232411.313881-1-dmichail@fungible.comSigned-off-by: Jakub Kicinski <kuba@kernel.org>
net/fungible: Add service module for Fungible driversFungible cards have a number of different PCI functions and thusdifferent drivers, all of which use a common method to initialize andinteract
net/fungible: Add service module for Fungible driversFungible cards have a number of different PCI functions and thusdifferent drivers, all of which use a common method to initialize andinteract with the device. This commit adds a library module thatcollects these common mechanisms. They mainly deal with deviceinitialization, setting up and destroying queues, and operating an adminqueue. A subset of the FW interface is also included here.Signed-off-by: Dimitris Michailidis <dmichail@fungible.com>Signed-off-by: David S. Miller <davem@davemloft.net>