diff mbox

api: odp_schedule.h: use int to match return type

Message ID 1423153200-24217-1-git-send-email-ola.liljedahl@linaro.org
State Accepted
Commit 273daa37ec338016319c40edd2823cd3f0ad1de1
Headers show

Commit Message

Ola Liljedahl Feb. 5, 2015, 4:20 p.m. UTC
Use (signed) int for parameter that should match return type of function.

Signed-off-by: Ola Liljedahl <ola.liljedahl@linaro.org>
---
(This document/code contribution attached is provided under the terms of
agreement LES-LTM-21309)

 include/odp/api/schedule.h            | 2 +-
 platform/linux-generic/odp_schedule.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

Comments

Bill Fischofer Feb. 5, 2015, 4:25 p.m. UTC | #1
On Thu, Feb 5, 2015 at 10:20 AM, Ola Liljedahl <ola.liljedahl@linaro.org>
wrote:

> Use (signed) int for parameter that should match return type of function.
>
> Signed-off-by: Ola Liljedahl <ola.liljedahl@linaro.org>
>

Reviewed-by: Bill Fischofer <bill.fischofer@linaro.org>


> ---
> (This document/code contribution attached is provided under the terms of
> agreement LES-LTM-21309)
>
>  include/odp/api/schedule.h            | 2 +-
>  platform/linux-generic/odp_schedule.c | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/include/odp/api/schedule.h b/include/odp/api/schedule.h
> index 3019b84..226dc9b 100644
> --- a/include/odp/api/schedule.h
> +++ b/include/odp/api/schedule.h
> @@ -87,7 +87,7 @@ odp_event_t odp_schedule(odp_queue_t *from, uint64_t
> wait);
>   * @return Number of events outputed (0 ... num)
>   */
>  int odp_schedule_multi(odp_queue_t *from, uint64_t wait, odp_event_t
> events[],
> -                      unsigned int num);
> +                      int num);
>
>  /**
>   * Pause scheduling
> diff --git a/platform/linux-generic/odp_schedule.c
> b/platform/linux-generic/odp_schedule.c
> index 999c800..3427082 100644
> --- a/platform/linux-generic/odp_schedule.c
> +++ b/platform/linux-generic/odp_schedule.c
> @@ -386,7 +386,7 @@ odp_event_t odp_schedule(odp_queue_t *out_queue,
> uint64_t wait)
>
>
>  int odp_schedule_multi(odp_queue_t *out_queue, uint64_t wait,
> -                      odp_event_t events[], unsigned int num)
> +                      odp_event_t events[], int num)
>  {
>         return schedule_loop(out_queue, wait, events, num, MAX_DEQ);
>  }
> --
> 1.9.1
>
>
> _______________________________________________
> lng-odp mailing list
> lng-odp@lists.linaro.org
> http://lists.linaro.org/mailman/listinfo/lng-odp
>
Maxim Uvarov Feb. 8, 2015, 9:16 p.m. UTC | #2
Is that ok that schedule_loop() still needs unsigned int? You changed 
int only in odp_schedule_multi() but all
other functions are untouched:

int odp_schedule_multi(int num) ->  int schedule_loop(unsigned int 
max_num) ->
int schedule(unsigned int max_num) -> int copy_events(unsigned int max)

Maxim.

On 02/06/2015 10:58 AM, Savolainen, Petri (NSN - FI/Espoo) wrote:
> Reviewed-by: Petri Savolainen <petri.savolainen@linaro.org>
>
>> -----Original Message-----
>> From: lng-odp-bounces@lists.linaro.org [mailto:lng-odp-
>> bounces@lists.linaro.org] On Behalf Of ext Ola Liljedahl
>> Sent: Thursday, February 05, 2015 6:20 PM
>> To: lng-odp@lists.linaro.org
>> Subject: [lng-odp] [PATCH] api: odp_schedule.h: use int to match return
>> type
>>
>> Use (signed) int for parameter that should match return type of function.
>>
>> Signed-off-by: Ola Liljedahl <ola.liljedahl@linaro.org>
>> ---
>> (This document/code contribution attached is provided under the terms of
>> agreement LES-LTM-21309)
>>
>>   include/odp/api/schedule.h            | 2 +-
>>   platform/linux-generic/odp_schedule.c | 2 +-
>>   2 files changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/include/odp/api/schedule.h b/include/odp/api/schedule.h
>> index 3019b84..226dc9b 100644
>> --- a/include/odp/api/schedule.h
>> +++ b/include/odp/api/schedule.h
>> @@ -87,7 +87,7 @@ odp_event_t odp_schedule(odp_queue_t *from, uint64_t
>> wait);
>>    * @return Number of events outputed (0 ... num)
>>    */
>>   int odp_schedule_multi(odp_queue_t *from, uint64_t wait, odp_event_t
>> events[],
>> -		       unsigned int num);
>> +		       int num);
>>
>>   /**
>>    * Pause scheduling
>> diff --git a/platform/linux-generic/odp_schedule.c b/platform/linux-
>> generic/odp_schedule.c
>> index 999c800..3427082 100644
>> --- a/platform/linux-generic/odp_schedule.c
>> +++ b/platform/linux-generic/odp_schedule.c
>> @@ -386,7 +386,7 @@ odp_event_t odp_schedule(odp_queue_t *out_queue,
>> uint64_t wait)
>>
>>
>>   int odp_schedule_multi(odp_queue_t *out_queue, uint64_t wait,
>> -		       odp_event_t events[], unsigned int num)
>> +		       odp_event_t events[], int num)
>>   {
>>   	return schedule_loop(out_queue, wait, events, num, MAX_DEQ);
>>   }
>> --
>> 1.9.1
>>
>>
>> _______________________________________________
>> lng-odp mailing list
>> lng-odp@lists.linaro.org
>> http://lists.linaro.org/mailman/listinfo/lng-odp
> _______________________________________________
> lng-odp mailing list
> lng-odp@lists.linaro.org
> http://lists.linaro.org/mailman/listinfo/lng-odp
Ola Liljedahl Feb. 9, 2015, 4:51 a.m. UTC | #3
On 8 February 2015 at 22:16, Maxim Uvarov <maxim.uvarov@linaro.org> wrote:
> Is that ok that schedule_loop() still needs unsigned int? You changed int
> only in odp_schedule_multi() but all
> other functions are untouched:
Yes I think this is OK. There are not complaints (in this file!) of
comparing signed and unsigned.

From a functional point of view, it was also OK for
odp_schedule_multi() to use "unsigned int" for the parameter, we just
changed to signed int to harmonize with the return type ("int").

-- Ola

>
> int odp_schedule_multi(int num) ->  int schedule_loop(unsigned int max_num)
> ->
> int schedule(unsigned int max_num) -> int copy_events(unsigned int max)
>
> Maxim.
>
> On 02/06/2015 10:58 AM, Savolainen, Petri (NSN - FI/Espoo) wrote:
>>
>> Reviewed-by: Petri Savolainen <petri.savolainen@linaro.org>
>>
>>> -----Original Message-----
>>> From: lng-odp-bounces@lists.linaro.org [mailto:lng-odp-
>>> bounces@lists.linaro.org] On Behalf Of ext Ola Liljedahl
>>> Sent: Thursday, February 05, 2015 6:20 PM
>>> To: lng-odp@lists.linaro.org
>>> Subject: [lng-odp] [PATCH] api: odp_schedule.h: use int to match return
>>> type
>>>
>>> Use (signed) int for parameter that should match return type of function.
>>>
>>> Signed-off-by: Ola Liljedahl <ola.liljedahl@linaro.org>
>>> ---
>>> (This document/code contribution attached is provided under the terms of
>>> agreement LES-LTM-21309)
>>>
>>>   include/odp/api/schedule.h            | 2 +-
>>>   platform/linux-generic/odp_schedule.c | 2 +-
>>>   2 files changed, 2 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/include/odp/api/schedule.h b/include/odp/api/schedule.h
>>> index 3019b84..226dc9b 100644
>>> --- a/include/odp/api/schedule.h
>>> +++ b/include/odp/api/schedule.h
>>> @@ -87,7 +87,7 @@ odp_event_t odp_schedule(odp_queue_t *from, uint64_t
>>> wait);
>>>    * @return Number of events outputed (0 ... num)
>>>    */
>>>   int odp_schedule_multi(odp_queue_t *from, uint64_t wait, odp_event_t
>>> events[],
>>> -                      unsigned int num);
>>> +                      int num);
>>>
>>>   /**
>>>    * Pause scheduling
>>> diff --git a/platform/linux-generic/odp_schedule.c b/platform/linux-
>>> generic/odp_schedule.c
>>> index 999c800..3427082 100644
>>> --- a/platform/linux-generic/odp_schedule.c
>>> +++ b/platform/linux-generic/odp_schedule.c
>>> @@ -386,7 +386,7 @@ odp_event_t odp_schedule(odp_queue_t *out_queue,
>>> uint64_t wait)
>>>
>>>
>>>   int odp_schedule_multi(odp_queue_t *out_queue, uint64_t wait,
>>> -                      odp_event_t events[], unsigned int num)
>>> +                      odp_event_t events[], int num)
>>>   {
>>>         return schedule_loop(out_queue, wait, events, num, MAX_DEQ);
>>>   }
>>> --
>>> 1.9.1
>>>
>>>
>>> _______________________________________________
>>> lng-odp mailing list
>>> lng-odp@lists.linaro.org
>>> http://lists.linaro.org/mailman/listinfo/lng-odp
>>
>> _______________________________________________
>> lng-odp mailing list
>> lng-odp@lists.linaro.org
>> http://lists.linaro.org/mailman/listinfo/lng-odp
>
>
>
> _______________________________________________
> lng-odp mailing list
> lng-odp@lists.linaro.org
> http://lists.linaro.org/mailman/listinfo/lng-odp
Maxim Uvarov Feb. 9, 2015, 5:02 a.m. UTC | #4
Ok, merged.

Maxim.

On 02/09/2015 07:51 AM, Ola Liljedahl wrote:
> On 8 February 2015 at 22:16, Maxim Uvarov <maxim.uvarov@linaro.org> wrote:
>> Is that ok that schedule_loop() still needs unsigned int? You changed int
>> only in odp_schedule_multi() but all
>> other functions are untouched:
> Yes I think this is OK. There are not complaints (in this file!) of
> comparing signed and unsigned.
>
>  From a functional point of view, it was also OK for
> odp_schedule_multi() to use "unsigned int" for the parameter, we just
> changed to signed int to harmonize with the return type ("int").
>
> -- Ola
>
>> int odp_schedule_multi(int num) ->  int schedule_loop(unsigned int max_num)
>> ->
>> int schedule(unsigned int max_num) -> int copy_events(unsigned int max)
>>
>> Maxim.
>>
>> On 02/06/2015 10:58 AM, Savolainen, Petri (NSN - FI/Espoo) wrote:
>>> Reviewed-by: Petri Savolainen <petri.savolainen@linaro.org>
>>>
>>>> -----Original Message-----
>>>> From: lng-odp-bounces@lists.linaro.org [mailto:lng-odp-
>>>> bounces@lists.linaro.org] On Behalf Of ext Ola Liljedahl
>>>> Sent: Thursday, February 05, 2015 6:20 PM
>>>> To: lng-odp@lists.linaro.org
>>>> Subject: [lng-odp] [PATCH] api: odp_schedule.h: use int to match return
>>>> type
>>>>
>>>> Use (signed) int for parameter that should match return type of function.
>>>>
>>>> Signed-off-by: Ola Liljedahl <ola.liljedahl@linaro.org>
>>>> ---
>>>> (This document/code contribution attached is provided under the terms of
>>>> agreement LES-LTM-21309)
>>>>
>>>>    include/odp/api/schedule.h            | 2 +-
>>>>    platform/linux-generic/odp_schedule.c | 2 +-
>>>>    2 files changed, 2 insertions(+), 2 deletions(-)
>>>>
>>>> diff --git a/include/odp/api/schedule.h b/include/odp/api/schedule.h
>>>> index 3019b84..226dc9b 100644
>>>> --- a/include/odp/api/schedule.h
>>>> +++ b/include/odp/api/schedule.h
>>>> @@ -87,7 +87,7 @@ odp_event_t odp_schedule(odp_queue_t *from, uint64_t
>>>> wait);
>>>>     * @return Number of events outputed (0 ... num)
>>>>     */
>>>>    int odp_schedule_multi(odp_queue_t *from, uint64_t wait, odp_event_t
>>>> events[],
>>>> -                      unsigned int num);
>>>> +                      int num);
>>>>
>>>>    /**
>>>>     * Pause scheduling
>>>> diff --git a/platform/linux-generic/odp_schedule.c b/platform/linux-
>>>> generic/odp_schedule.c
>>>> index 999c800..3427082 100644
>>>> --- a/platform/linux-generic/odp_schedule.c
>>>> +++ b/platform/linux-generic/odp_schedule.c
>>>> @@ -386,7 +386,7 @@ odp_event_t odp_schedule(odp_queue_t *out_queue,
>>>> uint64_t wait)
>>>>
>>>>
>>>>    int odp_schedule_multi(odp_queue_t *out_queue, uint64_t wait,
>>>> -                      odp_event_t events[], unsigned int num)
>>>> +                      odp_event_t events[], int num)
>>>>    {
>>>>          return schedule_loop(out_queue, wait, events, num, MAX_DEQ);
>>>>    }
>>>> --
>>>> 1.9.1
>>>>
>>>>
>>>> _______________________________________________
>>>> lng-odp mailing list
>>>> lng-odp@lists.linaro.org
>>>> http://lists.linaro.org/mailman/listinfo/lng-odp
>>> _______________________________________________
>>> lng-odp mailing list
>>> lng-odp@lists.linaro.org
>>> http://lists.linaro.org/mailman/listinfo/lng-odp
>>
>>
>> _______________________________________________
>> lng-odp mailing list
>> lng-odp@lists.linaro.org
>> http://lists.linaro.org/mailman/listinfo/lng-odp
diff mbox

Patch

diff --git a/include/odp/api/schedule.h b/include/odp/api/schedule.h
index 3019b84..226dc9b 100644
--- a/include/odp/api/schedule.h
+++ b/include/odp/api/schedule.h
@@ -87,7 +87,7 @@  odp_event_t odp_schedule(odp_queue_t *from, uint64_t wait);
  * @return Number of events outputed (0 ... num)
  */
 int odp_schedule_multi(odp_queue_t *from, uint64_t wait, odp_event_t events[],
-		       unsigned int num);
+		       int num);
 
 /**
  * Pause scheduling
diff --git a/platform/linux-generic/odp_schedule.c b/platform/linux-generic/odp_schedule.c
index 999c800..3427082 100644
--- a/platform/linux-generic/odp_schedule.c
+++ b/platform/linux-generic/odp_schedule.c
@@ -386,7 +386,7 @@  odp_event_t odp_schedule(odp_queue_t *out_queue, uint64_t wait)
 
 
 int odp_schedule_multi(odp_queue_t *out_queue, uint64_t wait,
-		       odp_event_t events[], unsigned int num)
+		       odp_event_t events[], int num)
 {
 	return schedule_loop(out_queue, wait, events, num, MAX_DEQ);
 }