[PATCH] score: Use defines for Thread_Life_state

2021-01-28 Thread Sebastian Huber
Do not use an enum as a bit field. Document the state flags. This fix relates to a Coverity issue (PW.MIXED_ENUM_TYPE). --- cpukit/include/rtems/score/thread.h | 57 - 1 file changed, 47 insertions(+), 10 deletions(-) diff --git a/cpukit/include/rtems/score/thread.h

Re: [patch libBSD] dev/ofw: Use RTEMS OFW FDT implementation

2021-01-28 Thread Niteesh G. S.
Hello Christian, On Thu, Jan 28, 2021 at 1:15 PM Christian MAUDERER < christian.maude...@embedded-brains.de> wrote: > Am 28.01.21 um 06:28 schrieb Chris Johns: > > On 28/1/21 4:12 am, Niteesh G. S. wrote: > >> Hello Christian, > >> > >> On Wed, Jan 27, 2021 at 3:59 PM Christian MAUDERER > >> >>

Re: [PATCH] bsps/shared/ofw: Fix coverity reported defects

2021-01-28 Thread Niteesh G. S.
Hello, https://lists.rtems.org/pipermail/devel/2021-January/064115.html I have fixed defects reported in the above thread except CID 1472595, 1472597 (ARRAY_VS_SINGLETON) Along with the buffer we also take the size of the buffer this makes sure that we don't read more than the buffer capacity.

[PATCH] bsps/shared/ofw: Fix coverity reported defects

2021-01-28 Thread G S Niteesh Babu
Fixed use after free and null pointer dereference defects FIXES: 1) CID 1472601 (NULL_RETURNS) 2) CID 1472600 (USE_AFTER_FREE) 3) CID 1472599 (USE_AFTER_FREE) 4) CID 1472598 (USE_AFTER_FREE) 5) CID 1472596 (USE_AFTER_FREE) --- bsps/shared/ofw/ofw.c | 10 +- 1 file changed, 5

[PATCH] score: Define _Assert() for Coverity

2021-01-28 Thread Sebastian Huber
The goal is to reduce false positive NULL_RETURNS, PW.NORETURN_FUNCTION_DOES_RETURN, PW.SET_BUT_NOT_USED, UNUSED_VALUE, etc. issues. --- cpukit/include/rtems/score/assert.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cpukit/include/rtems/score/assert.h

[PATCH v2] Add model file for Coverity

2021-01-28 Thread Sebastian Huber
--- static-analysis/coverity/model.c | 53 1 file changed, 53 insertions(+) create mode 100644 static-analysis/coverity/model.c diff --git a/static-analysis/coverity/model.c b/static-analysis/coverity/model.c new file mode 100644 index 000..874b1b3 ---

Re: [PATCH] Add model file for Coverity

2021-01-28 Thread Sebastian Huber
On 28/01/2021 20:29, Joel Sherrill wrote: I'm still not getting emails when the runs are finished but it looks like it is done. Thanks for starting a new run with the updated file. It seems the #define stuff in the model file didn't work. For example, we still have CID 1399745. You can

Re: devel Digest, Vol 110, Issue 38

2021-01-28 Thread Niteesh G. S.
Hello, I have answered your questions below, but I myself have few questions. 1) This patch is based on the fact that libBSD OFW API is hardwired to the FDT implementation if in future this changes this patch will create problems. Can this happen? 2) We should also remove ofw_fdt.c which I have

Fwd: New Defects reported by Coverity Scan for RTEMS

2021-01-28 Thread Gedare Bloom
fyi; I should see if I can get this put to the list directly... -- Forwarded message - From: Date: Thu, Jan 28, 2021 at 11:59 AM Subject: New Defects reported by Coverity Scan for RTEMS To: Hi, Please find the latest report on new defect(s) introduced to RTEMS found with

Re: [PATCH] Add model file for Coverity

2021-01-28 Thread Joel Sherrill
I'm still not getting emails when the runs are finished but it looks like it is done. FWIW spi-sd-card.c seems to be the one I see everytime I load the defect page. The three in spi-sd-card.c look legitimate. Not sure what your approach is for nibbling at them but at first glance, those look

Re: [PATCH] Add model file for Coverity

2021-01-28 Thread Joel Sherrill
On Thu, Jan 28, 2021 at 1:11 PM Joel Sherrill wrote: > > > On Thu, Jan 28, 2021 at 12:44 PM Sebastian Huber < > sebastian.hu...@embedded-brains.de> wrote: > >> On 28/01/2021 19:42, Sebastian Huber wrote: >> >> > +#define _CPU_Fatal_halt( _source, _error ) \ >> > + do { \ >> > +(void)

Re: [PATCH] Add model file for Coverity

2021-01-28 Thread Joel Sherrill
On Thu, Jan 28, 2021 at 12:44 PM Sebastian Huber < sebastian.hu...@embedded-brains.de> wrote: > On 28/01/2021 19:42, Sebastian Huber wrote: > > > +#define _CPU_Fatal_halt( _source, _error ) \ > > + do { \ > > +(void) _source; \ > > +(void) _error; \ > > +__coverity_panic__(); \ > > +

Re: [PATCH] Add model file for Coverity

2021-01-28 Thread Sebastian Huber
On 28/01/2021 19:42, Sebastian Huber wrote: +#define _CPU_Fatal_halt( _source, _error ) \ + do { \ +(void) _source; \ +(void) _error; \ +__coverity_panic__(); \ + } while( 0 ) I am not sure if #define works for the models. The documentation mentions only real functions and

[PATCH] Add model file for Coverity

2021-01-28 Thread Sebastian Huber
--- static-analysis/coverity/model.c | 63 1 file changed, 63 insertions(+) create mode 100644 static-analysis/coverity/model.c diff --git a/static-analysis/coverity/model.c b/static-analysis/coverity/model.c new file mode 100644 index 000..cd25d2b ---

Re: Coverity Run Schedule

2021-01-28 Thread Joel Sherrill
On Thu, Jan 28, 2021 at 9:34 AM Sebastian Huber < sebastian.hu...@embedded-brains.de> wrote: > On 28/01/2021 15:00, Joel Sherrill wrote: > > > Any thoughts on me doing this and a schedule? > Doing this would be great. Long overdue even. :) I also need to move to the big sweep being run from

Re: Use of enum for flags?

