From: "Jan Beulich" Subject: Re: [PATCH 3/4] xen/events: initialize local per-cpu mask for all possible events Date: Thu, 15 Aug 2013 14:06:24 +0100 Message-ID: <520CEE7102000078000EC336@nat28.tlf.novell.com> References: <1376569267-11653-1-git-send-email-david.vrabel@citrix.com> <1376569267-11653-4-git-send-email-david.vrabel@citrix.com> <520CE95502000078000EC2FA@nat28.tlf.novell.com> <520CCE71.2050808@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <520CCE71.2050808@citrix.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: David Vrabel Cc: Boris Ostrovsky , xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org >>> On 15.08.13 at 14:49, David Vrabel wrote: > On 15/08/13 13:44, Jan Beulich wrote: >>>>> On 15.08.13 at 14:21, David Vrabel wrote: >>> --- a/drivers/xen/events.c >>> +++ b/drivers/xen/events.c >>> @@ -348,7 +348,7 @@ static void init_evtchn_cpu_bindings(void) >>> >>> for_each_possible_cpu(i) >>> memset(per_cpu(cpu_evtchn_mask, i), >>> - (i == 0) ? ~0 : 0, sizeof(*per_cpu(cpu_evtchn_mask, i))); >>> + (i == 0) ? ~0 : 0, NR_EVENT_CHANNELS/8); >> >> I think simply dropping the bogus * would have been the better fix. > > I disagree. Using NR_EVENT_CHANNELS/8 makes it clearer that this is > initializing all bits. My preference of using sizeof() wherever possible is mainly attributed to the fact that if someone changes the array size, (s)he'd have to go through and identify and change all the corresponding loop or whatever boundaries. Jan