Re: [linux-next:master 6954/7322] drivers/spmi/spmi-pmic-arb.c:1782 spmi_pmic_arb_register_buses() error: uninitialized symbol 'ret'.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Quoting Dan Carpenter (2024-04-22 06:56:07)
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
> head:   f529a6d274b3b8c75899e949649d231298f30a32
> commit: ee2098c0b512fb80b63119199938ea62a240ebc7 [6954/7322] spmi: pmic-arb: Add multi bus support
> config: openrisc-randconfig-r071-20240422 (https://download.01.org/0day-ci/archive/20240422/202404221945.jickYhnO-lkp@xxxxxxxxx/config)
> compiler: or1k-linux-gcc (GCC) 13.2.0
> 
> If you fix the issue in a separate patch/commit (i.e. not just a new version of
> the same patch/commit), kindly add following tags
> | Reported-by: kernel test robot <lkp@xxxxxxxxx>
> | Reported-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
> | Closes: https://lore.kernel.org/r/202404221945.jickYhnO-lkp@xxxxxxxxx/

Thanks

> 
> New smatch warnings:
> drivers/spmi/spmi-pmic-arb.c:1782 spmi_pmic_arb_register_buses() error: uninitialized symbol 'ret'.
> 
> Old smatch warnings:
> drivers/spmi/spmi-pmic-arb.c:1724 spmi_pmic_arb_bus_init() warn: unsigned 'irq' is never less than zero.
> 
> vim +/ret +1782 drivers/spmi/spmi-pmic-arb.c
> 
> ee2098c0b512fb Abel Vesa 2024-04-17  1762  static int spmi_pmic_arb_register_buses(struct spmi_pmic_arb *pmic_arb,
> ee2098c0b512fb Abel Vesa 2024-04-17  1763                                       struct platform_device *pdev)
> ee2098c0b512fb Abel Vesa 2024-04-17  1764  {
> ee2098c0b512fb Abel Vesa 2024-04-17  1765       struct device *dev = &pdev->dev;
> ee2098c0b512fb Abel Vesa 2024-04-17  1766       struct device_node *node = dev->of_node;
> ee2098c0b512fb Abel Vesa 2024-04-17  1767       struct device_node *child;
> ee2098c0b512fb Abel Vesa 2024-04-17  1768       int ret;
> ee2098c0b512fb Abel Vesa 2024-04-17  1769  
> ee2098c0b512fb Abel Vesa 2024-04-17  1770       /* legacy mode doesn't provide child node for the bus */
> ee2098c0b512fb Abel Vesa 2024-04-17  1771       if (of_device_is_compatible(node, "qcom,spmi-pmic-arb"))
> ee2098c0b512fb Abel Vesa 2024-04-17  1772               return spmi_pmic_arb_bus_init(pdev, node, pmic_arb);
> ee2098c0b512fb Abel Vesa 2024-04-17  1773  
> ee2098c0b512fb Abel Vesa 2024-04-17  1774       for_each_available_child_of_node(node, child) {
> ee2098c0b512fb Abel Vesa 2024-04-17  1775               if (of_node_name_eq(child, "spmi")) {
> 
> Smatch is complaining that maybe spmi is never found.
> 
> ee2098c0b512fb Abel Vesa 2024-04-17  1776                       ret = spmi_pmic_arb_bus_init(pdev, child, pmic_arb);
> ee2098c0b512fb Abel Vesa 2024-04-17  1777                       if (ret)
> ee2098c0b512fb Abel Vesa 2024-04-17  1778                               return ret;
> ee2098c0b512fb Abel Vesa 2024-04-17  1779               }
> ee2098c0b512fb Abel Vesa 2024-04-17  1780       }
> ee2098c0b512fb Abel Vesa 2024-04-17  1781  
> ee2098c0b512fb Abel Vesa 2024-04-17 @1782       return ret;

Seems like we should simply return 0 here.





[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux