Re: [PATCH v2 2/3] usb: typec: ucsi: Add duplicate detection to nvidia registration path

From: kernel test robot

Date: Tue Nov 11 2025 - 11:55:01 EST


Hi Chia-Lin,

kernel test robot noticed the following build errors:

[auto build test ERROR on usb/usb-testing]
[also build test ERROR on usb/usb-next usb/usb-linus linus/master v6.18-rc5 next-20251111]
[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#_base_tree_information]

url: https://github.com/intel-lab-lkp/linux/commits/Chia-Lin-Kao-AceLan/usb-typec-ucsi-Add-duplicate-detection-to-nvidia-registration-path/20251111-092153
base: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing
patch link: https://lore.kernel.org/r/20251111010541.145421-2-acelan.kao%40canonical.com
patch subject: [PATCH v2 2/3] usb: typec: ucsi: Add duplicate detection to nvidia registration path
config: x86_64-randconfig-072-20251111 (https://download.01.org/0day-ci/archive/20251112/202511120044.i2blPN85-lkp@xxxxxxxxx/config)
compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251112/202511120044.i2blPN85-lkp@xxxxxxxxx/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@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202511120044.i2blPN85-lkp@xxxxxxxxx/

All errors (new ones prefixed by >>):

>> drivers/usb/typec/ucsi/ucsi.c:547:7: error: call to undeclared function 'ucsi_altmode_is_duplicate'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
547 | if (ucsi_altmode_is_duplicate(con, recipient, altmode_array, i,
| ^
drivers/usb/typec/ucsi/ucsi.c:570:13: error: static declaration of 'ucsi_altmode_is_duplicate' follows non-static declaration
570 | static bool ucsi_altmode_is_duplicate(struct ucsi_connector *con, u8 recipient,
| ^
drivers/usb/typec/ucsi/ucsi.c:547:7: note: previous implicit declaration is here
547 | if (ucsi_altmode_is_duplicate(con, recipient, altmode_array, i,
| ^
2 errors generated.


vim +/ucsi_altmode_is_duplicate +547 drivers/usb/typec/ucsi/ucsi.c

483
484 static int
485 ucsi_register_altmodes_nvidia(struct ucsi_connector *con, u8 recipient)
486 {
487 int max_altmodes = UCSI_MAX_ALTMODES;
488 struct typec_altmode_desc desc;
489 struct ucsi_altmode alt;
490 struct ucsi_altmode orig[UCSI_MAX_ALTMODES];
491 struct ucsi_altmode updated[UCSI_MAX_ALTMODES];
492 struct ucsi *ucsi = con->ucsi;
493 bool multi_dp = false;
494 u64 command;
495 int ret;
496 int len;
497 int i;
498 int k = 0;
499
500 if (recipient == UCSI_RECIPIENT_CON)
501 max_altmodes = con->ucsi->cap.num_alt_modes;
502
503 memset(orig, 0, sizeof(orig));
504 memset(updated, 0, sizeof(updated));
505
506 /* First get all the alternate modes */
507 for (i = 0; i < max_altmodes; i++) {
508 memset(&alt, 0, sizeof(alt));
509 command = UCSI_GET_ALTERNATE_MODES;
510 command |= UCSI_GET_ALTMODE_RECIPIENT(recipient);
511 command |= UCSI_GET_ALTMODE_CONNECTOR_NUMBER(con->num);
512 command |= UCSI_GET_ALTMODE_OFFSET(i);
513 len = ucsi_send_command(con->ucsi, command, &alt, sizeof(alt));
514 /*
515 * We are collecting all altmodes first and then registering.
516 * Some type-C device will return zero length data beyond last
517 * alternate modes. We should not return if length is zero.
518 */
519 if (len < 0)
520 return len;
521
522 /* We got all altmodes, now break out and register them */
523 if (!len || !alt.svid)
524 break;
525
526 orig[k].mid = alt.mid;
527 orig[k].svid = alt.svid;
528 k++;
529 }
530 /*
531 * Update the original altmode table as some ppms may report
532 * multiple DP altmodes.
533 */
534 multi_dp = ucsi->ops->update_altmodes(ucsi, recipient, orig, updated);
535
536 /* now register altmodes */
537 for (i = 0; i < max_altmodes; i++) {
538 struct ucsi_altmode *altmode_array = multi_dp ? updated : orig;
539
540 if (!altmode_array[i].svid)
541 return 0;
542
543 /*
544 * Check for duplicates in current array and already
545 * registered altmodes. Skip if duplicate found.
546 */
> 547 if (ucsi_altmode_is_duplicate(con, recipient, altmode_array, i,
548 altmode_array[i].svid,
549 altmode_array[i].mid, i))
550 continue;
551
552 memset(&desc, 0, sizeof(desc));
553 desc.svid = altmode_array[i].svid;
554 desc.vdo = altmode_array[i].mid;
555 desc.roles = TYPEC_PORT_DRD;
556
557 ret = ucsi_register_altmode(con, &desc, recipient);
558 if (ret)
559 return ret;
560 }
561
562 return 0;
563 }
564

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki