* [dhowells-fs:netfs-lib 25/34] fs/netfs/io.c:871:6: warning: variable 'ret' is used uninitialized whenever 'if' condition is true
@ 2023-10-02 15:19 kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2023-10-02 15:19 UTC (permalink / raw)
To: David Howells; +Cc: llvm, oe-kbuild-all
tree: https://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git netfs-lib
head: 8b08a7e2d3217f7054808246fc559c867f54a524
commit: 051a41b875d04f931d3416d7b15e4cd3f6ba4edb [25/34] netfs: Implement DIO write support
config: x86_64-rhel-8.3-rust (https://download.01.org/0day-ci/archive/20231002/202310022348.lsNkvm7R-lkp@intel.com/config)
compiler: clang version 16.0.4 (https://github.com/llvm/llvm-project.git ae42196bc493ffe877a7e3dff8be32035dea4d07)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231002/202310022348.lsNkvm7R-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/202310022348.lsNkvm7R-lkp@intel.com/
All warnings (new ones prefixed by >>):
>> fs/netfs/io.c:871:6: warning: variable 'ret' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
if (len2 && !netfs_rmw_read_one(rreq, start2, len2))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fs/netfs/io.c:898:9: note: uninitialized use occurs here
return ret;
^~~
fs/netfs/io.c:871:2: note: remove the 'if' if its condition is always false
if (len2 && !netfs_rmw_read_one(rreq, start2, len2))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fs/netfs/io.c:869:6: warning: variable 'ret' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
if (len1 && !netfs_rmw_read_one(rreq, start1, len1))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fs/netfs/io.c:898:9: note: uninitialized use occurs here
return ret;
^~~
fs/netfs/io.c:869:2: note: remove the 'if' if its condition is always false
if (len1 && !netfs_rmw_read_one(rreq, start1, len1))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fs/netfs/io.c:849:13: note: initialize the variable 'ret' to silence this warning
ssize_t ret;
^
= 0
2 warnings generated.
vim +871 fs/netfs/io.c
837
838 /*
839 * Begin the process of reading in one or two chunks of data for use by
840 * unbuffered write to perform an RMW cycle. We don't read directly into the
841 * write buffer as this may get called to redo the read in the case that a
842 * conditional write fails due to conflicting 3rd-party modifications.
843 */
844 ssize_t netfs_rmw_read(struct netfs_io_request *wreq, struct file *file,
845 unsigned long long start1, size_t len1,
846 unsigned long long start2, size_t len2)
847 {
848 struct netfs_io_request *rreq;
849 ssize_t ret;
850
851 _enter("RMW:R=%x %llx-%llx %llx-%llx",
852 rreq->debug_id, start1, start1 + len1 - 1, start2, start2 + len2 - 1);
853
854 rreq = netfs_alloc_request(wreq->mapping, file,
855 start1, start2 - start1 + len2, NETFS_RMW_READ);
856 if (IS_ERR(rreq))
857 return PTR_ERR(rreq);
858
859 INIT_WORK(&rreq->work, netfs_rreq_work);
860
861 rreq->iter = wreq->io_iter;
862 __set_bit(NETFS_RREQ_CRYPT_IN_PLACE, &rreq->flags);
863 __set_bit(NETFS_RREQ_USE_BOUNCE_BUFFER, &rreq->flags);
864
865 /* Chop the reads into slices according to what the netfs wants and
866 * submit each one.
867 */
868 atomic_set(&rreq->nr_outstanding, 1);
869 if (len1 && !netfs_rmw_read_one(rreq, start1, len1))
870 goto out;
> 871 if (len2 && !netfs_rmw_read_one(rreq, start2, len2))
--
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:[~2023-10-02 15:20 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-02 15:19 [dhowells-fs:netfs-lib 25/34] fs/netfs/io.c:871:6: warning: variable 'ret' is used uninitialized whenever 'if' condition is true 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.