Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/include/kernel/ext_manifest.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ enum ext_man_elem_type {

/* EXT_MAN_ELEM_CONFIG_DATA elements identificators */
enum config_elem_type {
EXT_MAN_CONFIG_FIRST_ELEM = 1,
EXT_MAN_CONFIG_IPC_MSG_SIZE = 1,
EXT_MAN_CONFIG_MEMORY_USAGE_SCAN = 2, /**< ABI3.18 */
EXT_MAN_CONFIG_LAST_ELEM, /**< keep it at the end of enum list */
Expand Down Expand Up @@ -95,7 +96,7 @@ struct ext_man_dbg_abi {
struct ext_man_config_data {
struct ext_man_elem_header hdr;

struct config_elem elems[EXT_MAN_CONFIG_LAST_ELEM];
struct config_elem elems[EXT_MAN_CONFIG_LAST_ELEM - EXT_MAN_CONFIG_FIRST_ELEM];
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, starts to be a convoluted to me. I didn't pay attention when the "LAST_ELEM" was added, so without context of the prior discussions, I'd say simple "struct config_elem elems[EXT_MAN_CONFIG_LAST_ELEM - 1];" would be simple enough.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kv2019i This would be easy for view and later change. You will no longer need to update the 1 to other values if you change the ENUM or add some comments here to say: "the enum starts at 1"

} __packed;

#endif /* __KERNEL_EXT_MANIFEST_H__ */