xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: David Vrabel <david.vrabel@citrix.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>, xen-devel@lists.xen.org
Subject: Re: [PATCH 3/4] xen/events: initialize local per-cpu mask for all possible events
Date: Mon, 19 Aug 2013 18:10:38 +0100	[thread overview]
Message-ID: <5212518E.5040001@citrix.com> (raw)
In-Reply-To: <520CEE7102000078000EC336@nat28.tlf.novell.com>

On 15/08/13 14:06, Jan Beulich wrote:
>>>> On 15.08.13 at 14:49, David Vrabel <david.vrabel@citrix.com> wrote:
>> On 15/08/13 13:44, Jan Beulich wrote:
>>>>>> On 15.08.13 at 14:21, David Vrabel <david.vrabel@citrix.com> 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.

Normally I would agree, but in this case a) but this array won't change
its size and b) someone was already confused by the original code and
copied it across incorrectly.

David

  reply	other threads:[~2013-08-19 17:10 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-15 12:21 [PATCHv2 0/4] Linux: fix some (more) event handling bugs David Vrabel
2013-08-15 12:21 ` [PATCH 1/4] x86/xen: disable premption when enabling local irqs David Vrabel
2013-08-15 12:21 ` [PATCH 2/4] xen/events: document behaviour when scanning the start word for events David Vrabel
2013-08-15 14:10   ` Boris Ostrovsky
2013-08-15 12:21 ` [PATCH 3/4] xen/events: initialize local per-cpu mask for all possible events David Vrabel
2013-08-15 12:44   ` Jan Beulich
2013-08-15 12:49     ` David Vrabel
2013-08-15 13:06       ` Jan Beulich
2013-08-19 17:10         ` David Vrabel [this message]
2013-08-15 12:21 ` [PATCH 4/4] xen/events: mask events when changing their VCPU binding David Vrabel
2013-08-15 12:48   ` Jan Beulich

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5212518E.5040001@citrix.com \
    --to=david.vrabel@citrix.com \
    --cc=JBeulich@suse.com \
    --cc=boris.ostrovsky@oracle.com \
    --cc=xen-devel@lists.xen.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).