]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit - sys/kern/kern_timeout.c
Remove misleading / redundant bzero in callout_callwheel_init
authorcem <cem@FreeBSD.org>
Mon, 16 Mar 2020 22:25:25 +0000 (22:25 +0000)
committercem <cem@FreeBSD.org>
Mon, 16 Mar 2020 22:25:25 +0000 (22:25 +0000)
commitadb516ea053c427213d0d701eba259138c28a180
tree49fa7e568442f421ca38277397d6305b4f917ae7
parent4590151da985e172bf51eef10414e888cad5ce3f
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
sys/kern/kern_timeout.c