All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Paul Louvel <paul.louvel@bootlin.com>
Cc: oe-kbuild-all@lists.linux.dev, 0day robot <lkp@intel.com>
Subject: drivers/watchdog/w83627hf_wdt.c:477:76: warning: 'snprintf' output may be truncated before the last format character
Date: Tue, 28 Jul 2026 03:18:53 +0200	[thread overview]
Message-ID: <202607280322.11cbY6i7-lkp@intel.com> (raw)

tree:   https://github.com/intel-lab-lkp/linux/commits/Paul-Louvel/watchdog-w83627hf_wdt-Replace-magic-numbers-with-descriptive-macros/20260727-030530
head:   755bcbc553aec8647f0f337daf2a12011b6e76b2
commit: 31600ea3f7702c3248b36b22a275225428a0092c watchdog: w83627hf_wdt: Convert to platform driver model
date:   30 hours ago
config: x86_64-randconfig-2005-20250721 (https://download.01.org/0day-ci/archive/20260728/202607280322.11cbY6i7-lkp@intel.com/config)
compiler: gcc-14 (Debian 14.2.0-19) 14.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260728/202607280322.11cbY6i7-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/202607280322.11cbY6i7-lkp@intel.com/

All warnings (new ones prefixed by >>):

   drivers/watchdog/w83627hf_wdt.c: In function 'wdt_probe':
>> drivers/watchdog/w83627hf_wdt.c:477:76: warning: 'snprintf' output may be truncated before the last format character [-Wformat-truncation=]
     477 |         snprintf(wdt_info.identity, sizeof(wdt_info.identity), "%s Watchdog",
         |                                                                            ^
   drivers/watchdog/w83627hf_wdt.c:477:9: note: 'snprintf' output between 10 and 33 bytes into a destination of size 32
     477 |         snprintf(wdt_info.identity, sizeof(wdt_info.identity), "%s Watchdog",
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     478 |                  id->name);
         |                  ~~~~~~~~~


vim +/snprintf +477 drivers/watchdog/w83627hf_wdt.c

   467	
   468	static int wdt_probe(struct platform_device *pdev)
   469	{
   470		const struct platform_device_id *id = platform_get_device_id(pdev);
   471		enum chips chip = id->driver_data;
   472		struct device *dev = &pdev->dev;
   473		int ret;
   474	
   475		dev_info(dev, "WDT driver initialising\n");
   476	
 > 477		snprintf(wdt_info.identity, sizeof(wdt_info.identity), "%s Watchdog",
   478			 id->name);
   479	
   480		watchdog_init_timeout(&wdt_dev, timeout, NULL);
   481		watchdog_set_nowayout(&wdt_dev, nowayout);
   482		watchdog_stop_on_reboot(&wdt_dev);
   483	
   484		ret = w83627hf_init(&wdt_dev, chip);
   485		if (ret)
   486			return dev_err_probe(dev, ret, "failed to initialize watchdog\n");
   487	
   488		ret = devm_watchdog_register_device(&pdev->dev, &wdt_dev);
   489		if (ret)
   490			return ret;
   491	
   492		dev_info(dev, "initialized. timeout=%d sec (nowayout=%d)\n",
   493			 wdt_dev.timeout, nowayout);
   494	
   495		return ret;
   496	}
   497	

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

                 reply	other threads:[~2026-07-28  1:19 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=202607280322.11cbY6i7-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=paul.louvel@bootlin.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.