Skip to content

Commit

Permalink
plugins: Whitespace cleanup
Browse files Browse the repository at this point in the history
The coccinelle patch introduces some whitespace violiacense.
Fix up most errors and warnings reported by checkpatch.
  • Loading branch information
Daniel Wagner committed Jul 23, 2013
1 parent b89fa6d commit ad7abb5
Show file tree
Hide file tree
Showing 10 changed files with 75 additions and 53 deletions.
12 changes: 8 additions & 4 deletions plugins/bluetooth.c
Expand Up @@ -105,6 +105,7 @@ static bool proxy_get_nap(GDBusProxy *proxy)

dbus_message_iter_next(&value);
}

return false;
}

Expand Down Expand Up @@ -241,7 +242,9 @@ static int bluetooth_pan_connect(struct connman_network *network)

path = g_dbus_proxy_get_path(pan->btnetwork_proxy);

if (!g_dbus_proxy_method_call(pan->btnetwork_proxy, "Connect", pan_connect_append, pan_connect_cb, g_strdup(path), g_free))
if (!g_dbus_proxy_method_call(pan->btnetwork_proxy, "Connect",
pan_connect_append, pan_connect_cb,
g_strdup(path), g_free))
return -EIO;

connman_network_set_associating(pan->network, true);
Expand Down Expand Up @@ -283,7 +286,8 @@ static int bluetooth_pan_disconnect(struct connman_network *network)

path = g_dbus_proxy_get_path(pan->btnetwork_proxy);

if (!g_dbus_proxy_method_call(pan->btnetwork_proxy, "Disconnect", NULL, pan_disconnect_cb, g_strdup(path), g_free))
if (!g_dbus_proxy_method_call(pan->btnetwork_proxy, "Disconnect",
NULL, pan_disconnect_cb, g_strdup(path), g_free))
return -EIO;

return -EINPROGRESS;
Expand Down Expand Up @@ -637,7 +641,7 @@ static void tethering_create_cb(DBusMessage *message, void *user_data)
const char *dbus_error = dbus_message_get_error_name(message);

DBG("%s tethering failed: %s",
tethering->enable ? "enable": "disable",
tethering->enable ? "enable" : "disable",
dbus_error);
return;
}
Expand Down Expand Up @@ -843,7 +847,7 @@ static int bluetooth_tech_set_tethering(struct connman_technology *technology,
i++;
}

DBG("%s %d device(s)", enabled ? "enabled": "disabled", i);
DBG("%s %d device(s)", enabled ? "enabled" : "disabled", i);

if (i == 0)
return -ENODEV;
Expand Down
19 changes: 13 additions & 6 deletions plugins/bluetooth_legacy.c
Expand Up @@ -117,7 +117,8 @@ static void connect_reply(DBusPendingCall *call, void *user_data)
goto err;
}

