From: kernel test robot <lkp@intel.com>
To: Christian Brauner <brauner@kernel.org>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
Christian Brauner <christianvanbrauner@gmail.com>
Subject: [brauner-vfs:b4/vfs-bdev-file 41/42] fs/ntfs3/fsntfs.c:1011:23: warning: unused variable 'bdev'
Date: Thu, 4 Jan 2024 04:09:30 +0800 [thread overview]
Message-ID: <202401040431.fnq6ljbX-lkp@intel.com> (raw)
tree: https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git b4/vfs-bdev-file
head: 81a0b5d317a5188e7e8aaf68adf070d44c7a3eea
commit: 6d26064a464a6f8ace90a2176a17bd6f853825e0 [41/42] [DRAFT] buffer: port block device access to files and get rid of bd_inode access
config: i386-buildonly-randconfig-002-20240103 (https://download.01.org/0day-ci/archive/20240104/202401040431.fnq6ljbX-lkp@intel.com/config)
compiler: ClangBuiltLinux clang version 17.0.6 (https://github.com/llvm/llvm-project 6009708b4367171ccdbf4b5905cb6a803753fe18)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240104/202401040431.fnq6ljbX-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/202401040431.fnq6ljbX-lkp@intel.com/
All warnings (new ones prefixed by >>):
>> fs/ntfs3/fsntfs.c:1011:23: warning: unused variable 'bdev' [-Wunused-variable]
1011 | struct block_device *bdev = sb->s_bdev;
| ^~~~
fs/ntfs3/fsntfs.c:1041:23: warning: unused variable 'bdev' [-Wunused-variable]
1041 | struct block_device *bdev = sb->s_bdev;
| ^~~~
2 warnings generated.
vim +/bdev +1011 fs/ntfs3/fsntfs.c
82cae269cfa953 Konstantin Komarov 2021-08-13 1008
82cae269cfa953 Konstantin Komarov 2021-08-13 1009 int ntfs_sb_read(struct super_block *sb, u64 lbo, size_t bytes, void *buffer)
82cae269cfa953 Konstantin Komarov 2021-08-13 1010 {
82cae269cfa953 Konstantin Komarov 2021-08-13 @1011 struct block_device *bdev = sb->s_bdev;
82cae269cfa953 Konstantin Komarov 2021-08-13 1012 u32 blocksize = sb->s_blocksize;
82cae269cfa953 Konstantin Komarov 2021-08-13 1013 u64 block = lbo >> sb->s_blocksize_bits;
82cae269cfa953 Konstantin Komarov 2021-08-13 1014 u32 off = lbo & (blocksize - 1);
82cae269cfa953 Konstantin Komarov 2021-08-13 1015 u32 op = blocksize - off;
82cae269cfa953 Konstantin Komarov 2021-08-13 1016
82cae269cfa953 Konstantin Komarov 2021-08-13 1017 for (; bytes; block += 1, off = 0, op = blocksize) {
6d26064a464a6f Christian Brauner 2024-01-02 1018 struct buffer_head *bh = __bread(sb->s_f_bdev, block, blocksize);
82cae269cfa953 Konstantin Komarov 2021-08-13 1019
82cae269cfa953 Konstantin Komarov 2021-08-13 1020 if (!bh)
82cae269cfa953 Konstantin Komarov 2021-08-13 1021 return -EIO;
82cae269cfa953 Konstantin Komarov 2021-08-13 1022
82cae269cfa953 Konstantin Komarov 2021-08-13 1023 if (op > bytes)
82cae269cfa953 Konstantin Komarov 2021-08-13 1024 op = bytes;
82cae269cfa953 Konstantin Komarov 2021-08-13 1025
82cae269cfa953 Konstantin Komarov 2021-08-13 1026 memcpy(buffer, bh->b_data + off, op);
82cae269cfa953 Konstantin Komarov 2021-08-13 1027
82cae269cfa953 Konstantin Komarov 2021-08-13 1028 put_bh(bh);
82cae269cfa953 Konstantin Komarov 2021-08-13 1029
82cae269cfa953 Konstantin Komarov 2021-08-13 1030 bytes -= op;
82cae269cfa953 Konstantin Komarov 2021-08-13 1031 buffer = Add2Ptr(buffer, op);
82cae269cfa953 Konstantin Komarov 2021-08-13 1032 }
82cae269cfa953 Konstantin Komarov 2021-08-13 1033
82cae269cfa953 Konstantin Komarov 2021-08-13 1034 return 0;
82cae269cfa953 Konstantin Komarov 2021-08-13 1035 }
82cae269cfa953 Konstantin Komarov 2021-08-13 1036
:::::: The code at line 1011 was first introduced by commit
:::::: 82cae269cfa953032fbb8980a7d554d60fb00b17 fs/ntfs3: Add initialization of super block
:::::: TO: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
:::::: CC: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
reply other threads:[~2024-01-03 20:10 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=202401040431.fnq6ljbX-lkp@intel.com \
--to=lkp@intel.com \
--cc=brauner@kernel.org \
--cc=christianvanbrauner@gmail.com \
--cc=llvm@lists.linux.dev \
--cc=oe-kbuild-all@lists.linux.dev \
/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