Skip to content

Commit 33e5c23

Browse files
LoveKarlssonnashif
authored andcommitted
Fix for warning of potential error using = instead of ==
The macro MIPI_SYST_ENABLE_HANDLE_LENGTH assigns a value inside the test in a question mark operator. Some compilers (for ex IAR) warn about a potential error "Should this be == instead of =?". By adding an explicit comparison, the compiler is informed that the assignment is intentional. Signed-off-by: Lars-Ove Karlsson <lars-ove.karlsson@iar.com>
1 parent 71ace1f commit 33e5c23

File tree

1 file changed

+2
-2
lines changed
  • library/include/mipi_syst

1 file changed

+2
-2
lines changed

library/include/mipi_syst/api.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ CFG_ERROR_SYST_ALLOC_HANDLE_STATE_CALLED_WITHOUT_PCFG_ENABLE_HEAP_MEMORY
266266
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
267267
*/
268268
#define MIPI_SYST_ENABLE_HANDLE_LENGTH(h, v) \
269-
((h) && ((h)->systh_tag.et_length = (v) ? 1 : 0))
269+
((h) && ((((h)->systh_tag.et_length = (v)) != 0) ? 1 : 0))
270270
#else
271271
#define MIPI_SYST_ENABLE_HANDLE_LENGTH(h, v)
272272
#endif
@@ -455,7 +455,7 @@ CFG_ERROR_SET_HANDLE_GUID_UNIT_WITHOUT_MIPI_SYST_PCFG_ENABLE_ORIGIN_GUID
455455
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
456456
*/
457457
#define MIPI_SYST_ENABLE_HANDLE_TIMESTAMP(h, v) \
458-
((h) && ((h)->systh_tag.et_timestamp = (v) ? 1 : 0))
458+
((h) && ((((h)->systh_tag.et_timestamp = (v)) != 0) ? 1 : 0))
459459

460460
/**
461461
* Get timestamp generation state from given SyS-T handle

0 commit comments

Comments
 (0)