[linux-next:master 10640/12208] drivers/gpu/drm/i915/display/intel_tc.c:1845:11: error: '%d' directive output may be truncated writing between 1 and 11 bytes into a region of size 3

[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:   e3f80d3eae76c3557b3c9b5938ad01c0e6cf25ec
commit: 6d4ab2e97dcfbcd748ae71761a9d8e5e41cc732c [10640/12208] extrawarn: enable format and stringop overflow warnings in W=1
config: x86_64-randconfig-071-20230824 (https://download.01.org/0day-ci/archive/20230824/202308240556.jFbsuVxg-lkp@xxxxxxxxx/config)
compiler: gcc-7 (Ubuntu 7.5.0-6ubuntu2) 7.5.0
reproduce: (https://download.01.org/0day-ci/archive/20230824/202308240556.jFbsuVxg-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/202308240556.jFbsuVxg-lkp@xxxxxxxxx/

All errors (new ones prefixed by >>):

   drivers/gpu/drm/i915/display/intel_tc.c: In function 'intel_tc_port_init':
>> drivers/gpu/drm/i915/display/intel_tc.c:1845:11: error: '%d' directive output may be truncated writing between 1 and 11 bytes into a region of size 3 [-Werror=format-truncation=]
       "%c/TC#%d", port_name(port), tc_port + 1);
              ^~
   drivers/gpu/drm/i915/display/intel_tc.c:1845:4: note: directive argument in the range [-2147483647, 2147483647]
       "%c/TC#%d", port_name(port), tc_port + 1);
       ^~~~~~~~~~
   drivers/gpu/drm/i915/display/intel_tc.c:1844:2: note: 'snprintf' output between 7 and 17 bytes into a destination of size 8
     snprintf(tc->port_name, sizeof(tc->port_name),
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       "%c/TC#%d", port_name(port), tc_port + 1);
       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   cc1: all warnings being treated as errors


vim +1845 drivers/gpu/drm/i915/display/intel_tc.c

bc85328ff431e4 Imre Deak     2019-06-28  1817  
c5879999641f78 Imre Deak     2023-03-23  1818  int intel_tc_port_init(struct intel_digital_port *dig_port, bool is_legacy)
ab7bc4e1a5508e Imre Deak     2019-06-28  1819  {
ab7bc4e1a5508e Imre Deak     2019-06-28  1820  	struct drm_i915_private *i915 = to_i915(dig_port->base.base.dev);
c5879999641f78 Imre Deak     2023-03-23  1821  	struct intel_tc_port *tc;
ab7bc4e1a5508e Imre Deak     2019-06-28  1822  	enum port port = dig_port->base.port;
ab7bc4e1a5508e Imre Deak     2019-06-28  1823  	enum tc_port tc_port = intel_port_to_tc(i915, port);
ab7bc4e1a5508e Imre Deak     2019-06-28  1824  
320c670c048d3b Ville Syrjälä 2020-10-28  1825  	if (drm_WARN_ON(&i915->drm, tc_port == TC_PORT_NONE))
c5879999641f78 Imre Deak     2023-03-23  1826  		return -EINVAL;
ab7bc4e1a5508e Imre Deak     2019-06-28  1827  
c5879999641f78 Imre Deak     2023-03-23  1828  	tc = kzalloc(sizeof(*tc), GFP_KERNEL);
c5879999641f78 Imre Deak     2023-03-23  1829  	if (!tc)
c5879999641f78 Imre Deak     2023-03-23  1830  		return -ENOMEM;
c5879999641f78 Imre Deak     2023-03-23  1831  
c5879999641f78 Imre Deak     2023-03-23  1832  	dig_port->tc = tc;
3eafcddf766b6b Imre Deak     2023-03-23  1833  	tc->dig_port = dig_port;
3eafcddf766b6b Imre Deak     2023-03-23  1834  
6f0423b06a0cd5 Mika Kahola   2023-04-28  1835  	if (DISPLAY_VER(i915) >= 14)
6f0423b06a0cd5 Mika Kahola   2023-04-28  1836  		tc->phy_ops = &xelpdp_tc_phy_ops;
6f0423b06a0cd5 Mika Kahola   2023-04-28  1837  	else if (DISPLAY_VER(i915) >= 13)
34a658b7e7128b Imre Deak     2023-03-23  1838  		tc->phy_ops = &adlp_tc_phy_ops;
16cf693e31bdb4 Imre Deak     2023-03-23  1839  	else if (DISPLAY_VER(i915) >= 12)
16cf693e31bdb4 Imre Deak     2023-03-23  1840  		tc->phy_ops = &tgl_tc_phy_ops;
34a658b7e7128b Imre Deak     2023-03-23  1841  	else
34a658b7e7128b Imre Deak     2023-03-23  1842  		tc->phy_ops = &icl_tc_phy_ops;
34a658b7e7128b Imre Deak     2023-03-23  1843  
3eafcddf766b6b Imre Deak     2023-03-23  1844  	snprintf(tc->port_name, sizeof(tc->port_name),
ab7bc4e1a5508e Imre Deak     2019-06-28 @1845  		 "%c/TC#%d", port_name(port), tc_port + 1);
ab7bc4e1a5508e Imre Deak     2019-06-28  1846  
3eafcddf766b6b Imre Deak     2023-03-23  1847  	mutex_init(&tc->lock);
c598c335da4207 Imre Deak     2023-05-12  1848  	/* TODO: Combine the two works */
3eafcddf766b6b Imre Deak     2023-03-23  1849  	INIT_DELAYED_WORK(&tc->disconnect_phy_work, intel_tc_port_disconnect_phy_work);
c598c335da4207 Imre Deak     2023-05-12  1850  	INIT_DELAYED_WORK(&tc->link_reset_work, intel_tc_port_link_reset_work);
3eafcddf766b6b Imre Deak     2023-03-23  1851  	tc->legacy_port = is_legacy;
3eafcddf766b6b Imre Deak     2023-03-23  1852  	tc->mode = TC_PORT_DISCONNECTED;
3eafcddf766b6b Imre Deak     2023-03-23  1853  	tc->link_refcount = 0;
c55b73f391a726 Imre Deak     2023-03-23  1854  
c55b73f391a726 Imre Deak     2023-03-23  1855  	tc_phy_init(tc);
a82796a2e332d1 Imre Deak     2022-09-22  1856  
a82796a2e332d1 Imre Deak     2022-09-22  1857  	intel_tc_port_init_mode(dig_port);
c5879999641f78 Imre Deak     2023-03-23  1858  
c5879999641f78 Imre Deak     2023-03-23  1859  	return 0;
c5879999641f78 Imre Deak     2023-03-23  1860  }
c5879999641f78 Imre Deak     2023-03-23  1861  

:::::: The code at line 1845 was first introduced by commit
:::::: ab7bc4e1a5508e5cb974985fba325d80086b3f10 drm/i915: Unify the TypeC port notation in debug/error messages

:::::: TO: Imre Deak <imre.deak@xxxxxxxxx>
:::::: CC: Imre Deak <imre.deak@xxxxxxxxx>

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




[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