[android-common:android16-6.12 5/5] kernel/sched/fair.c:715 avg_vruntime() warn: inconsistent indenting

kernel test robot <[email protected]> Tue, 28 Jul 2026 21:18:45 +0800
Newsgroups dev.linux.lists.oe-kbuild-all
Message-ID <[email protected]>
tree:   https://android.googlesource.com/kernel/common android16-6.12
head:   579215f16d4e5c3062e423a583897e83473e1435
commit: 1eb5dc8d1c44e2bf7b36a101c62dad962d673a8b [5/5] UPSTREAM: sched/fair: Fix zero_vruntime tracking
config: x86_64-randconfig-161-20260728 (https://download.01.org/0day-ci/archive/20260728/[email protected]/config)
compiler: clang version 22.1.3 (https://github.com/llvm/llvm-project e9846648fd6183ee6d8cbdb4502213fcf902a211)
smatch: v0.5.0-9187-g5189e3fb

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 <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

smatch warnings:
kernel/sched/fair.c:715 avg_vruntime() warn: inconsistent indenting
kernel/sched/fair.c:697 update_zero_vruntime() warn: inconsistent indenting

vim +715 kernel/sched/fair.c

   689	
   690	static inline
   691	void update_zero_vruntime(struct cfs_rq *cfs_rq, s64 delta)
   692	{
   693		/*
   694		 * v' = v + d ==> avg_vruntime' = avg_vruntime - d*avg_load
   695		 */
   696		cfs_rq->avg_vruntime -= cfs_rq->avg_load * delta;
 > 697	       cfs_rq->zero_vruntime += delta;
   698	}
   699	
   700	/*
   701	 * Specifically: avg_vruntime() + 0 must result in entity_eligible() := true
   702	 * For this to be so, the result of this function must have a left bias.
   703	 *
   704	 * Called in:
   705	 *  - place_entity()      -- before enqueue
   706	 *  - update_entity_lag() -- before dequeue
   707	 *  - entity_tick()
   708	 *
   709	 * This means it is one entry 'behind' but that puts it close enough to where
   710	 * the bound on entity_key() is at most two lag bounds.
   711	 */
   712	u64 avg_vruntime(struct cfs_rq *cfs_rq)
   713	{
   714		struct sched_entity *curr = cfs_rq->curr;
 > 715	       long weight = cfs_rq->avg_load;
   716	       s64 delta = 0;
   717	
   718	       if (curr && !curr->on_rq)
   719	               curr = NULL;
   720	
   721	       if (weight) {
   722	               s64 runtime = cfs_rq->avg_vruntime;
   723	
   724	               if (curr) {
   725	                       unsigned long w = scale_load_down(curr->load.weight);
   726	
   727	                       runtime += entity_key(cfs_rq, curr) * w;
   728	                       weight += w;
   729	               }
   730	
   731			/* sign flips effective floor / ceiling */
   732	               if (runtime < 0)
   733	                       runtime -= (weight - 1);
   734	
   735	               delta = div_s64(runtime, weight);
   736	       } else if (curr) {
   737	               /*
   738	                * When there is but one element, it is the average.
   739	                */
   740	               delta = curr->vruntime - cfs_rq->zero_vruntime;
   741		}
   742	
   743	       update_zero_vruntime(cfs_rq, delta);
   744	
   745	       return cfs_rq->zero_vruntime;
   746	}
   747	

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki