All of lore.kernel.org
 help / color / mirror / Atom feed
* [bytedance:5.15-velinux 5521/23944] drivers/bytedance/blackholefs/file.c:28:15: warning: variable 'fname' set but not used
@ 2024-08-30  4:18 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2024-08-30  4:18 UTC (permalink / raw)
  To: jason.zeng, wu.zheng, pei.p.jia; +Cc: oe-kbuild-all

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-08-30  4:19 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-30  4:18 [bytedance:5.15-velinux 5521/23944] drivers/bytedance/blackholefs/file.c:28:15: warning: variable 'fname' set but not used kernel test robot

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.