return 1;
}
-/* returns -E_MOOD_LOADED on _success_ to terminate the loop */
-static int mood_loop(struct osl_row *mood_row, void *data)
+/*
+ * Calls load_mood() and reverts its error value: It returns -E_MOOD_LOADED
+ * on _success_, and 1 on errors. This way the loop over all moods stops at the
+ * first valid mood.
+ */
+static int load_mood_loop_func(struct osl_row *mood_row, void *data)
{
struct mood **m = data;
int ret = load_mood(mood_row, m);
static int load_first_available_mood(struct mood **m)
{
int ret = osl_rbtree_loop(moods_table, BLOBCOL_NAME, m,
- mood_loop);
+ load_mood_loop_func);
if (ret == -E_MOOD_LOADED) /* success */
return 1;
if (ret < 0)