Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[datapipe] Remove lintisms. JB#22475
Casting datapipe_exec_xxx() function return values to (void)
is useful when trying to avoid false positive warnings from
static analysis tools. When such tools / compiler options
invoking strict enough checks are not employed they just add
noise to code base.

Remove return value casting from all datapipe function calls.
And do the same for the whole mce source tree while at it.

Signed-off-by: Simo Piiroinen <simo.piiroinen@jollamobile.com>
  • Loading branch information
spiiroin committed Mar 15, 2018
1 parent 187c0cb commit 2d041b7
Show file tree
Hide file tree
Showing 9 changed files with 143 additions and 143 deletions.
10 changes: 5 additions & 5 deletions event-input.c
Expand Up @@ -2169,9 +2169,9 @@ evin_iomon_keypress_cb(mce_io_mon_t *iomon, gpointer data, gsize bytes_read)
if ((ev->code == KEY_SCREENLOCK) && (ev->value != 2)) {
key_state_t key_state = ev->value ?
KEY_STATE_PRESSED : KEY_STATE_RELEASED;
(void)datapipe_exec_full(&lockkey_state_pipe,
GINT_TO_POINTER(key_state),
USE_INDATA, CACHE_INDATA);
datapipe_exec_full(&lockkey_state_pipe,
GINT_TO_POINTER(key_state),
USE_INDATA, CACHE_INDATA);
}

/* For now there's no reason to cache the keypress
Expand All @@ -2192,8 +2192,8 @@ evin_iomon_keypress_cb(mce_io_mon_t *iomon, gpointer data, gsize bytes_read)
((((submode & MCE_SUBMODE_EVEATER) == 0) &&
(ev->value == 1)) || (ev->value == 0))) &&
((submode & MCE_SUBMODE_PROXIMITY_TKLOCK) == 0)) {
(void)datapipe_exec_full(&keypress_event_pipe, &ev,
USE_INDATA, DONT_CACHE_INDATA);
datapipe_exec_full(&keypress_event_pipe, &ev,
USE_INDATA, DONT_CACHE_INDATA);
}
}

Expand Down
50 changes: 25 additions & 25 deletions event-switches.c
Expand Up @@ -124,9 +124,9 @@ static gboolean camera_launch_button_iomon_cb(mce_io_mon_t *iomon, gpointer data
USE_INDATA, CACHE_OUTDATA);

/* Update camera button state */
(void)datapipe_exec_full(&camera_button_state_pipe,
GINT_TO_POINTER(camera_button_state),
USE_INDATA, CACHE_INDATA);
datapipe_exec_full(&camera_button_state_pipe,
GINT_TO_POINTER(camera_button_state),
USE_INDATA, CACHE_INDATA);

return FALSE;
}
Expand All @@ -150,9 +150,9 @@ static gboolean lockkey_iomon_cb(mce_io_mon_t *iomon, gpointer data, gsize bytes
lockkey_state = KEY_STATE_PRESSED;
}

(void)datapipe_exec_full(&lockkey_state_pipe,
GINT_TO_POINTER(lockkey_state),
USE_INDATA, CACHE_INDATA);
datapipe_exec_full(&lockkey_state_pipe,
GINT_TO_POINTER(lockkey_state),
USE_INDATA, CACHE_INDATA);

return FALSE;
}
Expand Down Expand Up @@ -182,9 +182,9 @@ static gboolean kbd_slide_iomon_cb(mce_io_mon_t *iomon, gpointer data, gsize byt
slide_state = COVER_CLOSED;
}

(void)datapipe_exec_full(&keyboard_slide_state_pipe,
GINT_TO_POINTER(slide_state),
USE_INDATA, CACHE_INDATA);
datapipe_exec_full(&keyboard_slide_state_pipe,
GINT_TO_POINTER(slide_state),
USE_INDATA, CACHE_INDATA);

return FALSE;
}
Expand Down Expand Up @@ -214,9 +214,9 @@ static gboolean lid_sensor_actual_iomon_cb(mce_io_mon_t *iomon, gpointer data, g
lid_state = COVER_CLOSED;
}

(void)datapipe_exec_full(&lid_sensor_actual_pipe,
GINT_TO_POINTER(lid_state),
USE_INDATA, CACHE_INDATA);
datapipe_exec_full(&lid_sensor_actual_pipe,
GINT_TO_POINTER(lid_state),
USE_INDATA, CACHE_INDATA);

return FALSE;
}
Expand All @@ -242,9 +242,9 @@ static gboolean proximity_sensor_iomon_cb(mce_io_mon_t *iomon, gpointer data, gs
proximity_sensor_actual = COVER_CLOSED;
}

(void)datapipe_exec_full(&proximity_sensor_actual_pipe,
GINT_TO_POINTER(proximity_sensor_actual),
USE_INDATA, CACHE_INDATA);
datapipe_exec_full(&proximity_sensor_actual_pipe,
GINT_TO_POINTER(proximity_sensor_actual),
USE_INDATA, CACHE_INDATA);

return FALSE;
}
Expand Down Expand Up @@ -274,9 +274,9 @@ static gboolean usb_cable_iomon_cb(mce_io_mon_t *iomon, gpointer data, gsize byt
datapipe_exec_full(&inactivity_event_pipe, GINT_TO_POINTER(FALSE),
USE_INDATA, CACHE_OUTDATA);

(void)datapipe_exec_full(&usb_cable_state_pipe,
GINT_TO_POINTER(cable_state),
USE_INDATA, CACHE_INDATA);
datapipe_exec_full(&usb_cable_state_pipe,
GINT_TO_POINTER(cable_state),
USE_INDATA, CACHE_INDATA);

return FALSE;
}
Expand Down Expand Up @@ -306,9 +306,9 @@ static gboolean lens_cover_iomon_cb(mce_io_mon_t *iomon, gpointer data, gsize by
lens_cover_state = COVER_CLOSED;
}

(void)datapipe_exec_full(&lens_cover_state_pipe,
GINT_TO_POINTER(lens_cover_state),
USE_INDATA, CACHE_INDATA);
datapipe_exec_full(&lens_cover_state_pipe,
GINT_TO_POINTER(lens_cover_state),
USE_INDATA, CACHE_INDATA);

return FALSE;
}
Expand Down Expand Up @@ -337,9 +337,9 @@ static gboolean update_proximity_sensor(void)
proximity_sensor_actual = COVER_CLOSED;
}

(void)datapipe_exec_full(&proximity_sensor_actual_pipe,
GINT_TO_POINTER(proximity_sensor_actual),
USE_INDATA, CACHE_INDATA);
datapipe_exec_full(&proximity_sensor_actual_pipe,
GINT_TO_POINTER(proximity_sensor_actual),
USE_INDATA, CACHE_INDATA);

g_free(tmp);

Expand All @@ -360,7 +360,7 @@ static void update_proximity_monitor(void)
(alarm_ui_state == MCE_ALARM_UI_VISIBLE_INT32) ||
(alarm_ui_state == MCE_ALARM_UI_RINGING_INT32)) {
mce_write_string_to_file(MCE_PROXIMITY_SENSOR_DISABLE_PATH, "0");
(void)update_proximity_sensor();
update_proximity_sensor();
} else {
mce_write_string_to_file(MCE_PROXIMITY_SENSOR_DISABLE_PATH, "1");
}
Expand Down
4 changes: 2 additions & 2 deletions mce-io.c
Expand Up @@ -1388,7 +1388,7 @@ gboolean mce_read_number_string_from_file(const gchar *const file,
EXIT2:
/* XXX: improve close policy? */
if ((status == FALSE) || (close_on_exit == TRUE)) {
(void)mce_close_file(file, &new_fp);
mce_close_file(file, &new_fp);

if (fp != NULL)
*fp = NULL;
Expand Down Expand Up @@ -1453,7 +1453,7 @@ gboolean mce_write_string_to_file(const gchar *const file,
status = TRUE;

EXIT2:
(void)mce_close_file(file, &fp);
mce_close_file(file, &fp);

EXIT:
return status;
Expand Down
8 changes: 4 additions & 4 deletions modetransition.c
Expand Up @@ -182,8 +182,8 @@ gboolean mce_mode_init(void)
mce_add_submode_int32(MCE_SUBMODE_TRANSITION);
errno = 0;

(void)mce_write_string_to_file(MCE_BOOTUP_FILENAME,
ENABLED_STRING);
mce_write_string_to_file(MCE_BOOTUP_FILENAME,
ENABLED_STRING);

if (g_access(MALF_FILENAME, F_OK) == 0) {
mce_add_submode_int32(MCE_SUBMODE_MALF);
Expand All @@ -196,8 +196,8 @@ gboolean mce_mode_init(void)
goto EXIT;
}

(void)mce_write_string_to_file(MCE_MALF_FILENAME,
ENABLED_STRING);
mce_write_string_to_file(MCE_MALF_FILENAME,
ENABLED_STRING);
}
}
} else {
Expand Down
6 changes: 3 additions & 3 deletions modules/camera.c
Expand Up @@ -132,9 +132,9 @@ static gboolean camera_popout_state_iomon_input_cb(mce_io_mon_t *iomon, gpointer
if (!strncmp(data, MCE_CAMERA_POPPED_OUT,
strlen(MCE_CAMERA_POPPED_OUT))) {
/* Request delayed unlock of touchscreen/keypad lock */
(void)datapipe_exec_full(&tklock_request_pipe,
GINT_TO_POINTER(TKLOCK_REQUEST_OFF_DELAYED),
USE_INDATA, CACHE_INDATA);
datapipe_exec_full(&tklock_request_pipe,
GINT_TO_POINTER(TKLOCK_REQUEST_OFF_DELAYED),
USE_INDATA, CACHE_INDATA);
}

EXIT:
Expand Down
4 changes: 2 additions & 2 deletions modules/display.c
Expand Up @@ -4991,7 +4991,7 @@ static display_type_t mdy_display_type_get(void)

/* Enable hardware fading if supported */
if (mdy_brightness_hw_fading_is_supported == TRUE)
(void)mce_write_number_string_to_file(&mdy_brightness_hw_fading_output, 1);
mce_write_number_string_to_file(&mdy_brightness_hw_fading_output, 1);
}
else if (g_access(DISPLAY_BACKLIGHT_PATH DISPLAY_ACPI_VIDEO0, W_OK) == 0) {
display_type = DISPLAY_TYPE_ACPI_VIDEO0;
Expand Down Expand Up @@ -10516,7 +10516,7 @@ const gchar *g_module_check_init(GModule *module)
mce_worker_add_context(MODULE_NAME);

/* Initialise the display type and the relevant paths */
(void)mdy_display_type_get();
mdy_display_type_get();

#ifdef ENABLE_CPU_GOVERNOR
/* Get CPU scaling governor settings from INI-files */
Expand Down
58 changes: 29 additions & 29 deletions modules/keypad.c
Expand Up @@ -420,35 +420,35 @@ static void set_lysti_backlight_brightness(guint fadetime, guint brightness)
old_brightness = brightness;

/* Disable engine 3 */
(void)mce_write_string_to_file(engine3_mode_path,
MCE_LED_DISABLED_MODE);
mce_write_string_to_file(engine3_mode_path,
MCE_LED_DISABLED_MODE);

/* Turn off all keyboard backlight LEDs */
(void)mce_write_number_string_to_file(&led_brightness_kb0_output, 0);
(void)mce_write_number_string_to_file(&led_brightness_kb1_output, 0);
(void)mce_write_number_string_to_file(&led_brightness_kb2_output, 0);
(void)mce_write_number_string_to_file(&led_brightness_kb3_output, 0);
(void)mce_write_number_string_to_file(&led_brightness_kb4_output, 0);
(void)mce_write_number_string_to_file(&led_brightness_kb5_output, 0);
mce_write_number_string_to_file(&led_brightness_kb0_output, 0);
mce_write_number_string_to_file(&led_brightness_kb1_output, 0);
mce_write_number_string_to_file(&led_brightness_kb2_output, 0);
mce_write_number_string_to_file(&led_brightness_kb3_output, 0);
mce_write_number_string_to_file(&led_brightness_kb4_output, 0);
mce_write_number_string_to_file(&led_brightness_kb5_output, 0);

/* Set backlight LED current */
(void)mce_write_number_string_to_file(&led_current_kb0_output, MAXIMUM_LYSTI_BACKLIGHT_LED_CURRENT);
(void)mce_write_number_string_to_file(&led_current_kb1_output, MAXIMUM_LYSTI_BACKLIGHT_LED_CURRENT);
(void)mce_write_number_string_to_file(&led_current_kb2_output, MAXIMUM_LYSTI_BACKLIGHT_LED_CURRENT);
(void)mce_write_number_string_to_file(&led_current_kb3_output, MAXIMUM_LYSTI_BACKLIGHT_LED_CURRENT);
(void)mce_write_number_string_to_file(&led_current_kb4_output, MAXIMUM_LYSTI_BACKLIGHT_LED_CURRENT);
(void)mce_write_number_string_to_file(&led_current_kb5_output, MAXIMUM_LYSTI_BACKLIGHT_LED_CURRENT);
mce_write_number_string_to_file(&led_current_kb0_output, MAXIMUM_LYSTI_BACKLIGHT_LED_CURRENT);
mce_write_number_string_to_file(&led_current_kb1_output, MAXIMUM_LYSTI_BACKLIGHT_LED_CURRENT);
mce_write_number_string_to_file(&led_current_kb2_output, MAXIMUM_LYSTI_BACKLIGHT_LED_CURRENT);
mce_write_number_string_to_file(&led_current_kb3_output, MAXIMUM_LYSTI_BACKLIGHT_LED_CURRENT);
mce_write_number_string_to_file(&led_current_kb4_output, MAXIMUM_LYSTI_BACKLIGHT_LED_CURRENT);
mce_write_number_string_to_file(&led_current_kb5_output, MAXIMUM_LYSTI_BACKLIGHT_LED_CURRENT);

/* Engine 3 */
(void)mce_write_string_to_file(engine3_mode_path,
MCE_LED_LOAD_MODE);
mce_write_string_to_file(engine3_mode_path,
MCE_LED_LOAD_MODE);

(void)mce_write_string_to_file(engine3_leds_path,
bin_to_string(key_backlight_mask));
(void)mce_write_string_to_file(engine3_load_path,
pattern);
(void)mce_write_string_to_file(engine3_mode_path,
MCE_LED_RUN_MODE);
mce_write_string_to_file(engine3_leds_path,
bin_to_string(key_backlight_mask));
mce_write_string_to_file(engine3_load_path,
pattern);
mce_write_string_to_file(engine3_mode_path,
MCE_LED_RUN_MODE);

EXIT:
return;
Expand All @@ -464,15 +464,15 @@ static void set_n810_backlight_brightness(guint fadetime, guint brightness)
{
/* Set fade time */
if (brightness == 0) {
(void)mce_write_number_string_to_file(&n810_keypad_fadetime_output, fadetime);
(void)mce_write_number_string_to_file(&n810_keyboard_fadetime_output, fadetime);
mce_write_number_string_to_file(&n810_keypad_fadetime_output, fadetime);
mce_write_number_string_to_file(&n810_keyboard_fadetime_output, fadetime);
} else {
(void)mce_write_number_string_to_file(&n810_keypad_fadetime_output, 0);
(void)mce_write_number_string_to_file(&n810_keyboard_fadetime_output, 0);
mce_write_number_string_to_file(&n810_keypad_fadetime_output, 0);
mce_write_number_string_to_file(&n810_keyboard_fadetime_output, 0);
}

(void)mce_write_number_string_to_file(&led_brightness_kb0_output, brightness);
(void)mce_write_number_string_to_file(&led_brightness_kb1_output, brightness);
mce_write_number_string_to_file(&led_brightness_kb0_output, brightness);
mce_write_number_string_to_file(&led_brightness_kb1_output, brightness);
}

/**
Expand All @@ -482,7 +482,7 @@ static void set_n810_backlight_brightness(guint fadetime, guint brightness)
*/
static void set_simple_backlight_brightness(guint brightness)
{
(void)mce_write_number_string_to_file(&backlight_brightness_level_output, brightness);
mce_write_number_string_to_file(&backlight_brightness_level_output, brightness);
}

/**
Expand Down

0 comments on commit 2d041b7

Please sign in to comment.