* drivers/platform/chrome/cros_ec_typec.c:900:39: sparse: sparse: cast to restricted __le16
@ 2021-11-18 2:10 kernel test robot
0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2021-11-18 2:10 UTC (permalink / raw)
To: Benson Leung; +Cc: kbuild-all, linux-kernel, Prashant Malani
[-- Attachment #1: Type: text/plain, Size: 2934 bytes --]
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 42eb8fdac2fc5d62392dcfcf0253753e821a97b0
commit: 3b3dd1f0dbfe92781c60f36ea5c22b26360f9909 platform/chrome: cros_ec_typec: Report SOP' PD revision from status
date: 10 months ago
config: x86_64-randconfig-s021-20211117 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.4-dirty
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=3b3dd1f0dbfe92781c60f36ea5c22b26360f9909
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 3b3dd1f0dbfe92781c60f36ea5c22b26360f9909
# save the attached .config to linux build tree
make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=x86_64 SHELL=/bin/bash drivers/platform/chrome/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
sparse warnings: (new ones prefixed by >>)
>> drivers/platform/chrome/cros_ec_typec.c:900:39: sparse: sparse: cast to restricted __le16
vim +900 drivers/platform/chrome/cros_ec_typec.c
870
871 static void cros_typec_handle_status(struct cros_typec_data *typec, int port_num)
872 {
873 struct ec_response_typec_status resp;
874 struct ec_params_typec_status req = {
875 .port = port_num,
876 };
877 int ret;
878
879 ret = cros_typec_ec_command(typec, 0, EC_CMD_TYPEC_STATUS, &req, sizeof(req),
880 &resp, sizeof(resp));
881 if (ret < 0) {
882 dev_warn(typec->dev, "EC_CMD_TYPEC_STATUS failed for port: %d\n", port_num);
883 return;
884 }
885
886 /* Handle any events appropriately. */
887 if (resp.events & PD_STATUS_EVENT_SOP_DISC_DONE && !typec->ports[port_num]->sop_disc_done) {
888 ret = cros_typec_handle_sop_disc(typec, port_num);
889 if (ret < 0)
890 dev_err(typec->dev, "Couldn't parse SOP Disc data, port: %d\n", port_num);
891 else
892 typec->ports[port_num]->sop_disc_done = true;
893 }
894
895 if (resp.events & PD_STATUS_EVENT_SOP_PRIME_DISC_DONE &&
896 !typec->ports[port_num]->sop_prime_disc_done) {
897 u16 sop_prime_revision;
898
899 /* Convert BCD to the format preferred by the TypeC framework */
> 900 sop_prime_revision = (le16_to_cpu(resp.sop_prime_revision) & 0xff00) >> 4;
901 ret = cros_typec_handle_sop_prime_disc(typec, port_num, sop_prime_revision);
902 if (ret < 0)
903 dev_err(typec->dev, "Couldn't parse SOP' Disc data, port: %d\n", port_num);
904 else
905 typec->ports[port_num]->sop_prime_disc_done = true;
906 }
907 }
908
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 34855 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
* drivers/platform/chrome/cros_ec_typec.c:900:39: sparse: sparse: cast to restricted __le16
@ 2023-09-27 20:59 kernel test robot
0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2023-09-27 20:59 UTC (permalink / raw)
To: Benson Leung; +Cc: oe-kbuild-all, linux-kernel, Prashant Malani
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 633b47cb009d09dc8f4ba9cdb3a0ca138809c7c7
commit: 3b3dd1f0dbfe92781c60f36ea5c22b26360f9909 platform/chrome: cros_ec_typec: Report SOP' PD revision from status
date: 2 years, 8 months ago
config: x86_64-randconfig-121-20230928 (https://download.01.org/0day-ci/archive/20230928/202309280431.VyAxysqB-lkp@intel.com/config)
compiler: gcc-11 (Debian 11.3.0-12) 11.3.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20230928/202309280431.VyAxysqB-lkp@intel.com/reproduce)
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@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202309280431.VyAxysqB-lkp@intel.com/
sparse warnings: (new ones prefixed by >>)
>> drivers/platform/chrome/cros_ec_typec.c:900:39: sparse: sparse: cast to restricted __le16
vim +900 drivers/platform/chrome/cros_ec_typec.c
870
871 static void cros_typec_handle_status(struct cros_typec_data *typec, int port_num)
872 {
873 struct ec_response_typec_status resp;
874 struct ec_params_typec_status req = {
875 .port = port_num,
876 };
877 int ret;
878
879 ret = cros_typec_ec_command(typec, 0, EC_CMD_TYPEC_STATUS, &req, sizeof(req),
880 &resp, sizeof(resp));
881 if (ret < 0) {
882 dev_warn(typec->dev, "EC_CMD_TYPEC_STATUS failed for port: %d\n", port_num);
883 return;
884 }
885
886 /* Handle any events appropriately. */
887 if (resp.events & PD_STATUS_EVENT_SOP_DISC_DONE && !typec->ports[port_num]->sop_disc_done) {
888 ret = cros_typec_handle_sop_disc(typec, port_num);
889 if (ret < 0)
890 dev_err(typec->dev, "Couldn't parse SOP Disc data, port: %d\n", port_num);
891 else
892 typec->ports[port_num]->sop_disc_done = true;
893 }
894
895 if (resp.events & PD_STATUS_EVENT_SOP_PRIME_DISC_DONE &&
896 !typec->ports[port_num]->sop_prime_disc_done) {
897 u16 sop_prime_revision;
898
899 /* Convert BCD to the format preferred by the TypeC framework */
> 900 sop_prime_revision = (le16_to_cpu(resp.sop_prime_revision) & 0xff00) >> 4;
901 ret = cros_typec_handle_sop_prime_disc(typec, port_num, sop_prime_revision);
902 if (ret < 0)
903 dev_err(typec->dev, "Couldn't parse SOP' Disc data, port: %d\n", port_num);
904 else
905 typec->ports[port_num]->sop_prime_disc_done = true;
906 }
907 }
908
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-09-27 20:59 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-18 2:10 drivers/platform/chrome/cros_ec_typec.c:900:39: sparse: sparse: cast to restricted __le16 kernel test robot
2023-09-27 20:59 kernel test robot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).