[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 Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx/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@xxxxxxxxx>

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




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux