All of lore.kernel.org
 help / color / mirror / Atom feed
* [rui:linux-next 9/13] drivers/acpi/scan.c:2152 acpi_walk_dep_device_list() error: uninitialized symbol 'ret'.
@ 2021-06-28  9:06 ` Dan Carpenter
  0 siblings, 0 replies; 4+ messages in thread
From: kernel test robot @ 2021-06-27 11:56 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 3763 bytes --]

CC: kbuild-all(a)lists.01.org
TO: Daniel Scally <djrscally@gmail.com>
CC: Huang Rui <ray.huang@amd.com>
CC: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
CC: "Rafael J. Wysocki" <rjw@rjwysocki.net>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/rui/linux.git linux-next
head:   efd4c04742d30bb71022f50cd5451a0fbe52aa56
commit: 018f81b667154ad8ee504bc36f52dc26f4f1cb87 [9/13] ACPI: scan: Extend acpi_walk_dep_device_list()
:::::: branch date: 7 days ago
:::::: commit date: 7 days ago
config: i386-randconfig-m021-20210627 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>

smatch warnings:
drivers/acpi/scan.c:2152 acpi_walk_dep_device_list() error: uninitialized symbol 'ret'.

vim +/ret +2152 drivers/acpi/scan.c

018f81b667154a Daniel Scally 2021-06-03  2122  
018f81b667154a Daniel Scally 2021-06-03  2123  /**
018f81b667154a Daniel Scally 2021-06-03  2124   * acpi_walk_dep_device_list - Apply a callback to every entry in acpi_dep_list
018f81b667154a Daniel Scally 2021-06-03  2125   * @handle:	The ACPI handle of the supplier device
018f81b667154a Daniel Scally 2021-06-03  2126   * @callback:	Pointer to the callback function to apply
018f81b667154a Daniel Scally 2021-06-03  2127   * @data:	Pointer to some data to pass to the callback
018f81b667154a Daniel Scally 2021-06-03  2128   *
018f81b667154a Daniel Scally 2021-06-03  2129   * The return value of the callback determines this function's behaviour. If 0
018f81b667154a Daniel Scally 2021-06-03  2130   * is returned we continue to iterate over acpi_dep_list. If a positive value
018f81b667154a Daniel Scally 2021-06-03  2131   * is returned then the loop is broken but this function returns 0. If a
018f81b667154a Daniel Scally 2021-06-03  2132   * negative value is returned by the callback then the loop is broken and that
018f81b667154a Daniel Scally 2021-06-03  2133   * value is returned as the final error.
018f81b667154a Daniel Scally 2021-06-03  2134   */
018f81b667154a Daniel Scally 2021-06-03  2135  int acpi_walk_dep_device_list(acpi_handle handle,
018f81b667154a Daniel Scally 2021-06-03  2136  			      int (*callback)(struct acpi_dep_data *, void *),
018f81b667154a Daniel Scally 2021-06-03  2137  			      void *data)
018f81b667154a Daniel Scally 2021-06-03  2138  {
018f81b667154a Daniel Scally 2021-06-03  2139  	struct acpi_dep_data *dep, *tmp;
018f81b667154a Daniel Scally 2021-06-03  2140  	int ret;
018f81b667154a Daniel Scally 2021-06-03  2141  
018f81b667154a Daniel Scally 2021-06-03  2142  	mutex_lock(&acpi_dep_list_lock);
018f81b667154a Daniel Scally 2021-06-03  2143  	list_for_each_entry_safe(dep, tmp, &acpi_dep_list, node) {
018f81b667154a Daniel Scally 2021-06-03  2144  		if (dep->supplier == handle) {
018f81b667154a Daniel Scally 2021-06-03  2145  			ret = callback(dep, data);
018f81b667154a Daniel Scally 2021-06-03  2146  			if (ret)
018f81b667154a Daniel Scally 2021-06-03  2147  				break;
40e7fcb19293cb Lan Tianyu    2014-11-23  2148  		}
40e7fcb19293cb Lan Tianyu    2014-11-23  2149  	}
40e7fcb19293cb Lan Tianyu    2014-11-23  2150  	mutex_unlock(&acpi_dep_list_lock);
018f81b667154a Daniel Scally 2021-06-03  2151  
018f81b667154a Daniel Scally 2021-06-03 @2152  	return ret > 0 ? 0 : ret;
40e7fcb19293cb Lan Tianyu    2014-11-23  2153  }
40e7fcb19293cb Lan Tianyu    2014-11-23  2154  EXPORT_SYMBOL_GPL(acpi_walk_dep_device_list);
40e7fcb19293cb Lan Tianyu    2014-11-23  2155  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 38498 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [rui:linux-next 9/13] drivers/acpi/scan.c:2152 acpi_walk_dep_device_list() error: uninitialized symbol 'ret'.
@ 2021-06-28  9:06 ` Dan Carpenter
  0 siblings, 0 replies; 4+ messages in thread
