mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: James Smart <jsmart2021@gmail.com>
Cc: oe-kbuild-all@lists.linux.dev, linux-kernel@vger.kernel.org,
	"Martin K. Petersen" <martin.petersen@oracle.com>,
	Hannes Reinecke <hare@suse.de>, Daniel Wagner <dwagner@suse.de>,
	Ram Vegesna <ram.vegesna@broadcom.com>
Subject: drivers/scsi/elx/libefc/efc_node.c:254:65: warning: 'snprintf' output may be truncated before the last format character
Date: Fri, 1 Dec 2023 01:10:11 +0800	[thread overview]
Message-ID: <202312010138.o5on1HtR-lkp@intel.com> (raw)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   3b47bc037bd44f142ac09848e8d3ecccc726be99
commit: ebc076b3eddc807729bd81f7bc48e798a3ddc477 scsi: elx: efct: Tie into kernel Kconfig and build process
date:   2 years, 6 months ago
config: x86_64-randconfig-014-20230906 (https://download.01.org/0day-ci/archive/20231201/202312010138.o5on1HtR-lkp@intel.com/config)
compiler: gcc-7 (Ubuntu 7.5.0-6ubuntu2) 7.5.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231201/202312010138.o5on1HtR-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/202312010138.o5on1HtR-lkp@intel.com/

All warnings (new ones prefixed by >>):

   drivers/scsi/elx/libefc/efc_node.c: In function 'efc_node_update_display_name':
>> drivers/scsi/elx/libefc/efc_node.c:254:65: warning: 'snprintf' output may be truncated before the last format character [-Wformat-truncation=]
     snprintf(node->display_name, sizeof(node->display_name), "%s.%s",
                                                                    ^
   drivers/scsi/elx/libefc/efc_node.c:254:2: note: 'snprintf' output 2 or more bytes (assuming 33) into a destination of size 32
     snprintf(node->display_name, sizeof(node->display_name), "%s.%s",
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       nport->display_name, portid_display);
       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


vim +/snprintf +254 drivers/scsi/elx/libefc/efc_node.c

6bc6180d7b5c97 James Smart 2021-06-01  244  
6bc6180d7b5c97 James Smart 2021-06-01  245  void
6bc6180d7b5c97 James Smart 2021-06-01  246  efc_node_update_display_name(struct efc_node *node)
6bc6180d7b5c97 James Smart 2021-06-01  247  {
6bc6180d7b5c97 James Smart 2021-06-01  248  	u32 port_id = node->rnode.fc_id;
6bc6180d7b5c97 James Smart 2021-06-01  249  	struct efc_nport *nport = node->nport;
6bc6180d7b5c97 James Smart 2021-06-01  250  	char portid_display[16];
6bc6180d7b5c97 James Smart 2021-06-01  251  
6bc6180d7b5c97 James Smart 2021-06-01  252  	efc_node_fcid_display(port_id, portid_display, sizeof(portid_display));
6bc6180d7b5c97 James Smart 2021-06-01  253  
6bc6180d7b5c97 James Smart 2021-06-01 @254  	snprintf(node->display_name, sizeof(node->display_name), "%s.%s",
6bc6180d7b5c97 James Smart 2021-06-01  255  		 nport->display_name, portid_display);
6bc6180d7b5c97 James Smart 2021-06-01  256  }
6bc6180d7b5c97 James Smart 2021-06-01  257  

:::::: The code at line 254 was first introduced by commit
:::::: 6bc6180d7b5c972c10a2f5392621921de32ce5bc scsi: elx: libefc: Remote node state machine interfaces

:::::: TO: James Smart <jsmart2021@gmail.com>
:::::: CC: Martin K. Petersen <martin.petersen@oracle.com>

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

                 reply	other threads:[~2023-11-30 17:11 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=202312010138.o5on1HtR-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=dwagner@suse.de \
    --cc=hare@suse.de \
    --cc=jsmart2021@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=ram.vegesna@broadcom.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®