samples, tests: Switch main return type from void to int

This applies the coccinelle script to another set of files:

   samples/bluetooth/bthome_sensor_template/src/main.c
   samples/boards/stm32/power_mgmt/standby_shutdown/src/main.c
   samples/drivers/smbus/src/main.c
   samples/drivers/virtualization/ivshmem/doorbell/src/ivshmem.c
   samples/fuel_gauge/max17048/src/main.c
   samples/hello_world/src/main.c
   samples/sensor/proximity_polling/src/main.c
   samples/subsys/logging/ble_backend/src/main.c
   tests/drivers/build_all/mfd/src/main.c

Signed-off-by: Keith Packard <keithp@keithp.com>
This commit is contained in:
Keith Packard 2023-04-13 08:12:31 -07:00 committed by Stephanos Ioannidis
commit 1d5e644d12
9 changed files with 26 additions and 18 deletions

View file

@ -88,7 +88,7 @@ void thread_shutdown_standby_mode(void)
K_THREAD_DEFINE(thread_shutdown_standby_mode_id, STACKSIZE, thread_shutdown_standby_mode,
NULL, NULL, NULL, PRIORITY, 0, 0);
void main(void)
int main(void)
{
int ret;
uint32_t cause;
@ -117,14 +117,14 @@ void main(void)
if (!gpio_is_ready_dt(&button)) {
printk("Error: button device %s is not ready\n",
button.port->name);
return;
return 0;
}
ret = gpio_pin_configure_dt(&button, GPIO_INPUT);
if (ret != 0) {
printk("Error %d: failed to configure %s pin %d\n",
ret, button.port->name, button.pin);
return;
return 0;
}
ret = gpio_pin_interrupt_configure_dt(&button,
@ -132,7 +132,7 @@ void main(void)
if (ret != 0) {
printk("Error %d: failed to configure interrupt on %s pin %d\n",
ret, button.port->name, button.pin);
return;
return 0;
}
gpio_init_callback(&button_cb_data, button_pressed, BIT(button.pin));
@ -152,4 +152,5 @@ void main(void)
led_is_on = !led_is_on;
}
return 0;
}