From: kernel test robot <lkp@intel.com>
To: jason.zeng@intel.com, wu.zheng@intel.com, pei.p.jia@intel.com
Cc: oe-kbuild-all@lists.linux.dev
Subject: [bytedance:5.15-velinux 5521/23944] drivers/bytedance/blackholefs/file.c:28:15: warning: variable 'fname' set but not used
Date: Fri, 30 Aug 2024 12:18:49 +0800 [thread overview]
Message-ID: <202408301228.Wi06EmX1-lkp@intel.com> (raw)
tree: https://github.com/bytedance/kernel.git 5.15-velinux
head: 114077d3641f55e0727e810a4f1277a658f703b7
commit: 658231c84c81b024c130b724cf9f12e5b018528d [5521/23944] bytedance: driver: blackholefs: Add blackholefs driver
config: x86_64-bytedance-5.15-velinux (https://download.01.org/0day-ci/archive/20240830/202408301228.Wi06EmX1-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/20240830/202408301228.Wi06EmX1-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/202408301228.Wi06EmX1-lkp@intel.com/
All warnings (new ones prefixed by >>):
drivers/bytedance/blackholefs/file.c: In function 'blackholefs_read':
>> drivers/bytedance/blackholefs/file.c:28:15: warning: variable 'fname' set but not used [-Wunused-but-set-variable]
28 | char *fname = "UNKNOWN";
| ^~~~~
drivers/bytedance/blackholefs/file.c: In function 'blackholefs_write':
drivers/bytedance/blackholefs/file.c:62:15: warning: variable 'fname' set but not used [-Wunused-but-set-variable]
62 | char *fname = "UNKNOWN";
| ^~~~~
vim +/fname +28 drivers/bytedance/blackholefs/file.c
23
24 ssize_t blackholefs_read(struct file *f, char __user *ubuf, size_t s,
25 loff_t *off)
26 {
27 loff_t read_size;
> 28 char *fname = "UNKNOWN";
29
30 TRACE();
31 if (!f->f_inode) {
32 ERROR();
33 return 0;
34 }
35
36 if (f->f_path.dentry && f->f_path.dentry->d_name.name)
37 fname = (char*)f->f_path.dentry->d_name.name;
38
39 if (*off >= f->f_inode->i_size)
40 return 0;
41
42 DEBUG("[READ][%s] : f->f_pos = %lld, off = %lld, size = %ld, inode->i_size = %lld\n",
43 fname, f->f_pos, *off, s, f->f_inode->i_size);
44
45 if ((*off + s ) >= f->f_inode->i_size)
46 read_size = f->f_inode->i_size - *off;
47 else
48 read_size = s;
49
50 *off += read_size;
51 if(clear_user(ubuf, s)) {
52 ERROR();
53 }
54
55 return read_size;
56 }
57
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
reply other threads:[~2024-08-30 4: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=202408301228.Wi06EmX1-lkp@intel.com \
--to=lkp@intel.com \
--cc=jason.zeng@intel.com \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=pei.p.jia@intel.com \
--cc=wu.zheng@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 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.