Skip to content

Commit fe70e48

Browse files
aescolarkartben
authored andcommitted
drivers/counter native_sim: Avoid reusing tag name
Don't use the same name for the structure instance and type. As that is a violation of MISRA-C 2012 rule 5.7. Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
1 parent 919de4e commit fe70e48

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/counter/counter_native_sim.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ static struct counter_alarm_cfg pending_alarm[DRIVER_CONFIG_INFO_CHANNELS];
3232
static bool is_alarm_pending[DRIVER_CONFIG_INFO_CHANNELS];
3333
static struct counter_top_cfg top;
3434
static bool is_top_set;
35-
static const struct device *device;
35+
static const struct device *dev_p;
3636

3737
static void schedule_next_isr(void)
3838
{
@@ -67,15 +67,15 @@ static void counter_isr(const void *arg)
6767
if (is_alarm_pending[i] && (current_value == pending_alarm[i].ticks)) {
6868
is_alarm_pending[i] = false;
6969
if (pending_alarm[i].callback) {
70-
pending_alarm[i].callback(device, i, current_value,
70+
pending_alarm[i].callback(dev_p, i, current_value,
7171
pending_alarm[i].user_data);
7272
}
7373
}
7474
}
7575

7676
if (is_top_set && (current_value == top.ticks)) {
7777
if (top.callback) {
78-
top.callback(device, top.user_data);
78+
top.callback(dev_p, top.user_data);
7979
}
8080
}
8181

@@ -84,7 +84,7 @@ static void counter_isr(const void *arg)
8484

8585
static int ctr_init(const struct device *dev)
8686
{
87-
device = dev;
87+
dev_p = dev;
8888
memset(is_alarm_pending, 0, sizeof(is_alarm_pending));
8989
is_top_set = false;
9090
top.ticks = TOP_VALUE;

0 commit comments

Comments
 (0)