[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 3/5] sched/arinc653: Clean up function definitions


  • To: Dario Faggioli <dfaggioli@xxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>
  • From: Jeff Kubascik <jeff.kubascik@xxxxxxxxxxxxxxx>
  • Date: Fri, 18 Sep 2020 13:43:54 -0400
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=dornerworks.com; dmarc=pass action=none header.from=dornerworks.com; dkim=pass header.d=dornerworks.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector5401; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=cQao74t9P05bbxpuvyallW7CgU4wDHuh9HVw7dwlh5o=; b=fF8LlISWzLMzapwYUqXedJItON3Ist2vL9oAUn/uxAtB31ZBM6FkKugV789ocu1kGGX5dVd/Ir+NCol3cnM72HjVZeEuD+3ajcNAqOFHoW9XjiXIIa1nqC8X0dmMgvQycqbS7KIgJV524B3Zbi1Uj0iWikPvobpg6a/hxGtn5g0JamjcawQszN8DFHPksSdd9SUpGqBkTijjhToMkCAf5TXgHkUgR0AXMmpDHAU2+LlMjVU2b9xMX6r8OH75ox0u7C6V1YDWyraL4iTyu0SPrIY7QX44o2/RGzVFydJql6DeSwMsALAnRUhVG6jKAosqvduBhpMLike1dHsck3oodg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector5401; d=microsoft.com; cv=none; b=TUun4kkrf3/StDd5DcXF2tKEVzaSxNRN/shAK42R3iH+zGXtf9L2+mwjyV17jXz0FM5y/Xcru57VsQMIELmeUQVnlJ2AbsSCOB79dMtjm7xGGvaUQVAdtFaetdg8e2m4IPqWMv/VoRI34X4Y5II7eAd2iSMg3eO31Trw4ORMXe8b/67e1Zo3dFakIrYPFi8+TlUWk2uR7keCzhE6XC0cvCgfpEqpLFGzeILRO9OOjmBrkAJUbb8yfWd00do+eArwoJwUh6DSY9IkEMZoyfqzOnAiATgj8A3EHJzrcGkxCD8ZvW2duYhML7AwcvKMX10qrXpqzHQmIOpxUkWHWAxMGw==
  • Authentication-results: citrix.com; dkim=none (message not signed) header.d=none; citrix.com; dmarc=none action=none header.from=dornerworks.com;
  • Cc: xen-devel@xxxxxxxxxxxxxxxxxxxx, xen-devel@xxxxxxxxxxxxxxx, Josh Whitehead <josh.whitehead@xxxxxxxxxxxxxxx>, Stewart Hildebrand <stewart.hildebrand@xxxxxxxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>
  • Delivery-date: Fri, 18 Sep 2020 17:44:10 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 9/17/2020 10:40 AM, Dario Faggioli wrote:
>On Thu, 2020-09-17 at 10:09 +0200, Jan Beulich wrote:
>> On 16.09.2020 20:18, Jeff Kubascik wrote:
>>> --- a/xen/common/sched/arinc653.c
>>> +++ b/xen/common/sched/arinc653.c
>>> @@ -119,10 +119,9 @@ static int dom_handle_cmp(const
>>> xen_domain_handle_t h1,
>>>      return memcmp(h1, h2, sizeof(xen_domain_handle_t));
>>>  }
>>>
>>> -static struct sched_unit *find_unit(
>>> -    const struct scheduler *ops,
>>> -    xen_domain_handle_t handle,
>>> -    int unit_id)
>>> +static struct sched_unit *find_unit(const struct scheduler *ops,
>>> +                                    xen_domain_handle_t handle,
>>> +                                    int unit_id)
>>>  {
>>
>> Just fyi, afaict we consider both variants legitimate style as far
>> as Xen as a whole is concerned; I'm unaware of scheduler code
>> specific restrictions (but I'll be happy to be corrected if I'm
>> wrong with this).
>>
>No, you're right, there aren't any additional restrictions. And, as
>many other subsystems, scheduling code is not always 100% consistent.
>There's quite a mix of style. E.g., there are both examples of the
>style that this hunk above is changing and of the one that the patch is
>changing it to.
>
>So I also see limited need for doing it. But of course it's Josh's and
>Stweart's call, I guess.

If that's the case, then I'm thinking keeping the previous style would be
preferred. I'll switch it back.

>> Instead what I'm wondering by merely seeing this piece of code is
>> whether unit_id really can go negative. If not (as would be the
>> common case with IDs), it would want converting to unsigned int,
>> which may be more important than the purely typographical
>> adjustment done here.
>>
>Yep, it's defined as `unsigned int` in `struct sched_unit`.
>
>So this indeed would be valuable. And while you're there, this probably
>applies here as well:
>
>/**
> * The sched_entry_t structure holds a single entry of the
> * ARINC 653 schedule.
> */
>typedef struct sched_entry_s
>{
>    /* dom_handle holds the handle ("UUID") for the domain that this
>     * schedule entry refers to. */
>    xen_domain_handle_t dom_handle;
>    /* unit_id holds the UNIT number for the UNIT that this schedule
>     * entry refers to. */
>    int                 unit_id;
>    ...
>}

Agreed. I'll make this change.

-Jeff



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.