From: Dan Carpenter @ 2021-06-28  9:06 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 2230 bytes --]

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/rui/linux.git linux-next
head:   efd4c04742d30bb71022f50cd5451a0fbe52aa56
commit: 018f81b667154ad8ee504bc36f52dc26f4f1cb87 [9/13] ACPI: scan: Extend acpi_walk_dep_device_list()
config: i386-randconfig-m021-20210627 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>

smatch warnings:
drivers/acpi/scan.c:2152 acpi_walk_dep_device_list() error: uninitialized symbol 'ret'.

vim +/ret +2152 drivers/acpi/scan.c

018f81b667154a Daniel Scally 2021-06-03  2135  int acpi_walk_dep_device_list(acpi_handle handle,
018f81b667154a Daniel Scally 2021-06-03  2136  			      int (*callback)(struct acpi_dep_data *, void *),
018f81b667154a Daniel Scally 2021-06-03  2137  			      void *data)
018f81b667154a Daniel Scally 2021-06-03  2138  {
018f81b667154a Daniel Scally 2021-06-03  2139  	struct acpi_dep_data *dep, *tmp;
018f81b667154a Daniel Scally 2021-06-03  2140  	int ret;
018f81b667154a Daniel Scally 2021-06-03  2141  
018f81b667154a Daniel Scally 2021-06-03  2142  	mutex_lock(&acpi_dep_list_lock);
018f81b667154a Daniel Scally 2021-06-03  2143  	list_for_each_entry_safe(dep, tmp, &acpi_dep_list, node) {
018f81b667154a Daniel Scally 2021-06-03  2144  		if (dep->supplier == handle) {

I haven't looked at the context, but it feels like we should to handle
the case where handle is not found.

018f81b667154a Daniel Scally 2021-06-03  2145  			ret = callback(dep, data);
018f81b667154a Daniel Scally 2021-06-03  2146  			if (ret)
018f81b667154a Daniel Scally 2021-06-03  2147  				break;
40e7fcb19293cb Lan Tianyu    2014-11-23  2148  		}
40e7fcb19293cb Lan Tianyu    2014-11-23  2149  	}
40e7fcb19293cb Lan Tianyu    2014-11-23  2150  	mutex_unlock(&acpi_dep_list_lock);
018f81b667154a Daniel Scally 2021-06-03  2151  
018f81b667154a Daniel Scally 2021-06-03 @2152  	return ret > 0 ? 0 : ret;
40e7fcb19293cb Lan Tianyu    2014-11-23  2153  }

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [rui:linux-next 9/13] drivers/acpi/scan.c:2152 acpi_walk_dep_device_list() error: uninitialized symbol 'ret'.
  2021-06-28  9:06 ` Dan Carpenter
  (?)
@ 2021-06-28 10:04 ` Daniel Scally
  2021-06-29  7:27   ` Huang Rui
  -1 siblings, 1 reply; 4+ messages in thread
From: Daniel Scally @ 2021-06-28 10:04 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 2518 bytes --]

Hi Dan

On 28/06/2021 10:06, Dan Carpenter wrote:
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/rui/linux.git linux-next
> head:   efd4c04742d30bb71022f50cd5451a0fbe52aa56
> commit: 018f81b667154ad8ee504bc36f52dc26f4f1cb87 [9/13] ACPI: scan: Extend acpi_walk_dep_device_list()
> config: i386-randconfig-m021-20210627 (attached as .config)
> compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
>
> If you fix the issue, kindly add following tag as appropriate
> Reported-by: kernel test robot <lkp@intel.com>
> Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
>
> smatch warnings:
> drivers/acpi/scan.c:2152 acpi_walk_dep_device_list() error: uninitialized symbol 'ret'.
>
> vim +/ret +2152 drivers/acpi/scan.c
>
> 018f81b667154a Daniel Scally 2021-06-03  2135  int acpi_walk_dep_device_list(acpi_handle handle,
> 018f81b667154a Daniel Scally 2021-06-03  2136  			      int (*callback)(struct acpi_dep_data *, void *),
> 018f81b667154a Daniel Scally 2021-06-03  2137  			      void *data)
> 018f81b667154a Daniel Scally 2021-06-03  2138  {
> 018f81b667154a Daniel Scally 2021-06-03  2139  	struct acpi_dep_data *dep, *tmp;
> 018f81b667154a Daniel Scally 2021-06-03  2140  	int ret;
> 018f81b667154a Daniel Scally 2021-06-03  2141  
> 018f81b667154a Daniel Scally 2021-06-03  2142  	mutex_lock(&acpi_dep_list_lock);
> 018f81b667154a Daniel Scally 2021-06-03  2143  	list_for_each_entry_safe(dep, tmp, &acpi_dep_list, node) {
> 018f81b667154a Daniel Scally 2021-06-03  2144  		if (dep->supplier == handle) {
>
> I haven't looked at the context, but it feels like we should to handle
> the case where handle is not found.


Agreed; Colin spotted this one and patched it already actually:


https://lore.kernel.org/lkml/20210609173312.298414-1-colin.king(a)canonical.com/

>
> 018f81b667154a Daniel Scally 2021-06-03  2145  			ret = callback(dep, data);
> 018f81b667154a Daniel Scally 2021-06-03  2146  			if (ret)
> 018f81b667154a Daniel Scally 2021-06-03  2147  				break;
> 40e7fcb19293cb Lan Tianyu    2014-11-23  2148  		}
> 40e7fcb19293cb Lan Tianyu    2014-11-23  2149  	}
> 40e7fcb19293cb Lan Tianyu    2014-11-23  2150  	mutex_unlock(&acpi_dep_list_lock);
> 018f81b667154a Daniel Scally 2021-06-03  2151  
> 018f81b667154a Daniel Scally 2021-06-03 @2152  	return ret > 0 ? 0 : ret;
> 40e7fcb19293cb Lan Tianyu    2014-11-23  2153  }
>
> ---
> 0-DAY CI Kernel Test Service, Intel Corporation
> https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [rui:linux-next 9/13] drivers/acpi/scan.c:2152 acpi_walk_dep_device_list() error: uninitialized symbol 'ret'.
  2021-06-28 10:04 ` Daniel Scally