if (!dbus_message_get_args(reply, &error, DBUS_TYPE_STRING, &interface, DBUS_TYPE_INVALID)) {
if (!dbus_message_get_args(reply, &error, DBUS_TYPE_STRING,
&interface, DBUS_TYPE_INVALID)) {
if (dbus_error_is_set(&error)) {
connman_error("%s", error.message);
dbus_error_free(&error);
Expand Down Expand Up @@ -173,7 +174,8 @@ static int pan_connect(struct connman_network *network)
dbus_message_append_args(message, DBUS_TYPE_STRING, &uuid,
DBUS_TYPE_INVALID);

if (!dbus_connection_send_with_reply(connection, message, &call, TIMEOUT * 10)) {
if (!dbus_connection_send_with_reply(connection, message,
&call, TIMEOUT * 10)) {
connman_error("Failed to connect service");
dbus_message_unref(message);
return -EINVAL;
Expand Down Expand Up @@ -249,7 +251,8 @@ static int pan_disconnect(struct connman_network *network)

dbus_message_append_args(message, DBUS_TYPE_INVALID);

if (!dbus_connection_send_with_reply(connection, message, &call, TIMEOUT)) {
if (!dbus_connection_send_with_reply(connection, message,
&call, TIMEOUT)) {
connman_error("Failed to disconnect service");
dbus_message_unref(message);
return -EINVAL;
Expand Down Expand Up @@ -479,7 +482,8 @@ static void add_network(const char *path)

dbus_message_set_auto_start(message, FALSE);

if (!dbus_connection_send_with_reply(connection, message, &call, TIMEOUT)) {
if (!dbus_connection_send_with_reply(connection, message,
&call, TIMEOUT)) {
connman_error("Failed to get network properties for %s", path);
goto done;
}
Expand Down Expand Up @@ -841,7 +845,9 @@ static void list_adapters_reply(DBusPendingCall *call, void *user_data)
goto done;
}

if (!dbus_message_get_args(reply, &error, DBUS_TYPE_ARRAY, DBUS_TYPE_OBJECT_PATH, &adapters, &num_adapters, DBUS_TYPE_INVALID)) {
if (!dbus_message_get_args(reply, &error, DBUS_TYPE_ARRAY,
DBUS_TYPE_OBJECT_PATH, &adapters,
&num_adapters, DBUS_TYPE_INVALID)) {
if (dbus_error_is_set(&error)) {
connman_error("%s", error.message);
dbus_error_free(&error);
Expand Down Expand Up @@ -1158,7 +1164,8 @@ static void server_register(const char *path, const char *uuid,
dbus_message_append_args(message, DBUS_TYPE_STRING, &bridge,
DBUS_TYPE_INVALID);

if (!dbus_connection_send_with_reply(connection, message, &call, TIMEOUT)) {
if (!dbus_connection_send_with_reply(connection, message,
&call, TIMEOUT)) {
connman_error("Failed to enable PAN server");
dbus_message_unref(message);
return;
Expand Down
6 changes: 4 additions & 2 deletions plugins/dundee.c
Expand Up @@ -266,7 +266,8 @@ static int set_property(struct dundee_data *info,
dbus_message_iter_init_append(message, &iter);
connman_dbus_property_append_basic(&iter, property, type, value);

if (!dbus_connection_send_with_reply(connection, message, &info->call, TIMEOUT)) {
if (!dbus_connection_send_with_reply(connection, message,
&info->call, TIMEOUT)) {
connman_error("Failed to change property: %s %s",
info->path, property);
dbus_message_unref(message);
Expand Down Expand Up @@ -761,7 +762,8 @@ static int manager_get_devices(void)
if (message == NULL)
return -ENOMEM;

if (!dbus_connection_send_with_reply(connection, message, &call, TIMEOUT)) {
if (!dbus_connection_send_with_reply(connection, message,
&call, TIMEOUT)) {
connman_error("Failed to call GetDevices()");
dbus_message_unref(message);
return -EINVAL;
Expand Down
3 changes: 2 additions & 1 deletion plugins/ethernet.c
Expand Up @@ -431,7 +431,8 @@ static int eth_set_tethering(struct connman_technology *technology,
const char *identifier, const char *passphrase,
const char *bridge, bool enabled)
{
if (!connman_technology_is_tethering_allowed(CONNMAN_SERVICE_TYPE_ETHERNET))
if (!connman_technology_is_tethering_allowed(
CONNMAN_SERVICE_TYPE_ETHERNET))
return 0;

DBG("bridge %s enabled %d", bridge, enabled);
Expand Down
8 changes: 5 additions & 3 deletions plugins/neard.c
Expand Up @@ -476,7 +476,7 @@ static DBusMessage *release_method(DBusConnection *dbus_conn,
}

static const GDBusMethodTable neard_methods[] = {
{ GDBUS_ASYNC_METHOD("RequestOOB",
{ GDBUS_ASYNC_METHOD("RequestOOB",
GDBUS_ARGS({ "data", "a{sv}" }),
GDBUS_ARGS({ "data", "a{sv}" }), request_oob_method) },
{ GDBUS_ASYNC_METHOD("PushOOB",
Expand Down Expand Up @@ -533,12 +533,14 @@ static void register_agent(void)
dbus_message_append_args(message, DBUS_TYPE_OBJECT_PATH,
&path, DBUS_TYPE_STRING, &type, DBUS_TYPE_INVALID);

if (!dbus_connection_send_with_reply(connection, message, &register_call, TIMEOUT)) {
if (!dbus_connection_send_with_reply(connection, message,
&register_call, TIMEOUT)) {
dbus_message_unref(message);
goto out;
}

if (!dbus_pending_call_set_notify(register_call, register_agent_cb, NULL, NULL))
if (!dbus_pending_call_set_notify(register_call,
register_agent_cb, NULL, NULL))
cleanup_register_call();

out:
Expand Down
4 changes: 3 additions & 1 deletion plugins/nmcompat.c
Expand Up @@ -253,7 +253,9 @@ static int nmcompat_init(void)
return -1;
}

if (!g_dbus_register_interface(connection, NM_PATH, DBUS_PROPERTIES_INTERFACE, methods, signals, NULL, NULL, NULL)) {
if (!g_dbus_register_interface(connection, NM_PATH,
DBUS_PROPERTIES_INTERFACE, methods,
signals, NULL, NULL, NULL)) {
connman_error("nmcompat: failed to register "
DBUS_PROPERTIES_INTERFACE);
return -1;
Expand Down
39 changes: 18 additions & 21 deletions plugins/ofono.c
Expand Up @@ -278,8 +278,7 @@ static void set_connected(struct modem_data *modem)

method = modem->context->ipv4_method;
if (method == CONNMAN_IPCONFIG_METHOD_FIXED ||
method == CONNMAN_IPCONFIG_METHOD_DHCP)
{
method == CONNMAN_IPCONFIG_METHOD_DHCP) {
connman_service_create_ip4config(service, index);
connman_network_set_index(modem->network, index);

Expand Down Expand Up @@ -404,7 +403,8 @@ static int set_property(struct modem_data *modem,
dbus_message_iter_init_append(message, &iter);
connman_dbus_property_append_basic(&iter, property, type, value);

if (!dbus_connection_send_with_reply(connection, message, &modem->call_set_property, TIMEOUT)) {
if (!dbus_connection_send_with_reply(connection, message,
&modem->call_set_property, TIMEOUT)) {
connman_error("Failed to change property: %s %s.%s",
path, interface, property);
dbus_message_unref(message);
Expand Down Expand Up @@ -498,7 +498,8 @@ static int get_properties(const char *path, const char *interface,
if (message == NULL)
return -ENOMEM;

if (!dbus_connection_send_with_reply(connection, message, &modem->call_get_properties, TIMEOUT)) {
if (!dbus_connection_send_with_reply(connection, message,
&modem->call_get_properties, TIMEOUT)) {
connman_error("Failed to call %s.GetProperties()", interface);
dbus_message_unref(message);
return -EINVAL;
Expand Down Expand Up @@ -1222,9 +1223,9 @@ static gboolean context_changed(DBusConnection *conn,
if (!modem->attached)
return TRUE;

if (!has_interface(modem->interfaces, OFONO_API_NETREG)) {
if (!has_interface(modem->interfaces,
OFONO_API_NETREG))
return TRUE;
}

add_network(modem);

Expand Down Expand Up @@ -1307,7 +1308,8 @@ static int cm_get_contexts(struct modem_data *modem)
if (message == NULL)
return -ENOMEM;

if (!dbus_connection_send_with_reply(connection, message, &modem->call_get_contexts, TIMEOUT)) {
if (!dbus_connection_send_with_reply(connection, message,
&modem->call_get_contexts, TIMEOUT)) {
connman_error("Failed to call GetContexts()");
dbus_message_unref(message);
return -EINVAL;
Expand Down Expand Up @@ -1702,9 +1704,8 @@ static void cm_update_attached(struct modem_data *modem,
return;
}

if (!has_interface(modem->interfaces, OFONO_API_NETREG)) {
if (!has_interface(modem->interfaces, OFONO_API_NETREG))
return;
}

netreg_get_properties(modem);
}
Expand Down Expand Up @@ -1872,7 +1873,7 @@ static int cdma_cm_get_properties(struct modem_data *modem)
}

static void sim_update_imsi(struct modem_data *modem,
DBusMessageIter* value)
DBusMessageIter *value)
{
char *imsi;

Expand Down Expand Up @@ -2044,25 +2045,20 @@ static void modem_update_interfaces(struct modem_data *modem,
netreg_get_properties(modem);
}

if (api_added(old_ifaces, new_ifaces, OFONO_API_CDMA_NETREG)) {
if (api_added(old_ifaces, new_ifaces, OFONO_API_CDMA_NETREG))
cdma_netreg_get_properties(modem);
}

if (api_removed(old_ifaces, new_ifaces, OFONO_API_CM)) {
if (api_removed(old_ifaces, new_ifaces, OFONO_API_CM))
remove_cm_context(modem, modem->context->path);
}

if (api_removed(old_ifaces, new_ifaces, OFONO_API_CDMA_CM)) {
if (api_removed(old_ifaces, new_ifaces, OFONO_API_CDMA_CM))
remove_cm_context(modem, modem->context->path);
}

if (api_removed(old_ifaces, new_ifaces, OFONO_API_NETREG)) {
if (api_removed(old_ifaces, new_ifaces, OFONO_API_NETREG))
remove_network(modem);
}

if (api_removed(old_ifaces, new_ifaces, OFONO_API_CDMA_NETREG)) {
if (api_removed(old_ifaces, new_ifaces, OFONO_API_CDMA_NETREG))
remove_network(modem);
}
}

static gboolean modem_changed(DBusConnection *conn, DBusMessage *message,
Expand Down Expand Up @@ -2356,7 +2352,8 @@ static int manager_get_modems(void)
if (message == NULL)
return -ENOMEM;

if (!dbus_connection_send_with_reply(connection, message, &call, TIMEOUT)) {
if (!dbus_connection_send_with_reply(connection, message,
&call, TIMEOUT)) {
connman_error("Failed to call GetModems()");
dbus_message_unref(message);
return -EINVAL;
Expand Down
6 changes: 4 additions & 2 deletions plugins/pacrunner.c
Expand Up @@ -67,7 +67,8 @@ static void create_config_reply(DBusPendingCall *call, void *user_data)
goto done;
}

if (!dbus_message_get_args(reply, NULL, DBUS_TYPE_OBJECT_PATH, &path, DBUS_TYPE_INVALID))
if (!dbus_message_get_args(reply, NULL, DBUS_TYPE_OBJECT_PATH,
&path, DBUS_TYPE_INVALID))
goto done;

g_free(current_config);
Expand Down Expand Up @@ -351,7 +352,8 @@ static void request_lookup_reply(DBusPendingCall *call, void *user_data)
goto done;
}

if (!dbus_message_get_args(reply, NULL, DBUS_TYPE_STRING, &proxy, DBUS_TYPE_INVALID))
if (!dbus_message_get_args(reply, NULL, DBUS_TYPE_STRING,
&proxy, DBUS_TYPE_INVALID))
proxy = NULL;

done:
Expand Down
7 changes: 4 additions & 3 deletions plugins/tist.c
Expand Up @@ -375,12 +375,12 @@ static int install_ldisc(GIOChannel *channel, bool install)
}

DBG("opening %s custom baud %lu", uart_dev_name, baud_rate);

uart_fd = open(uart_dev_name, O_RDWR | O_CLOEXEC);
if (uart_fd < 0)
return -EIO;

uart_channel = g_io_channel_unix_new(uart_fd);
uart_channel = g_io_channel_unix_new(uart_fd);
g_io_channel_set_close_on_unref(uart_channel, TRUE);

g_io_channel_set_encoding(uart_channel, NULL, NULL);
Expand Down Expand Up @@ -463,7 +463,8 @@ static gboolean install_event(GIOChannel *channel,
}

/* Read the install value */
status = g_io_channel_read_chars(channel, (gchar *) buf, 8, &len, NULL);
status = g_io_channel_read_chars(channel, (gchar *) buf,
8, &len, NULL);
if (status != G_IO_STATUS_NORMAL) {
g_io_channel_shutdown(channel, TRUE, NULL);
g_io_channel_unref(channel);
Expand Down

0 comments on commit ad7abb5

Please sign in to comment.