Hi cy_huang,
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.16 next-20220114]
[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/cy_huang/Add-Richtek-RT1719-USBP...
base:
https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing
config: alpha-allmodconfig
(
https://download.01.org/0day-ci/archive/20220115/202201150209.qTlXJwWM-lk...)
compiler: alpha-linux-gcc (GCC) 11.2.0
reproduce (this is a W=1 build):
wget
https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O
~/bin/make.cross
chmod +x ~/bin/make.cross
#
https://github.com/0day-ci/linux/commit/20efb31d7403b57c80a61a6c416d780ad...
git remote add linux-review
https://github.com/0day-ci/linux
git fetch --no-tags linux-review
cy_huang/Add-Richtek-RT1719-USBPD-controller-support/20220115-000058
git checkout 20efb31d7403b57c80a61a6c416d780ad561a2bd
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir
ARCH=alpha SHELL=/bin/bash drivers/usb/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
drivers/usb/typec/rt1719.c: In function 'rt1719_usbpd_request_voltage':
> drivers/usb/typec/rt1719.c:492:65: warning: suggest parentheses
around arithmetic in operand of '|' [-Wparentheses]
492 |
RT1719_EVALMODE_MASK | src_sel + 1);
| ~~~~~~~~^~~
vim +492 drivers/usb/typec/rt1719.c
437
438 static int rt1719_usbpd_request_voltage(struct rt1719_data *data)
439 {
440 u32 src_voltage;
441 int snk_sel, src_sel = -1;
442 int i, ret;
443
444 if (!data->attached || !data->pd_capable || data->spdo_sel <= 0)
445 return -EINVAL;
446
447 src_voltage = pdo_fixed_voltage(data->spdos[data->spdo_sel - 1]);
448 if (src_voltage == data->req_voltage)
449 return 0;
450
451 switch (data->req_voltage) {
452 case 5000:
453 snk_sel = RT1719_SNKCAP_5V;
454 break;
455 case 9000:
456 snk_sel = RT1719_SNKCAP_9V;
457 break;
458 case 12000:
459 snk_sel = RT1719_SNKCAP_12V;
460 break;
461 case 15000:
462 snk_sel = RT1719_SNKCAP_15V;
463 break;
464 case 20000:
465 snk_sel = RT1719_SNKCAP_20V;
466 break;
467 default:
468 return -EINVAL;
469 }
470
471 if (!(data->snkcaps[snk_sel] & RT1719_PSEL_SUPPORT))
472 return -EINVAL;
473
474 for (i = 0; i < data->spdo_num; i++) {
475 enum pd_pdo_type type = pdo_type(data->spdos[i]);
476
477 if (type != PDO_TYPE_FIXED)
478 continue;
479
480 src_voltage = pdo_fixed_voltage(data->spdos[i]);
481 if (src_voltage == data->req_voltage) {
482 src_sel = i;
483 break;
484 }
485 }
486
487 if (src_sel == -1)
488 return -ENOTSUPP;
489
490 ret = regmap_update_bits(data->regmap, RT1719_REG_TXCTRL1,
491 RT1719_EVALMODE_MASK | RT1719_REQSRCPDO_MASK,
492 RT1719_EVALMODE_MASK | src_sel + 1);
493 ret |=
regmap_update_bits(data->regmap, RT1719_REG_TXCTRL2,
494 RT1719_TXSPDOREQ_MASK, RT1719_TXSPDOREQ_MASK);
495 if (ret)
496 return ret;
497
498 reinit_completion(&data->req_completion);
499 ret = wait_for_completion_timeout(&data->req_completion,
500 msecs_to_jiffies(400));
501 if (!ret)
502 return -ETIMEDOUT;
503
504 return 0;
505 }
506
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org