From: kernel test robot <lkp@intel.com>
To: Cai Huoqing <cai.huoqing@linux.dev>
Cc: oe-kbuild-all@lists.linux.dev, linux-kernel@vger.kernel.org,
Vinod Koul <vkoul@kernel.org>,
Serge Semin <fancer.lancer@gmail.com>,
Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Subject: drivers/dma/dw-edma/dw-hdma-v0-debugfs.c:125:50: warning: '%d' directive output may be truncated writing between 1 and 11 bytes into a region of size 8
Date: Fri, 3 Nov 2023 08:45:33 +0800 [thread overview]
Message-ID: <202311030809.CjufIFaP-lkp@intel.com> (raw)
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 4652b8e4f3ffa48c706ec334f048c217a7d9750d
commit: 353d5c241e83c4de04ca5ec0d7922bfb0809aa25 dmaengine: dw-edma: Add HDMA DebugFS support
date: 5 months ago
config: parisc-randconfig-001-20231102 (https://download.01.org/0day-ci/archive/20231103/202311030809.CjufIFaP-lkp@intel.com/config)
compiler: hppa-linux-gcc (GCC) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231103/202311030809.CjufIFaP-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/202311030809.CjufIFaP-lkp@intel.com/
All warnings (new ones prefixed by >>):
drivers/dma/dw-edma/dw-hdma-v0-debugfs.c: In function 'dw_hdma_v0_debugfs_on':
>> drivers/dma/dw-edma/dw-hdma-v0-debugfs.c:125:50: warning: '%d' directive output may be truncated writing between 1 and 11 bytes into a region of size 8 [-Wformat-truncation=]
125 | snprintf(name, sizeof(name), "%s:%d", CHANNEL_STR, i);
| ^~
In function 'dw_hdma_debugfs_regs_wr',
inlined from 'dw_hdma_debugfs_regs' at drivers/dma/dw-edma/dw-hdma-v0-debugfs.c:156:2,
inlined from 'dw_hdma_v0_debugfs_on' at drivers/dma/dw-edma/dw-hdma-v0-debugfs.c:169:2:
drivers/dma/dw-edma/dw-hdma-v0-debugfs.c:125:46: note: directive argument in the range [-2147483641, 65534]
125 | snprintf(name, sizeof(name), "%s:%d", CHANNEL_STR, i);
| ^~~~~~~
drivers/dma/dw-edma/dw-hdma-v0-debugfs.c:125:17: note: 'snprintf' output between 10 and 20 bytes into a destination of size 16
125 | snprintf(name, sizeof(name), "%s:%d", CHANNEL_STR, i);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/dma/dw-edma/dw-hdma-v0-debugfs.c: In function 'dw_hdma_v0_debugfs_on':
drivers/dma/dw-edma/dw-hdma-v0-debugfs.c:142:50: warning: '%d' directive output may be truncated writing between 1 and 11 bytes into a region of size 8 [-Wformat-truncation=]
142 | snprintf(name, sizeof(name), "%s:%d", CHANNEL_STR, i);
| ^~
In function 'dw_hdma_debugfs_regs_rd',
inlined from 'dw_hdma_debugfs_regs' at drivers/dma/dw-edma/dw-hdma-v0-debugfs.c:157:2,
inlined from 'dw_hdma_v0_debugfs_on' at drivers/dma/dw-edma/dw-hdma-v0-debugfs.c:169:2:
drivers/dma/dw-edma/dw-hdma-v0-debugfs.c:142:46: note: directive argument in the range [-2147483641, 65534]
142 | snprintf(name, sizeof(name), "%s:%d", CHANNEL_STR, i);
| ^~~~~~~
drivers/dma/dw-edma/dw-hdma-v0-debugfs.c:142:17: note: 'snprintf' output between 10 and 20 bytes into a destination of size 16
142 | snprintf(name, sizeof(name), "%s:%d", CHANNEL_STR, i);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
vim +125 drivers/dma/dw-edma/dw-hdma-v0-debugfs.c
115
116 static void dw_hdma_debugfs_regs_wr(struct dw_edma *dw, struct dentry *dent)
117 {
118 struct dentry *regs_dent, *ch_dent;
119 char name[16];
120 int i;
121
122 regs_dent = debugfs_create_dir(WRITE_STR, dent);
123
124 for (i = 0; i < dw->wr_ch_cnt; i++) {
> 125 snprintf(name, sizeof(name), "%s:%d", CHANNEL_STR, i);
126
127 ch_dent = debugfs_create_dir(name, regs_dent);
128
129 dw_hdma_debugfs_regs_ch(dw, EDMA_DIR_WRITE, i, ch_dent);
130 }
131 }
132
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
reply other threads:[~2023-11-03 0:46 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=202311030809.CjufIFaP-lkp@intel.com \
--to=lkp@intel.com \
--cc=cai.huoqing@linux.dev \
--cc=fancer.lancer@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=manivannan.sadhasivam@linaro.org \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=vkoul@kernel.org \
/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