public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* drivers/gpu/drm/xlnx/zynqmp_dp.c:2312:46: warning: 'snprintf' output may be truncated before the last format character
@ 2025-01-16 20:24 kernel test robot
  2025-01-16 20:28 ` Sean Anderson
  0 siblings, 1 reply; 3+ messages in thread
From: kernel test robot @ 2025-01-16 20:24 UTC (permalink / raw)
  To: Sean Anderson; +Cc: oe-kbuild-all, linux-kernel, Tomi Valkeinen

Hi Sean,

FYI, the error/warning still remains.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   ce69b4019001407f9cd738dd2ba217b3a8ab831b
commit: 28edaacb821c69241f6c0be6bbd29f7145f1b44f drm: zynqmp_dp: Add debugfs interface for compliance testing
date:   3 months ago
config: arm-randconfig-r013-20230520 (https://download.01.org/0day-ci/archive/20250117/202501170447.kNoyfjS5-lkp@intel.com/config)
compiler: arm-linux-gnueabi-gcc (GCC) 12.4.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250117/202501170447.kNoyfjS5-lkp@intel.com/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@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202501170447.kNoyfjS5-lkp@intel.com/

All warnings (new ones prefixed by >>):

   drivers/gpu/drm/xlnx/zynqmp_dp.c: In function 'zynqmp_dp_bridge_debugfs_init':
>> drivers/gpu/drm/xlnx/zynqmp_dp.c:2312:46: warning: 'snprintf' output may be truncated before the last format character [-Wformat-truncation=]
    2312 |                 snprintf(name, sizeof(name), fmt, i);
         |                                              ^~~
   drivers/gpu/drm/xlnx/zynqmp_dp.c:2312:17: note: 'snprintf' output between 18 and 20 bytes into a destination of size 19
    2312 |                 snprintf(name, sizeof(name), fmt, i);
         |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


vim +/snprintf +2312 drivers/gpu/drm/xlnx/zynqmp_dp.c

  2278	
  2279	DEFINE_DEBUGFS_ATTRIBUTE(fops_zynqmp_dp_ignore_hpd, zynqmp_dp_ignore_hpd_get,
  2280				 zynqmp_dp_ignore_hpd_set, "%llu\n");
  2281	
  2282	static void zynqmp_dp_bridge_debugfs_init(struct drm_bridge *bridge,
  2283						  struct dentry *root)
  2284	{
  2285		struct zynqmp_dp *dp = bridge_to_dp(bridge);
  2286		struct dentry *test;
  2287		int i;
  2288	
  2289		dp->test.bw_code = DP_LINK_BW_5_4;
  2290		dp->test.link_cnt = dp->num_lanes;
  2291	
  2292		test = debugfs_create_dir("test", root);
  2293	#define CREATE_FILE(name) \
  2294		debugfs_create_file(#name, 0600, test, dp, &fops_zynqmp_dp_##name)
  2295		CREATE_FILE(pattern);
  2296		CREATE_FILE(enhanced);
  2297		CREATE_FILE(downspread);
  2298		CREATE_FILE(active);
  2299		CREATE_FILE(custom);
  2300		CREATE_FILE(rate);
  2301		CREATE_FILE(lanes);
  2302		CREATE_FILE(ignore_aux_errors);
  2303		CREATE_FILE(ignore_hpd);
  2304	
  2305		for (i = 0; i < dp->num_lanes; i++) {
  2306			static const char fmt[] = "lane%d_preemphasis";
  2307			char name[sizeof(fmt)];
  2308	
  2309			dp->debugfs_train_set[i].dp = dp;
  2310			dp->debugfs_train_set[i].lane = i;
  2311	
> 2312			snprintf(name, sizeof(name), fmt, i);
  2313			debugfs_create_file(name, 0600, test,
  2314					    &dp->debugfs_train_set[i],
  2315					    &fops_zynqmp_dp_preemphasis);
  2316	
  2317			snprintf(name, sizeof(name), "lane%d_swing", i);
  2318			debugfs_create_file(name, 0600, test,
  2319					    &dp->debugfs_train_set[i],
  2320					    &fops_zynqmp_dp_swing);
  2321		}
  2322	}
  2323	

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: drivers/gpu/drm/xlnx/zynqmp_dp.c:2312:46: warning: 'snprintf' output may be truncated before the last format character
  2025-01-16 20:24 drivers/gpu/drm/xlnx/zynqmp_dp.c:2312:46: warning: 'snprintf' output may be truncated before the last format character kernel test robot
@ 2025-01-16 20:28 ` Sean Anderson
  2025-01-17  0:55   ` Philip Li
  0 siblings, 1 reply; 3+ messages in thread
From: Sean Anderson @ 2025-01-16 20:28 UTC (permalink / raw)
  To: kernel test robot; +Cc: oe-kbuild-all, linux-kernel, Tomi Valkeinen

On 1/16/25 15:24, kernel test robot wrote:
> Hi Sean,
> 
> FYI, the error/warning still remains.

Can we disable this warning for this code? It does not apply.

--Sean



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: drivers/gpu/drm/xlnx/zynqmp_dp.c:2312:46: warning: 'snprintf' output may be truncated before the last format character
  2025-01-16 20:28 ` Sean Anderson
@ 2025-01-17  0:55   ` Philip Li
  0 siblings, 0 replies; 3+ messages in thread
From: Philip Li @ 2025-01-17  0:55 UTC (permalink / raw)
  To: Sean Anderson
  Cc: kernel test robot, oe-kbuild-all, linux-kernel, Tomi Valkeinen

On Thu, Jan 16, 2025 at 03:28:11PM -0500, Sean Anderson wrote:
> On 1/16/25 15:24, kernel test robot wrote:
> > Hi Sean,
> > 
> > FYI, the error/warning still remains.
> 
> Can we disable this warning for this code? It does not apply.

Got it, we will follow up this asap, sorry about the false positive.

> 
> --Sean
> 
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-01-17  0:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-16 20:24 drivers/gpu/drm/xlnx/zynqmp_dp.c:2312:46: warning: 'snprintf' output may be truncated before the last format character kernel test robot
2025-01-16 20:28 ` Sean Anderson
2025-01-17  0:55   ` Philip Li

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox