From: kernel test robot <lkp@intel.com>
To: Jani Nikula <jani.nikula@intel.com>
Cc: kbuild-all@lists.01.org,
"Linux Memory Management List" <linux-mm@kvack.org>,
"Ville Syrjälä" <ville.syrjala@linux.intel.com>
Subject: [linux-next:master 3517/4430] drivers/gpu/drm/display/drm_dp_helper.c:417 drm_dp_phy_name() warn: unsigned 'dp_phy' is never less than zero.
Date: Wed, 31 Aug 2022 23:51:18 +0800 [thread overview]
Message-ID: <202208312353.Ud9b5ise-lkp@intel.com> (raw)
tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head: 7fd22855300e693668c3397771b3a2b3948f827a
commit: 5b04aab6d49578eacd6d341e281c70a769f96126 [3517/4430] drm/dp: add drm_dp_phy_name() for getting DP PHY name
config: x86_64-randconfig-m001 (https://download.01.org/0day-ci/archive/20220831/202208312353.Ud9b5ise-lkp@intel.com/config)
compiler: gcc-11 (Debian 11.3.0-5) 11.3.0
If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@intel.com>
smatch warnings:
drivers/gpu/drm/display/drm_dp_helper.c:417 drm_dp_phy_name() warn: unsigned 'dp_phy' is never less than zero.
vim +/dp_phy +417 drivers/gpu/drm/display/drm_dp_helper.c
392
393 /**
394 * drm_dp_phy_name() - Get the name of the given DP PHY
395 * @dp_phy: The DP PHY identifier
396 *
397 * Given the @dp_phy, get a user friendly name of the DP PHY, either "DPRX" or
398 * "LTTPR <N>", or "<INVALID DP PHY>" on errors. The returned string is always
399 * non-NULL and valid.
400 *
401 * Returns: Name of the DP PHY.
402 */
403 const char *drm_dp_phy_name(enum drm_dp_phy dp_phy)
404 {
405 static const char * const phy_names[] = {
406 [DP_PHY_DPRX] = "DPRX",
407 [DP_PHY_LTTPR1] = "LTTPR 1",
408 [DP_PHY_LTTPR2] = "LTTPR 2",
409 [DP_PHY_LTTPR3] = "LTTPR 3",
410 [DP_PHY_LTTPR4] = "LTTPR 4",
411 [DP_PHY_LTTPR5] = "LTTPR 5",
412 [DP_PHY_LTTPR6] = "LTTPR 6",
413 [DP_PHY_LTTPR7] = "LTTPR 7",
414 [DP_PHY_LTTPR8] = "LTTPR 8",
415 };
416
> 417 if (dp_phy < 0 || dp_phy >= ARRAY_SIZE(phy_names) ||
418 WARN_ON(!phy_names[dp_phy]))
419 return "<INVALID DP PHY>";
420
421 return phy_names[dp_phy];
422 }
423 EXPORT_SYMBOL(drm_dp_phy_name);
424
--
0-DAY CI Kernel Test Service
https://01.org/lkp
reply other threads:[~2022-08-31 15:52 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=202208312353.Ud9b5ise-lkp@intel.com \
--to=lkp@intel.com \
--cc=jani.nikula@intel.com \
--cc=kbuild-all@lists.01.org \
--cc=linux-mm@kvack.org \
--cc=ville.syrjala@linux.intel.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox