Skip to content

Commit 76ae0ba

Browse files
aaronemasseygalak
authored andcommitted
emul: Remove or declare unused args
In several locations of the emulator code there are unused function arguments that were never caught. Declare these as unused or remove the unused function parameters entirely. Signed-off-by: Aaron Massey <aaronmassey@google.com>
1 parent 9d7b9dc commit 76ae0ba

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

drivers/espi/espi_emul.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,8 @@ static int espi_emul_read_lpc_request(const struct device *dev, enum lpc_periphe
9191
struct espi_emul *emul;
9292
struct espi_emul_data *emul_data = dev->data;
9393

94+
ARG_UNUSED(data);
95+
9496
if (!(emul_data->cfg.channel_caps & ESPI_CHANNEL_VWIRE)) {
9597
LOG_ERR("bad channel vwire");
9698
return -EINVAL;
@@ -122,6 +124,8 @@ static int espi_emul_write_lpc_request(const struct device *dev, enum lpc_periph
122124
uint32_t *data)
123125
{
124126
ARG_UNUSED(dev);
127+
ARG_UNUSED(op);
128+
ARG_UNUSED(data);
125129

126130
return -EINVAL;
127131
}

subsys/emul/emul_bmi160.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ struct bmi160_emul_cfg {
4646
/* Names for the PMU components */
4747
static const char *const pmu_name[] = { "acc", "gyr", "mag", "INV" };
4848

49-
static void sample_read(struct bmi160_emul_data *data, union bmi160_sample *buf)
49+
static void sample_read(union bmi160_sample *buf)
5050
{
5151
/*
5252
* Use hard-coded scales to get values just above 0, 1, 2 and
@@ -175,6 +175,8 @@ static int bmi160_emul_io_spi(const struct emul *emulator, const struct spi_conf
175175
unsigned int regn, val;
176176
int count;
177177

178+
ARG_UNUSED(config);
179+
178180
data = emulator->data;
179181

180182
__ASSERT_NO_MSG(tx_bufs || rx_bufs);
@@ -206,7 +208,7 @@ static int bmi160_emul_io_spi(const struct emul *emulator, const struct spi_conf
206208
break;
207209
case BMI160_SAMPLE_SIZE:
208210
if (regn & BMI160_REG_READ) {
209-
sample_read(data, rxd->buf);
211+
sample_read(rxd->buf);
210212
} else {
211213
LOG_INF("Unknown sample write");
212214
}
@@ -263,7 +265,7 @@ static int bmi160_emul_transfer_i2c(const struct emul *emulator, struct i2c_msg
263265
msgs->buf[0] = val;
264266
break;
265267
case BMI160_SAMPLE_SIZE:
266-
sample_read(data, (void *)msgs->buf);
268+
sample_read((void *)msgs->buf);
267269
break;
268270
default:
269271
LOG_ERR("Unexpected msg1 length %d", msgs->len);
@@ -305,6 +307,8 @@ static int emul_bosch_bmi160_init(const struct emul *target, const struct device
305307
struct bmi160_emul_data *data = target->data;
306308
uint8_t *reg = cfg->reg;
307309

310+
ARG_UNUSED(parent);
311+
308312
data->pmu_status = 0;
309313

310314
reg[BMI160_REG_CHIPID] = BMI160_CHIP_ID;

subsys/emul/espi/emul_espi_host.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,8 @@ static int emul_host_init(const struct emul *emul, const struct device *bus)
250250
{
251251
struct espi_host_emul_data *data = emul->data;
252252

253+
ARG_UNUSED(bus);
254+
253255
emul_host_init_vw_state(data);
254256

255257
return 0;

0 commit comments

Comments
 (0)