mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Rajat Khandelwal <rajat.khandelwal@linux.intel.com>
Cc: oe-kbuild-all@lists.linux.dev, linux-kernel@vger.kernel.org,
	Heikki Krogerus <heikki.krogerus@linux.intel.com>
Subject: drivers/usb/typec/mux/intel_pmc_mux.c:664:43: warning: '%d' directive output may be truncated writing between 1 and 3 bytes into a region of size 2
Date: Tue, 3 Dec 2024 14:58:52 +0800	[thread overview]
Message-ID: <202412031437.vX580pxx-lkp@intel.com> (raw)

Hi Rajat,

FYI, the error/warning still remains.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   cdd30ebb1b9f36159d66f088b61aee264e649d7a
commit: 0a453dc9f260281e3a063e07b526a7e494e496fe usb: typec: intel_pmc_mux: Expose IOM port status to debugfs
date:   1 year, 6 months ago
config: x86_64-buildonly-randconfig-002-20240106 (https://download.01.org/0day-ci/archive/20241203/202412031437.vX580pxx-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241203/202412031437.vX580pxx-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/202412031437.vX580pxx-lkp@intel.com/

All warnings (new ones prefixed by >>):

   drivers/usb/typec/mux/intel_pmc_mux.c: In function 'pmc_usb_probe':
>> drivers/usb/typec/mux/intel_pmc_mux.c:664:43: warning: '%d' directive output may be truncated writing between 1 and 3 bytes into a region of size 2 [-Wformat-truncation=]
     664 |         snprintf(name, sizeof(name), "port%d", port->usb3_port - 1);
         |                                           ^~
   In function 'pmc_mux_port_debugfs_init',
       inlined from 'pmc_usb_probe' at drivers/usb/typec/mux/intel_pmc_mux.c:723:3:
   drivers/usb/typec/mux/intel_pmc_mux.c:664:38: note: directive argument in the range [-1, 254]
     664 |         snprintf(name, sizeof(name), "port%d", port->usb3_port - 1);
         |                                      ^~~~~~~~
   drivers/usb/typec/mux/intel_pmc_mux.c:664:9: note: 'snprintf' output between 6 and 8 bytes into a destination of size 6
     664 |         snprintf(name, sizeof(name), "port%d", port->usb3_port - 1);
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


vim +664 drivers/usb/typec/mux/intel_pmc_mux.c

   658	
   659	static void pmc_mux_port_debugfs_init(struct pmc_usb_port *port)
   660	{
   661		struct dentry *debugfs_dir;
   662		char name[6];
   663	
 > 664		snprintf(name, sizeof(name), "port%d", port->usb3_port - 1);
   665	
   666		debugfs_dir = debugfs_create_dir(name, port->pmc->dentry);
   667		debugfs_create_file("iom_status", 0400, debugfs_dir, port,
   668				    &port_iom_status_fops);
   669	}
   670	

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

                 reply	other threads:[~2024-12-03  6:59 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=202412031437.vX580pxx-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=heikki.krogerus@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=rajat.khandelwal@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

all inboxes | Powered by JetHome®