Author: cem
Date: Mon Mar 16 22:25:25 2020
New Revision: 359022
URL: https://svnweb.freebsd.org/changeset/base/359022

Log:
  Remove misleading / redundant bzero in callout_callwheel_init
  
  The intent seems to be zeroing all of the cc_cpu array, or its singleton on
  such platforms.  The assumption made is that the BSP is always zero.  The
  code smell was introduced in r326218, which changed the prior explicit zero
  to 'curcpu'.  The change is only valid if curcpu continues to be zero,
  contrary to the aim expressed in that commit message.
  
  So, more succinctly, the expression could be: memset(cc_cpu,0,sizeof(cc_cpu)).
  
  However, there's no point.  cc_cpu lives in the data section and has a zero
  initial value already.  So this revision just removes the problematic
  statement.
  
  No functional change.  Appeases a (false positive, ish) Coverity CID.
  
  CID:          1383567
  Reported by:  Puneeth Jothaiah <puneethkumar.jothaia AT dell.com>
  Reviewed by:  kib
  Sponsored by: Dell EMC Isilon
  Differential Revision:        https://reviews.freebsd.org/D24089

Modified:
  head/sys/kern/kern_timeout.c

Modified: head/sys/kern/kern_timeout.c
==============================================================================
--- head/sys/kern/kern_timeout.c        Mon Mar 16 21:12:46 2020        
(r359021)
+++ head/sys/kern/kern_timeout.c        Mon Mar 16 22:25:25 2020        
(r359022)
@@ -285,7 +285,6 @@ callout_callwheel_init(void *dummy)
         * XXX: Clip callout to result of previous function of maxusers
         * maximum 384.  This is still huge, but acceptable.
         */
-       memset(CC_CPU(curcpu), 0, sizeof(cc_cpu));
        ncallout = imin(16 + maxproc + maxfiles, 18508);
        TUNABLE_INT_FETCH("kern.ncallout", &ncallout);
 
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to