CMD_PKT_SIZE_IN_WORDS uses sizeof()

Changes the definition of CMD_PKT_SIZE_IN_WORDS from a hard-coded value to
one that uses sizeof().  This makes the system less brittle should the size
of k_args change.

Change-Id: If9ccb7f2a2a6d13bcf62eea3b0cf52942db0071c
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
This commit is contained in:
Peter Mitsis 2015-04-22 10:54:36 -04:00 committed by Anas Nashif
commit bd4b6797e1
2 changed files with 1 additions and 8 deletions

View file

@ -43,7 +43,7 @@ extern "C" {
/* defines */
#define CMD_PKT_SIZE_IN_WORDS 20 /* This matches the size of struct k_args */
#define CMD_PKT_SIZE_IN_WORDS (sizeof(struct k_args) / sizeof(uint32_t))
/*******************************************************************************
*

View file

@ -483,13 +483,6 @@ union k_args_args {
struct k_chack ChAck;
};
/*
* At the present time, the size of k_args has been calculated to be 80 bytes
* (the largest field in the K_ARGS_ARGS union type is [m1] at 48 bytes).
* Should the size of k_args change, then the macro CMD_PKT_SIZE_IN_WORDS
* in cmdPkt.h must be updated.
*/
struct k_args {
struct k_args *Forw;
struct k_args **Head;