[RTEMS Project] #4819: Unclear #IF 1 Clause in File: Possible Error
RTEMS trac
trac at rtems.org
Tue Jan 24 15:54:23 UTC 2023
#4819: Unclear #IF 1 Clause in File: Possible Error
---------------------------+----------------------------
Reporter: Daniel Páscoa | Owner: Needs Funding
Type: defect | Status: assigned
Priority: normal | Milestone: 7.1
Component: unspecified | Version: 6
Severity: normal | Resolution:
Keywords: qualification | Blocked By:
Blocking: |
---------------------------+----------------------------
Description changed by Sebastian Huber:
Old description:
> **Description:**
> It has been noticed that the noted file contains an #IF 1 clause that has
> been implemented in an unclear manner, and with a comment about a
> possible error. It is recommended to verify the necessity of this clause
> in the file, and if it is not needed, remove it. It's also important to
> clarify the possible error to avoid confusion in the future.
>
> The attached excel lists in a systematic way the sources where this issue
> applies.
>
> **Additional Notes:**
> This ticket was raised as an outcome of the Independent SW Verification
> and Validation (ISVV) for ESA-promoted RTEMS SMP Qualification Data Packs
> (https://rtems-qual.io.esa.int). Original ISVV reference for this issue
> is RTEMS-SMP-CODE-VER-071.
>
> **File list (please check the attached excel for more information):**
> cpukit\rtems\src\msgqconstruct.c
New description:
**Description:**
It has been noticed that the noted file contains an #IF 1 clause that has
been implemented in an unclear manner, and with a comment about a possible
error. It is recommended to verify the necessity of this clause in the
file, and if it is not needed, remove it. It's also important to clarify
the possible error to avoid confusion in the future.
The attached excel lists in a systematic way the sources where this issue
applies.
**Additional Notes:**
This ticket was raised as an outcome of the Independent SW Verification
and Validation (ISVV) for ESA-promoted RTEMS SMP Qualification Data Packs
(https://rtems-qual.io.esa.int). Original ISVV reference for this issue is
RTEMS-SMP-CODE-VER-071.
**File list (please check the attached excel for more information):**
cpukit\rtems\src\msgqconstruct.c
**Code block**
{{{#!c
#if defined(RTEMS_MULTIPROCESSING)
if ( _System_state_Is_multiprocessing ) {
is_global = _Attributes_Is_global( config->attributes );
} else {
is_global = false;
}
#if 1
/*
* I am not 100% sure this should be an error.
* It seems reasonable to create a que with a large max size,
* and then just send smaller msgs from remote (or all) nodes.
*/
if ( is_global ) {
size_t max_packet_payload_size = _MPCI_table->maximum_packet_size
- MESSAGE_QUEUE_MP_PACKET_SIZE;
if ( config->maximum_message_size > max_packet_payload_size ) {
return RTEMS_INVALID_SIZE;
}
}
#endif
#endif
}}}
**Analysis
The check is superfluous since the send directives check this also. It
just prevents local messages from having a larger size. I would remove the
check.
--
--
Ticket URL: <http://devel.rtems.org/ticket/4819#comment:3>
RTEMS Project <http://www.rtems.org/>
RTEMS Project
More information about the bugs
mailing list