2021-01-28 Thread Gedare Bloom
On Thu, Jan 28, 2021 at 8:30 AM Sebastian Huber < sebastian.hu...@embedded-brains.de> wrote: > Hello, > > we have currently: > > /** > * @brief Thread life states. > * > * The thread life states are orthogonal to the thread states used for > * synchronization primitives and blocking

Re: Coverity Run Schedule

2021-01-28 Thread Gedare Bloom
I also think daily will be adequate. Probably, after 5PM in Huntsville will be a good time, then the results will be run over what most people have done before their next working day begins. Unless Chris would like earlier results in his day. On Thu, Jan 28, 2021 at 8:35 AM Sebastian Huber <

Re: Coverity Run Schedule

2021-01-28 Thread Sebastian Huber
On 28/01/2021 15:00, Joel Sherrill wrote: Any thoughts on me doing this and a schedule? Doing this would be great. It would be definitely nice to get an early feedback after code changes. I think once per day should be more than enough. -- embedded brains GmbH Herr Sebastian HUBER

Use of enum for flags?

2021-01-28 Thread Sebastian Huber
Hello, we have currently: /**  * @brief Thread life states.  *  * The thread life states are orthogonal to the thread states used for  * synchronization primitives and blocking operations.  They reflect the state  * changes triggered with thread restart and delete requests.  *  * The

[PATCH 11/11] rtems: Mark value as used

2021-01-28 Thread Sebastian Huber
This fix relates to a Coverity issue (UNUSED_VALUE). --- cpukit/rtems/src/semrelease.c | 1 + 1 file changed, 1 insertion(+) diff --git a/cpukit/rtems/src/semrelease.c b/cpukit/rtems/src/semrelease.c index c31f242a98..3a1f9671fe 100644 --- a/cpukit/rtems/src/semrelease.c +++

[PATCH 10/11] score: Remove double assignment

2021-01-28 Thread Sebastian Huber
This fix relates to a Coverity issue (UNUSED_VALUE). --- cpukit/score/src/scheduleredfsmp.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/cpukit/score/src/scheduleredfsmp.c b/cpukit/score/src/scheduleredfsmp.c index 985f06f4bf..b8b1d9de95 100644 ---

[PATCH 09/11] libtest: Check return values with RTEMS_DEBUG

2021-01-28 Thread Sebastian Huber
This fix relates to a Coverity issue (UNINIT). --- cpukit/libtest/t-test-rtems-measure.c | 60 +-- 1 file changed, 47 insertions(+), 13 deletions(-) diff --git a/cpukit/libtest/t-test-rtems-measure.c b/cpukit/libtest/t-test-rtems-measure.c index aed309928f..882a14d840

[PATCH 08/11] score: Remove superfluous type qualifier

2021-01-28 Thread Sebastian Huber
This fix relates to a Coverity issue (PW.USELESS_TYPE_QUALIFIER_ON_RETURN_TYPE). --- cpukit/include/rtems/score/smpimpl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpukit/include/rtems/score/smpimpl.h b/cpukit/include/rtems/score/smpimpl.h index ddc2df6b11..32704d7288

[PATCH 06/11] bsp/leon3: Improve printk() support

2021-01-28 Thread Sebastian Huber
Use the idle stack to buffer early uses of printk(). Print the buffered characters during initialization when the UART is available and before the idle stack is used normally. This fix relates to a Coverity issue (PW.SET_BUT_NOT_USED). --- bsps/sparc/leon3/console/printk_support.c | 92

[PATCH 00/11] Misc Coverity fixes

2021-01-28 Thread Sebastian Huber
Not all issues are related to: https://scan.coverity.com/projects/rtems Some are obtained by a private Coverity instance. Sebastian Huber (11): score: Add comments and asserts for clarification kern_tc.c: Remove unused code bsp/leon3: Fix incompatible function types score: Fix implicit

[PATCH 02/11] kern_tc.c: Remove unused code

2021-01-28 Thread Sebastian Huber
This fix relates to a Coverity issue (PW.DECLARED_BUT_NOT_REFERENCED). --- cpukit/score/src/kern_tc.c | 6 -- 1 file changed, 6 deletions(-) diff --git a/cpukit/score/src/kern_tc.c b/cpukit/score/src/kern_tc.c index a93cfaeff0..b5f761aae0 100644 --- a/cpukit/score/src/kern_tc.c +++

[PATCH 05/11] score: Simplify _MRSP_Wait_for_ownership()

2021-01-28 Thread Sebastian Huber
Do not shadow the queue_context parameter with a local variable. Reuse the queue context to reduce the required stack space. This fix relates to a Coverity issue (PW.PARAMETER_HIDDEN). --- cpukit/include/rtems/score/mrspimpl.h | 13 ++--- 1 file changed, 6 insertions(+), 7 deletions(-)

[PATCH 07/11] score: Simplify _CORE_message_queue_Broadcast()

2021-01-28 Thread Sebastian Huber
This fix relates to a Coverity issue (PW.SET_BUT_NOT_USED). --- cpukit/score/src/coremsgbroadcast.c | 19 --- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/cpukit/score/src/coremsgbroadcast.c b/cpukit/score/src/coremsgbroadcast.c index f119d49275..3d6c94925f

[PATCH 03/11] bsp/leon3: Fix incompatible function types

2021-01-28 Thread Sebastian Huber
This fix relates to a Coverity issue (PW.INCOMPATIBLE_PARAM). --- bsps/sparc/leon3/clock/ckinit.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/bsps/sparc/leon3/clock/ckinit.c b/bsps/sparc/leon3/clock/ckinit.c index bf0c506ec0..43e5f55ae5 100644 ---

[PATCH 04/11] score: Fix implicit type conversion

2021-01-28 Thread Sebastian Huber
This fix relates to a Coverity issue (PW.MIXED_ENUM_TYPE). --- cpukit/include/rtems/rtems/timerimpl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpukit/include/rtems/rtems/timerimpl.h b/cpukit/include/rtems/rtems/timerimpl.h index c441a040e6..840005d538 100644 ---

[PATCH 01/11] score: Add comments and asserts for clarification

2021-01-28 Thread Sebastian Huber
This fix relates to a Coverity issue (NULL_RETURNS). --- cpukit/include/rtems/score/priorityimpl.h | 7 +++ 1 file changed, 7 insertions(+) diff --git a/cpukit/include/rtems/score/priorityimpl.h b/cpukit/include/rtems/score/priorityimpl.h index 1a7f90a065..7a14ec97b8 100644 ---

Re: [PATCH] score: Add _Thread_Demand_objects_information()

2021-01-28 Thread Sebastian Huber
On 28/01/2021 15:06, Peter Dufault wrote: What's the rationale for "Demand"? Is that in use other places? It sounds odd to me, as if you're insisting the function provide something that it might otherwise decide not to. "Get" was already used. This is a "Get" when we know the identifier is

Re: [PATCH] score: Add _Thread_Demand_objects_information()

2021-01-28 Thread Peter Dufault
What's the rationale for "Demand"? Is that in use other places? It sounds odd to me, as if you're insisting the function provide something that it might otherwise decide not to. > On Jan 28, 2021, at 24:18 , Sebastian Huber > wrote: > > On 27/01/2021 21:25, Joel Sherrill wrote: > >> Piling

Coverity Run Schedule

2021-01-28 Thread Joel Sherrill
Hi I think it is probably time to put running Coverity in a cron job. If I am reading their FAQ correctly, they say we are submitting analysis of 271K SLOC of code which gives us 3 runs a day. I'm thinking I will reuse some code from the build sweeper to deal with tool updates and detecting

Re: [PATCH] STM32H7 BSP: Commented out legacy define which causes nameclashes

2021-01-28 Thread Joel Sherrill
I think this is ok. A BSP should not be defining standard named symbols. Does any code internally use PAGESIZE? Just checking for side-effects. It probably should be in an ifndef RTEMS block with a comment above to make it easier to potentially update this file in the future. --joel On Thu,

[PATCH] STM32H7 BSP: Commented out legacy define which causes nameclashes

2021-01-28 Thread Robin Mueller
--- I had a warning related to nameclash of defines for the arm/stm32h7 BSP. More specifically, the define PAGESIZE which is defined in stm32_hal_legacy.h as well as in limits.h (which is located in arm-rtems6/include) I solved the problem for now by commenting out the define in

[PATCH 1/3] score: Fix _Objects_Get_information() indentation

2021-01-28 Thread Sebastian Huber
This fix relates to a Coverity issue (NESTING_INDENT_MISMATCH). --- cpukit/score/src/objectgetinfo.c | 15 --- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/cpukit/score/src/objectgetinfo.c b/cpukit/score/src/objectgetinfo.c index 07b401faf0..a256d20d87 100644 ---

[PATCH 0/3] Fix some indentation issues

2021-01-28 Thread Sebastian Huber
Sebastian Huber (3): score: Fix _Objects_Get_information() indentation bsp/leon3: Fix bsp_fatal_extension) indentation score: Fix _CORE_message_queue_Submit() indentation bsps/sparc/leon3/start/bspclean.c | 28 +-- cpukit/score/src/coremsgsubmit.c | 80

[PATCH 2/3] bsp/leon3: Fix bsp_fatal_extension) indentation

2021-01-28 Thread Sebastian Huber
Remove superfluous include. Fix comment formatting. This fix relates to a Coverity issue (NESTING_INDENT_MISMATCH). --- bsps/sparc/leon3/start/bspclean.c | 28 +--- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/bsps/sparc/leon3/start/bspclean.c

[PATCH 3/3] score: Fix _CORE_message_queue_Submit() indentation

2021-01-28 Thread Sebastian Huber
This fix relates to a Coverity issue (NESTING_INDENT_MISMATCH). --- cpukit/score/src/coremsgsubmit.c | 80 1 file changed, 40 insertions(+), 40 deletions(-) diff --git a/cpukit/score/src/coremsgsubmit.c b/cpukit/score/src/coremsgsubmit.c index