2024-05-20 19:15:35

by Julia Lawall

[permalink] [raw]
Subject: drivers/gpu/drm/tegra/dp.c:738:22-33: opportunity for str_plural(link -> lanes) (fwd)



---------- Forwarded message ----------
Date: Sat, 18 May 2024 02:26:08 +0800
From: kernel test robot <[email protected]>
To: [email protected]
Cc: [email protected], Julia Lawall <[email protected]>
Subject: drivers/gpu/drm/tegra/dp.c:738:22-33: opportunity for str_plural(link
-> lanes)

BCC: [email protected]
CC: [email protected]
CC: [email protected]
TO: "Christian K?nig" <[email protected]>
CC: Thierry Reding <[email protected]>

tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: ff2632d7d08edc11e8bd0629e9fcfebab25c78b4
commit: f75d19827b731c6f24930ef77e5a46cf2242bc68 drm/tegra: Allow compile test on !ARM v2
date: 1 year, 1 month ago
:::::: branch date: 2 hours ago
:::::: commit date: 1 year, 1 month ago
config: mips-randconfig-r052-20240517 (https://download.01.org/0day-ci/archive/20240518/[email protected]/config)
compiler: clang version 19.0.0git (https://github.com/llvm/llvm-project d3455f4ddd16811401fa153298fadd2f59f6914e)

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 <[email protected]>
| Reported-by: Julia Lawall <[email protected]>
| Closes: https://lore.kernel.org/r/[email protected]/

cocci warnings: (new ones prefixed by >>)
>> drivers/gpu/drm/tegra/dp.c:738:22-33: opportunity for str_plural(link -> lanes)
drivers/gpu/drm/tegra/dp.c:794:22-33: opportunity for str_plural(link -> lanes)
--
>> drivers/gpu/drm/tegra/sor.c:939:11-16: opportunity for str_plural(lanes)

vim +738 drivers/gpu/drm/tegra/dp.c

078c445733c1e8 Thierry Reding 2015-07-07 731
078c445733c1e8 Thierry Reding 2015-07-07 732 static int drm_dp_link_train_full(struct drm_dp_link *link)
078c445733c1e8 Thierry Reding 2015-07-07 733 {
078c445733c1e8 Thierry Reding 2015-07-07 734 int err;
078c445733c1e8 Thierry Reding 2015-07-07 735
078c445733c1e8 Thierry Reding 2015-07-07 736 retry:
078c445733c1e8 Thierry Reding 2015-07-07 737 DRM_DEBUG_KMS("full-training link: %u lane%s at %u MHz\n",
078c445733c1e8 Thierry Reding 2015-07-07 @738 link->lanes, (link->lanes > 1) ? "s" : "",
078c445733c1e8 Thierry Reding 2015-07-07 739 link->rate / 100);
078c445733c1e8 Thierry Reding 2015-07-07 740
078c445733c1e8 Thierry Reding 2015-07-07 741 err = drm_dp_link_configure(link->aux, link);
078c445733c1e8 Thierry Reding 2015-07-07 742 if (err < 0) {
078c445733c1e8 Thierry Reding 2015-07-07 743 DRM_ERROR("failed to configure DP link: %d\n", err);
078c445733c1e8 Thierry Reding 2015-07-07 744 return err;
078c445733c1e8 Thierry Reding 2015-07-07 745 }
078c445733c1e8 Thierry Reding 2015-07-07 746
078c445733c1e8 Thierry Reding 2015-07-07 747 err = drm_dp_link_clock_recovery(link);
078c445733c1e8 Thierry Reding 2015-07-07 748 if (err < 0) {
078c445733c1e8 Thierry Reding 2015-07-07 749 DRM_ERROR("clock recovery failed: %d\n", err);
078c445733c1e8 Thierry Reding 2015-07-07 750 goto out;
078c445733c1e8 Thierry Reding 2015-07-07 751 }
078c445733c1e8 Thierry Reding 2015-07-07 752
078c445733c1e8 Thierry Reding 2015-07-07 753 if (!link->train.clock_recovered) {
078c445733c1e8 Thierry Reding 2015-07-07 754 DRM_ERROR("clock recovery failed, downgrading link\n");
078c445733c1e8 Thierry Reding 2015-07-07 755
078c445733c1e8 Thierry Reding 2015-07-07 756 err = drm_dp_link_downgrade(link);
078c445733c1e8 Thierry Reding 2015-07-07 757 if (err < 0)
078c445733c1e8 Thierry Reding 2015-07-07 758 goto out;
078c445733c1e8 Thierry Reding 2015-07-07 759
078c445733c1e8 Thierry Reding 2015-07-07 760 goto retry;
078c445733c1e8 Thierry Reding 2015-07-07 761 }
078c445733c1e8 Thierry Reding 2015-07-07 762
078c445733c1e8 Thierry Reding 2015-07-07 763 DRM_DEBUG_KMS("clock recovery succeeded\n");
078c445733c1e8 Thierry Reding 2015-07-07 764
078c445733c1e8 Thierry Reding 2015-07-07 765 err = drm_dp_link_channel_equalization(link);
078c445733c1e8 Thierry Reding 2015-07-07 766 if (err < 0) {
078c445733c1e8 Thierry Reding 2015-07-07 767 DRM_ERROR("channel equalization failed: %d\n", err);
078c445733c1e8 Thierry Reding 2015-07-07 768 goto out;
078c445733c1e8 Thierry Reding 2015-07-07 769 }
078c445733c1e8 Thierry Reding 2015-07-07 770
078c445733c1e8 Thierry Reding 2015-07-07 771 if (!link->train.channel_equalized) {
078c445733c1e8 Thierry Reding 2015-07-07 772 DRM_ERROR("channel equalization failed, downgrading link\n");
078c445733c1e8 Thierry Reding 2015-07-07 773
078c445733c1e8 Thierry Reding 2015-07-07 774 err = drm_dp_link_downgrade(link);
078c445733c1e8 Thierry Reding 2015-07-07 775 if (err < 0)
078c445733c1e8 Thierry Reding 2015-07-07 776 goto out;
078c445733c1e8 Thierry Reding 2015-07-07 777
078c445733c1e8 Thierry Reding 2015-07-07 778 goto retry;
078c445733c1e8 Thierry Reding 2015-07-07 779 }
078c445733c1e8 Thierry Reding 2015-07-07 780
078c445733c1e8 Thierry Reding 2015-07-07 781 DRM_DEBUG_KMS("channel equalization succeeded\n");
078c445733c1e8 Thierry Reding 2015-07-07 782
078c445733c1e8 Thierry Reding 2015-07-07 783 out:
078c445733c1e8 Thierry Reding 2015-07-07 784 drm_dp_link_train_disable(link);
078c445733c1e8 Thierry Reding 2015-07-07 785 return err;
078c445733c1e8 Thierry Reding 2015-07-07 786 }
078c445733c1e8 Thierry Reding 2015-07-07 787

:::::: The code at line 738 was first introduced by commit
:::::: 078c445733c1e8092e23391b251cad6b12f6156e drm/tegra: dp: Add DisplayPort link training helper

:::::: TO: Thierry Reding <[email protected]>
:::::: CC: Thierry Reding <[email protected]>

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