From: kernel test robot <lkp@intel.com>
To: Samuel Holland <samuel@sholland.org>,
Heikki Krogerus <heikki.krogerus@linux.intel.com>,
Guenter Roeck <linux@roeck-us.net>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Rob Herring <robh+dt@kernel.org>,
devicetree@vger.kernel.org
Cc: kbuild-all@lists.01.org, linux-usb@vger.kernel.org,
linux-kernel@vger.kernel.org,
Samuel Holland <samuel@sholland.org>
Subject: Re: [PATCH 3/4] usb: typec: Factor out non-PD fwnode properties
Date: Wed, 2 Feb 2022 14:22:27 +0800 [thread overview]
Message-ID: <202202021458.xcH4F4SQ-lkp@intel.com> (raw)
In-Reply-To: <20220201032440.5196-3-samuel@sholland.org>
Hi Samuel,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on usb/usb-testing]
[also build test WARNING on robh/for-next v5.17-rc2 next-20220202]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Samuel-Holland/dt-bindings-vendor-prefixes-Add-willsemi/20220201-112541
base: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing
config: openrisc-randconfig-m031-20220201 (https://download.01.org/0day-ci/archive/20220202/202202021458.xcH4F4SQ-lkp@intel.com/config)
compiler: or1k-linux-gcc (GCC) 11.2.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
smatch warnings:
drivers/usb/typec/class.c:1919 typec_get_fw_cap() warn: unsigned 'cap->type' is never less than zero.
drivers/usb/typec/class.c:1926 typec_get_fw_cap() warn: unsigned 'cap->data' is never less than zero.
vim +1919 drivers/usb/typec/class.c
1896
1897 int typec_get_fw_cap(struct typec_capability *cap,
1898 struct fwnode_handle *fwnode)
1899 {
1900 const char *cap_str;
1901 int ret;
1902
1903 /*
1904 * This fwnode has a "compatible" property, but is never populated as a
1905 * struct device. Instead we simply parse it to read the properties.
1906 * This it breaks fw_devlink=on. To maintain backward compatibility
1907 * with existing DT files, we work around this by deleting any
1908 * fwnode_links to/from this fwnode.
1909 */
1910 fw_devlink_purge_absent_suppliers(fwnode);
1911
1912 cap->fwnode = fwnode;
1913
1914 ret = fwnode_property_read_string(fwnode, "power-role", &cap_str);
1915 if (ret < 0)
1916 return ret;
1917
1918 cap->type = typec_find_port_power_role(cap_str);
> 1919 if (cap->type < 0)
1920 return cap->type;
1921
1922 /* USB data support is optional */
1923 ret = fwnode_property_read_string(fwnode, "data-role", &cap_str);
1924 if (ret == 0) {
1925 cap->data = typec_find_port_data_role(cap_str);
> 1926 if (cap->data < 0)
1927 return cap->data;
1928 }
1929
1930 /* Get the preferred power role for a DRP */
1931 if (cap->type == TYPEC_PORT_DRP) {
1932 cap->prefer_role = TYPEC_NO_PREFERRED_ROLE;
1933
1934 ret = fwnode_property_read_string(fwnode, "try-power-role", &cap_str);
1935 if (ret == 0) {
1936 cap->prefer_role = typec_find_power_role(cap_str);
1937 if (cap->prefer_role < 0)
1938 return cap->prefer_role;
1939 }
1940 }
1941
1942 return 0;
1943 }
1944 EXPORT_SYMBOL_GPL(typec_get_fw_cap);
1945
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
WARNING: multiple messages have this Message-ID (diff)
From: kernel test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: Re: [PATCH 3/4] usb: typec: Factor out non-PD fwnode properties
Date: Wed, 02 Feb 2022 14:22:27 +0800 [thread overview]
Message-ID: <202202021458.xcH4F4SQ-lkp@intel.com> (raw)
In-Reply-To: <20220201032440.5196-3-samuel@sholland.org>
[-- Attachment #1: Type: text/plain, Size: 2970 bytes --]
Hi Samuel,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on usb/usb-testing]
[also build test WARNING on robh/for-next v5.17-rc2 next-20220202]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Samuel-Holland/dt-bindings-vendor-prefixes-Add-willsemi/20220201-112541
base: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing
config: openrisc-randconfig-m031-20220201 (https://download.01.org/0day-ci/archive/20220202/202202021458.xcH4F4SQ-lkp(a)intel.com/config)
compiler: or1k-linux-gcc (GCC) 11.2.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
smatch warnings:
drivers/usb/typec/class.c:1919 typec_get_fw_cap() warn: unsigned 'cap->type' is never less than zero.
drivers/usb/typec/class.c:1926 typec_get_fw_cap() warn: unsigned 'cap->data' is never less than zero.
vim +1919 drivers/usb/typec/class.c
1896
1897 int typec_get_fw_cap(struct typec_capability *cap,
1898 struct fwnode_handle *fwnode)
1899 {
1900 const char *cap_str;
1901 int ret;
1902
1903 /*
1904 * This fwnode has a "compatible" property, but is never populated as a
1905 * struct device. Instead we simply parse it to read the properties.
1906 * This it breaks fw_devlink=on. To maintain backward compatibility
1907 * with existing DT files, we work around this by deleting any
1908 * fwnode_links to/from this fwnode.
1909 */
1910 fw_devlink_purge_absent_suppliers(fwnode);
1911
1912 cap->fwnode = fwnode;
1913
1914 ret = fwnode_property_read_string(fwnode, "power-role", &cap_str);
1915 if (ret < 0)
1916 return ret;
1917
1918 cap->type = typec_find_port_power_role(cap_str);
> 1919 if (cap->type < 0)
1920 return cap->type;
1921
1922 /* USB data support is optional */
1923 ret = fwnode_property_read_string(fwnode, "data-role", &cap_str);
1924 if (ret == 0) {
1925 cap->data = typec_find_port_data_role(cap_str);
> 1926 if (cap->data < 0)
1927 return cap->data;
1928 }
1929
1930 /* Get the preferred power role for a DRP */
1931 if (cap->type == TYPEC_PORT_DRP) {
1932 cap->prefer_role = TYPEC_NO_PREFERRED_ROLE;
1933
1934 ret = fwnode_property_read_string(fwnode, "try-power-role", &cap_str);
1935 if (ret == 0) {
1936 cap->prefer_role = typec_find_power_role(cap_str);
1937 if (cap->prefer_role < 0)
1938 return cap->prefer_role;
1939 }
1940 }
1941
1942 return 0;
1943 }
1944 EXPORT_SYMBOL_GPL(typec_get_fw_cap);
1945
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
next prev parent reply other threads:[~2022-02-02 7:45 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-01 3:24 [PATCH 1/4] dt-bindings: vendor-prefixes: Add willsemi Samuel Holland
2022-02-01 3:24 ` [PATCH 2/4] dt-bindings: usb: Add WUSB3801 Type-C Port Controller Samuel Holland
2022-02-01 3:24 ` [PATCH 3/4] usb: typec: Factor out non-PD fwnode properties Samuel Holland
2022-02-02 6:22 ` kernel test robot [this message]
2022-02-02 6:22 ` kernel test robot
2022-02-02 19:53 ` Guenter Roeck
2022-02-02 19:53 ` Guenter Roeck
2022-02-01 3:24 ` [PATCH 4/4] usb: typec: Support the WUSB3801 port controller Samuel Holland
2022-02-01 10:28 ` Greg Kroah-Hartman
2022-02-01 10:29 ` Greg Kroah-Hartman
2022-02-01 15:24 ` Guenter Roeck
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202202021458.xcH4F4SQ-lkp@intel.com \
--to=lkp@intel.com \
--cc=devicetree@vger.kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=heikki.krogerus@linux.intel.com \
--cc=kbuild-all@lists.01.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=robh+dt@kernel.org \
--cc=samuel@sholland.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.