diff mbox

[PATCHv2] linux-generic: schedule: simplify wait logic to avoid clang issues

Message ID 1467685905-10703-1-git-send-email-bill.fischofer@linaro.org
State Accepted
Commit c03685af2895b20a5e8a046ea910254a96ab15c4
Headers show

Commit Message

Bill Fischofer July 5, 2016, 2:31 a.m. UTC
Resolve Bug https://bugs.linaro.org/show_bug.cgi?id=2387 by ensuring that
t1 variable is seen as initialized in all paths in the SP Scheduler.
Previous logic failed due to an apparent issue with clang.

Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org>
---
 platform/linux-generic/odp_schedule_sp.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

Comments

Maxim Uvarov July 5, 2016, 12:08 p.m. UTC | #1
Merged,
Maxim.

On 07/05/16 09:31, Savolainen, Petri (Nokia - FI/Espoo) wrote:
> Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com>
>
>
>> -----Original Message-----
>> From: lng-odp [mailto:lng-odp-bounces@lists.linaro.org] On Behalf Of Bill
>> Fischofer
>> Sent: Tuesday, July 05, 2016 5:32 AM
>> To: lng-odp@lists.linaro.org
>> Subject: [lng-odp] [PATCHv2] linux-generic: schedule: simplify wait logic
>> to avoid clang issues
>>
>> Resolve Bug https://bugs.linaro.org/show_bug.cgi?id=2387 by ensuring that
>> t1 variable is seen as initialized in all paths in the SP Scheduler.
>> Previous logic failed due to an apparent issue with clang.
>>
>> Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org>
>> ---
>>   platform/linux-generic/odp_schedule_sp.c | 5 ++---
>>   1 file changed, 2 insertions(+), 3 deletions(-)
>>
>> diff --git a/platform/linux-generic/odp_schedule_sp.c b/platform/linux-
>> generic/odp_schedule_sp.c
>> index 8c45123..2e28aa4 100644
>> --- a/platform/linux-generic/odp_schedule_sp.c
>> +++ b/platform/linux-generic/odp_schedule_sp.c
>> @@ -364,9 +364,9 @@ static uint64_t schedule_wait_time(uint64_t ns)
>>   }
>>
>>   static int schedule_multi(odp_queue_t *from, uint64_t wait,
>> -			  odp_event_t events[], int max_events)
>> +			  odp_event_t events[], int max_events ODP_UNUSED)
>>   {
>> -	(void)max_events;
>> +	odp_time_t t1;
>>   	int update_t1 = 1;
>>
>>   	if (sched_local.cmd) {
>> @@ -384,7 +384,6 @@ static int schedule_multi(odp_queue_t *from, uint64_t
>> wait,
>>   		sched_cmd_t *cmd;
>>   		uint32_t qi;
>>   		int num;
>> -		odp_time_t t1;
>>
>>   		cmd = sched_cmd(NUM_PRIO);
>>
>> --
>> 2.7.4
>>
>> _______________________________________________
>> lng-odp mailing list
>> lng-odp@lists.linaro.org
>> https://lists.linaro.org/mailman/listinfo/lng-odp
> _______________________________________________
> lng-odp mailing list
> lng-odp@lists.linaro.org
> https://lists.linaro.org/mailman/listinfo/lng-odp
diff mbox

Patch

diff --git a/platform/linux-generic/odp_schedule_sp.c b/platform/linux-generic/odp_schedule_sp.c
index 8c45123..2e28aa4 100644
--- a/platform/linux-generic/odp_schedule_sp.c
+++ b/platform/linux-generic/odp_schedule_sp.c
@@ -364,9 +364,9 @@  static uint64_t schedule_wait_time(uint64_t ns)
 }
 
 static int schedule_multi(odp_queue_t *from, uint64_t wait,
-			  odp_event_t events[], int max_events)
+			  odp_event_t events[], int max_events ODP_UNUSED)
 {
-	(void)max_events;
+	odp_time_t t1;
 	int update_t1 = 1;
 
 	if (sched_local.cmd) {
@@ -384,7 +384,6 @@  static int schedule_multi(odp_queue_t *from, uint64_t wait,
 		sched_cmd_t *cmd;
 		uint32_t qi;
 		int num;
-		odp_time_t t1;
 
 		cmd = sched_cmd(NUM_PRIO);