@ 2021-06-29  7:27   ` Huang Rui
  0 siblings, 0 replies; 4+ messages in thread
From: Huang Rui @ 2021-06-29  7:27 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 3929 bytes --]

On Mon, Jun 28, 2021 at 06:04:04PM +0800, Daniel Scally wrote:
> Hi Dan
> 
> On 28/06/2021 10:06, Dan Carpenter wrote:
> > tree:   https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgit.kernel.org%2Fpub%2Fscm%2Flinux%2Fkernel%2Fgit%2Frui%2Flinux.git&amp;data=04%7C01%7Cray.huang%40amd.com%7C1d88cef62d9d441306c908d93a1c1180%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637604715076721040%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C2000&amp;sdata=ntL36nVMHIl3%2Bb22kd5TrQ2RKfL%2F2DVYHi4t05iWbxU%3D&amp;reserved=0 linux-next
> > head:   efd4c04742d30bb71022f50cd5451a0fbe52aa56
> > commit: 018f81b667154ad8ee504bc36f52dc26f4f1cb87 [9/13] ACPI: scan: Extend acpi_walk_dep_device_list()
> > config: i386-randconfig-m021-20210627 (attached as .config)
> > compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
> >
> > If you fix the issue, kindly add following tag as appropriate
> > Reported-by: kernel test robot <lkp@intel.com>
> > Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
> >
> > smatch warnings:
> > drivers/acpi/scan.c:2152 acpi_walk_dep_device_list() error: uninitialized symbol 'ret'.
> >
> > vim +/ret +2152 drivers/acpi/scan.c
> >
> > 018f81b667154a Daniel Scally 2021-06-03  2135  int acpi_walk_dep_device_list(acpi_handle handle,
> > 018f81b667154a Daniel Scally 2021-06-03  2136  			      int (*callback)(struct acpi_dep_data *, void *),
> > 018f81b667154a Daniel Scally 2021-06-03  2137  			      void *data)
> > 018f81b667154a Daniel Scally 2021-06-03  2138  {
> > 018f81b667154a Daniel Scally 2021-06-03  2139  	struct acpi_dep_data *dep, *tmp;
> > 018f81b667154a Daniel Scally 2021-06-03  2140  	int ret;
> > 018f81b667154a Daniel Scally 2021-06-03  2141  
> > 018f81b667154a Daniel Scally 2021-06-03  2142  	mutex_lock(&acpi_dep_list_lock);
> > 018f81b667154a Daniel Scally 2021-06-03  2143  	list_for_each_entry_safe(dep, tmp, &acpi_dep_list, node) {
> > 018f81b667154a Daniel Scally 2021-06-03  2144  		if (dep->supplier == handle) {
> >
> > I haven't looked at the context, but it feels like we should to handle
> > the case where handle is not found.
> 
> 
> Agreed; Colin spotted this one and patched it already actually:
> 
> 
> https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flore.kernel.org%2Flkml%2F20210609173312.298414-1-colin.king%40canonical.com%2F&amp;data=04%7C01%7Cray.huang%40amd.com%7C1d88cef62d9d441306c908d93a1c1180%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637604715076721040%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C2000&amp;sdata=OQVHDDDhJ2H0388gcBEjsAXidc85BWK50xVDVz9eoPI%3D&amp;reserved=0

Thanks for the reporting, I synced up an old branch of linux-pm. :-)

Will update it.

Thanks,
Ray

> 
> >
> > 018f81b667154a Daniel Scally 2021-06-03  2145  			ret = callback(dep, data);
> > 018f81b667154a Daniel Scally 2021-06-03  2146  			if (ret)
> > 018f81b667154a Daniel Scally 2021-06-03  2147  				break;
> > 40e7fcb19293cb Lan Tianyu    2014-11-23  2148  		}
> > 40e7fcb19293cb Lan Tianyu    2014-11-23  2149  	}
> > 40e7fcb19293cb Lan Tianyu    2014-11-23  2150  	mutex_unlock(&acpi_dep_list_lock);
> > 018f81b667154a Daniel Scally 2021-06-03  2151  
> > 018f81b667154a Daniel Scally 2021-06-03 @2152  	return ret > 0 ? 0 : ret;
> > 40e7fcb19293cb Lan Tianyu    2014-11-23  2153  }
> >
> > ---
> > 0-DAY CI Kernel Test Service, Intel Corporation
> > https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.01.org%2Fhyperkitty%2Flist%2Fkbuild-all%40lists.01.org&amp;data=04%7C01%7Cray.huang%40amd.com%7C1d88cef62d9d441306c908d93a1c1180%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637604715076721040%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C2000&amp;sdata=EJ8dqlXrHCQ1PZVI3%2Behz5R8LQD2kDSsfLDtg%2BJqZU4%3D&amp;reserved=0
> >

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-06-29  7:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-27 11:56 [rui:linux-next 9/13] drivers/acpi/scan.c:2152 acpi_walk_dep_device_list() error: uninitialized symbol 'ret' kernel test robot
2021-06-28  9:06 ` Dan Carpenter
2021-06-28 10:04 ` Daniel Scally
2021-06-29  7:27   ` Huang Rui

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.