Re: GSoC - Code Formatting and Style Checking for RTEMS score

2021-07-03 Thread Ida Delphine
Hello mentors,

I got some feedback and I have improved my code based on it -
https://github.com/Idadelveloper/rtems/blob/master/hooks/pre-commit
Will love to get some more feedback and ways to make it look better.
And is it okay I start working on its documentation though it hasn't been
approved yet?

Cheers,
Ida

On Thu, Jul 1, 2021 at 6:42 PM Ida Delphine  wrote:

> Thank you. I will make changes accordingly.
>
> On Thu, 1 Jul 2021, 5:31 pm Gedare Bloom,  wrote:
>
>> Hi Ida,
>>
>> On Tue, Jun 29, 2021 at 1:11 PM Ida Delphine  wrote:
>> >
>> > Hello mentors,
>> >
>> > Here is the code for my pre-commit hook script. How it works is by
>> default, upon commiting it outputs a warning stating the number of style
>> issues in case there are mismatches.
>> > The user can trigger the strict mode which gives a more detailed output
>> of the style issues by running adding the mode to the config file ( git
>> config mode "strict") - will document this.
>> >
>> > https://github.com/Idadelveloper/rtems/blob/master/hooks/pre-commit
>> >
>> I made comments on your commit that added this:
>>
>> https://github.com/Idadelveloper/rtems/commit/6bfc4802d17b3aab260190d53467b750848f0002
>>
>> > I had already sent some screenshots here on how the outcome looks like.
>> Will love to improve my code based on your feedback and get more
>> suggestions.
>> >
>> >
>> > On Mon, Jun 21, 2021 at 7:05 PM Gedare Bloom  wrote:
>> >>
>> >>
>> >>
>> >> On Sun, Jun 20, 2021 at 1:13 AM Ida Delphine 
>> wrote:
>> >>>
>> >>> Hello everyone,
>> >>> I updated the hooks script. About the modes, we have the default,
>> "strict" and "nonstrict" (couldn't think of better names). With the default
>> mode, it prints a warning specifying the number of style issues if any and
>> aborts the commit. With the strict mode, it goes into more detail showing
>> both the formatted and unformatted patch, the number of style issues, and
>> aborts the commit. In the non-strict mode, it simply displays the warning
>> with the style issues and the commit happens.
>> >>>
>> >>> The default mode basically happens when you run
>> 
>>  git commit -m "Commit message"
>> >>>
>> >>> The best method I could find to pass arguments to a script was via
>> environment variables. So the nonstrict mode applies when you run
>> 
>>  STYLEMODE=nonstrict git commit -m "Commit message"
>> >>>
>> >>> The strict mode applies when you run
>> 
>>  STYLEMODE=strict git commit -m "Commit message"
>> >>>
>> >>>
>> >> What are the possible options to pass arguments? (Maybe, a blog post
>> :)) Reading from a git-config file would be better than environment
>> variables.
>> >>
>> >> It might be better to share screenshots by a link (e.g., a blog post
>> :)) to avoid hitting the mailing list attachment limits.
>> >>
>> >> Gedare
>>
>
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Re: [rtems commit] Update Strong APA Scheduler

2021-07-03 Thread Richi Dubey
Ok, thanks.

I have sent a patch, can you please check?

On Thu, Jul 1, 2021 at 2:06 PM Sebastian Huber <
sebastian.hu...@embedded-brains.de> wrote:

> On 01/07/2021 09:47, Richi Dubey wrote:
> > Hi,
> >
> > How do I reproduce this? I tried using the config produced by
> > 
> > $ ./waf bsp_defaults --rtems-bsps=arm/realview_pbx_a9_qemu
>
> This BSP uses -O0 by default. Use
>
> OPTIMIZATION_FLAGS = -O2 -g
>
> to get the warnings.
>
> --
> embedded brains GmbH
> Herr Sebastian HUBER
> Dornierstr. 4
> 82178 Puchheim
> Germany
> email: sebastian.hu...@embedded-brains.de
> phone: +49-89-18 94 741 - 16
> fax:   +49-89-18 94 741 - 08
>
> Registergericht: Amtsgericht München
> Registernummer: HRB 157899
> Vertretungsberechtigte Geschäftsführer: Peter Rasmussen, Thomas Dörfler
> Unsere Datenschutzerklärung finden Sie hier:
> https://embedded-brains.de/datenschutzerklaerung/
>
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

[PATCH] Fix compiler warnings for schedulerstrongapa.c

2021-07-03 Thread Richi Dubey
---
 cpukit/score/src/schedulerstrongapa.c | 21 -
 1 file changed, 16 insertions(+), 5 deletions(-)

diff --git a/cpukit/score/src/schedulerstrongapa.c 
b/cpukit/score/src/schedulerstrongapa.c
index 845d19d1a8..b34ffe4b6d 100644
--- a/cpukit/score/src/schedulerstrongapa.c
+++ b/cpukit/score/src/schedulerstrongapa.c
@@ -187,7 +187,7 @@ static inline Scheduler_Node * 
_Scheduler_strong_APA_Find_highest_ready(
   uint32_t  rear
 )
 {
-  Scheduler_Node  *highest_ready;
+  Scheduler_Node  *highest_ready = NULL;
   Scheduler_strong_APA_CPU*CPU;
   const Chain_Node*tail;
   Chain_Node  *next;
@@ -259,6 +259,10 @@ static inline Scheduler_Node * 
_Scheduler_strong_APA_Find_highest_ready(
 }
   }
 
+  /*
+   * By definition, the system would always have a ready node,
+   * hence highest_ready would not be NULL.
+   */
   return highest_ready;
 }
 
@@ -494,7 +498,7 @@ static inline Scheduler_Node* 
_Scheduler_strong_APA_Get_lowest_reachable(
   Per_CPU_Control **cpu_to_preempt
 )
 {
-  Scheduler_Node  *lowest_reachable;
+  Scheduler_Node  *lowest_reachable = NULL;
   Priority_Control max_priority_num;
   uint32_tcpu_max;
   uint32_tcpu_index;
@@ -546,7 +550,10 @@ static inline Scheduler_Node* 
_Scheduler_strong_APA_Get_lowest_reachable(
   }
 }
   }
-
+  /*
+   * Since it is not allowed for a task to have an empty affinity set,
+   * there would always be a lowest_reachable task, hence it would not be NULL
+   */
   return lowest_reachable;
 }
 
@@ -673,7 +680,7 @@ static inline bool _Scheduler_strong_APA_Enqueue(
   Scheduler_strong_APA_CPU *CPU;
   uint32_t cpu_max;
   uint32_t cpu_index;
-  Per_CPU_Control  *cpu_to_preempt;
+  Per_CPU_Control  *cpu_to_preempt = NULL;
   Scheduler_Node   *lowest_reachable;
   Scheduler_strong_APA_Node*strong_node;
 
@@ -711,7 +718,11 @@ static inline bool _Scheduler_strong_APA_Enqueue(
rear,
_to_preempt
  );
-
+  /*
+   * Since it is not allowed for a task to have an empty affinity set,
+   * there would always be a lowest_reachable task, hence cpu_to_preempt
+   * would not be NULL.
+   */
   return _Scheduler_strong_APA_Do_enqueue(
context,
lowest_reachable,
-- 
2.17.1

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel