code-guideline: Tag name should be a unique identifier
Following are the changes to variable names that are matching with tag names (Rule 5.7 violations) In kernel.h, event_type is matching with a tag name in lib/os/onoff.c. Added a _ prefix to event_type and also to the macro argument names. In userspace.c, *dyn_obj is matching with the tag name dyn_obj in the file itslef. Changed it to dyn In device.h, device_mmio.h, init.h and init.c, changed the *device to dev. Except for one change in init.h Signed-off-by: Spoorthy Priya Yerabolu <spoorthy.priya.yerabolu@intel.com>
This commit is contained in:
parent
c2122313c3
commit
9247e8bc44
6 changed files with 94 additions and 94 deletions
|
@ -51,12 +51,12 @@ struct init_entry {
|
|||
struct device *dev;
|
||||
};
|
||||
|
||||
void z_sys_init_run_level(int32_t level);
|
||||
void z_sys_init_run_level(int32_t _level);
|
||||
|
||||
/* A counter is used to avoid issues when two or more system devices
|
||||
* are declared in the same C file with the same init function.
|
||||
*/
|
||||
#define Z_SYS_NAME(init_fn) _CONCAT(_CONCAT(sys_init_, init_fn), __COUNTER__)
|
||||
#define Z_SYS_NAME(_init_fn) _CONCAT(_CONCAT(sys_init_, _init_fn), __COUNTER__)
|
||||
|
||||
/**
|
||||
* @def Z_INIT_ENTRY_DEFINE
|
||||
|
@ -69,25 +69,25 @@ void z_sys_init_run_level(int32_t level);
|
|||
* not be used directly, use relevant macro such as SYS_INIT() or
|
||||
* DEVICE_AND_API_INIT() instead.
|
||||
*
|
||||
* @param entry_name Init entry name. It is the name this instance exposes to
|
||||
* @param _entry_name Init entry name. It is the name this instance exposes to
|
||||
* the system.
|
||||
*
|
||||
* @param init_fn Address to the init function of the entry.
|
||||
* @param _init_fn Address to the init function of the entry.
|
||||
*
|
||||
* @param device A device driver instance pointer or NULL
|
||||
* @param _device A device driver instance pointer or NULL
|
||||
*
|
||||
* @param level The initialization level at which configuration
|
||||
* @param _level The initialization level at which configuration
|
||||
* occurs. See SYS_INIT().
|
||||
*
|
||||
* @param prio The initialization priority of the object, relative to
|
||||
* other objects of the same initialization level. See SYS_INIT().
|
||||
*/
|
||||
#define Z_INIT_ENTRY_DEFINE(entry_name, init_fn, device, level, prio) \
|
||||
#define Z_INIT_ENTRY_DEFINE(_entry_name, _init_fn, _device, _level, _prio) \
|
||||
static const Z_DECL_ALIGN(struct init_entry) \
|
||||
_CONCAT(__init_, entry_name) __used \
|
||||
__attribute__((__section__(".init_" #level STRINGIFY(prio)))) = { \
|
||||
.init = (init_fn), \
|
||||
.dev = (device), \
|
||||
_CONCAT(__init_, _entry_name) __used \
|
||||
__attribute__((__section__(".init_" #_level STRINGIFY(_prio)))) = { \
|
||||
.init = (_init_fn), \
|
||||
.dev = (_device), \
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -99,9 +99,9 @@ void z_sys_init_run_level(int32_t level);
|
|||
*
|
||||
* @details This macro lets you run a function at system boot.
|
||||
*
|
||||
* @param init_fn Pointer to the boot function to run
|
||||
* @param _init_fn Pointer to the boot function to run
|
||||
*
|
||||
* @param level The initialization level at which configuration occurs.
|
||||
* @param _level The initialization level at which configuration occurs.
|
||||
* Must be one of the following symbols, which are listed in the order
|
||||
* they are performed by the kernel:
|
||||
* \n
|
||||
|
@ -124,7 +124,7 @@ void z_sys_init_run_level(int32_t level);
|
|||
* that need automatic configuration. These objects can use all services
|
||||
* provided by the kernel during configuration.
|
||||
*
|
||||
* @param prio The initialization priority of the object, relative to
|
||||
* @param _prio The initialization priority of the object, relative to
|
||||
* other objects of the same initialization level. Specified as an integer
|
||||
* value in the range 0 to 99; lower values indicate earlier initialization.
|
||||
* Must be a decimal integer literal without leading zeroes or sign (e.g. 32),
|
||||
|
@ -132,8 +132,8 @@ void z_sys_init_run_level(int32_t level);
|
|||
* expressions are *not* permitted
|
||||
* (e.g. CONFIG_KERNEL_INIT_PRIORITY_DEFAULT + 5).
|
||||
*/
|
||||
#define SYS_INIT(init_fn, level, prio) \
|
||||
Z_INIT_ENTRY_DEFINE(Z_SYS_NAME(init_fn), init_fn, NULL, level, prio)
|
||||
#define SYS_INIT(_init_fn, _level, _prio) \
|
||||
Z_INIT_ENTRY_DEFINE(Z_SYS_NAME(_init_fn), _init_fn, NULL, _level, _prio)
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue