Building the Linux kernel with Clang and LLVM
 help / color / mirror / Atom feed
* [dhowells-fs:ceph-iter 70/103] net/ceph/databuf.c:63:23: warning: variable 'part' is uninitialized when used within its own initialization
@ 2026-05-03 15:55 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2026-05-03 15:55 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 ceph-iter
head:   62509662bb514752f7ae58e3c60ed040bd2bafaf
commit: c11033e35bafd4cf945adf0ad8f58d22e5aa6a0d [70/103] libceph: Add a new data container type, ceph_databuf
config: hexagon-allmodconfig (https://download.01.org/0day-ci/archive/20260503/202605032337.WICropXv-lkp@intel.com/config)
compiler: 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/20260503/202605032337.WICropXv-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/202605032337.WICropXv-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> net/ceph/databuf.c:63:23: warning: variable 'part' is uninitialized when used within its own initialization [-Wuninitialized]
      63 |                         size_t part = umin(part, enc->space);
         |                                ~~~~        ^~~~
   include/linux/minmax.h:121:22: note: expanded from macro 'umin'
     121 |         __careful_cmp(min, (x) + 0u + 0ul + 0ull, (y) + 0u + 0ul + 0ull)
         |                             ^
   include/linux/minmax.h:98:25: note: expanded from macro '__careful_cmp'
      98 |         __careful_cmp_once(op, x, y, __UNIQUE_ID(x_), __UNIQUE_ID(y_))
         |                                ^
   include/linux/minmax.h:92:13: note: expanded from macro '__careful_cmp_once'
      92 |         auto ux = (x); auto uy = (y);                   \
         |                    ^
   1 warning generated.


vim +/part +63 net/ceph/databuf.c

    44	
    45	/**
    46	 * ceph_bvecq_append - Append some data onto a buffer
    47	 * @enc: The encoding context
    48	 * @data: The data to append
    49	 * @len: The length of the data
    50	 *
    51	 * Add some data onto the end of the encoding buffer's occupied region.  This
    52	 * will expand the maximum size of the buffer if necessary.
    53	 *
    54	 * If ENOMEM is encountered, enc->nomem is set to true and all future appends
    55	 * will do nothing.
    56	 */
    57	void ceph_bvecq_append(struct ceph_encode *enc, const void *data, size_t len)
    58	{
    59		for (;;) {
    60			struct bvecq *bq;
    61	
    62			if (likely(len <= enc->space)) {
  > 63				size_t part = umin(part, enc->space);
    64	
    65				memcpy(enc->p, data, len);
    66				enc->p += len;
    67				enc->space -= len;
    68				enc->len += len;
    69	
    70				if (part >= len)
    71					return;
    72				data += part;
    73				len -= part;
    74			}
    75	
    76			if (enc->p)
    77				kunmap_local(enc->p);
    78	
    79			if (unlikely(enc->nomem))
    80				return;
    81			if (ceph_bvecq_reserve(enc, len) < 0) {
    82				enc->p = NULL;
    83				enc->nomem = true;
    84				return;
    85			}
    86	
    87			enc->slot++;
    88			bq = enc->bq;
    89			if (enc->slot >= bq->nr_slots) {
    90				bq = bq->next;
    91				enc->bq = bq;
    92				enc->slot = 0;
    93			}
    94			enc->space = bq->bv[enc->slot].bv_len;
    95			enc->p = kmap_local_bvecq(enc->bq, 0);
    96		}
    97	}
    98	EXPORT_SYMBOL(ceph_bvecq_append);
    99	

-- 
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:[~2026-05-03 15:55 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-03 15:55 [dhowells-fs:ceph-iter 70/103] net/ceph/databuf.c:63:23: warning: variable 'part' is uninitialized when used within its own initialization kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox