Merge lp:~phablet-team/network-manager/ofono-format-cleanup into lp:~network-manager/network-manager/ubuntu

Proposed by Tony Espy on 2015-04-06
Status: Merged
Approved by: Ricardo Salveti on 2015-04-09
Approved revision: 959
Merged at revision: 957
Proposed branch: lp:~phablet-team/network-manager/ofono-format-cleanup
Merge into: lp:~network-manager/network-manager/ubuntu
Prerequisite: lp:~phablet-team/network-manager/ofono-rm-unused-code
Diff against target: 233 lines (+52/-56)
1 file modified
debian/patches/0001-wwan-add-support-for-using-oFono-as-a-modem-manager.patch (+52/-56)
To merge this branch: bzr merge lp:~phablet-team/network-manager/ofono-format-cleanup
Reviewer Review Type Date Requested Status
Mathieu Trudel-Lapierre Abstain on 2015-04-07
Ricardo Salveti 2015-04-06 Approve on 2015-04-07
Review via email: mp+255306@code.launchpad.net

Description of the Change

Cleanup code format and fix indentation ( ie. usage of tabs vs. spaces ).

To post a comment you must log in.
958. By Tony Espy on 2015-04-06

Remove unused nm-modem-ofono.c function: do_context_prepare()

959. By Tony Espy on 2015-04-06

Cleanup nm-modem-ofono.c formating and tabs/spaces.

Ricardo Salveti (rsalveti) wrote :

+1, no functional changes but it makes it easier to maintain and change the patch set as we go.

review: Approve
Mathieu Trudel-Lapierre (cyphermox) wrote :

Changeset is fine, but given that the code style isn't being in the way, I'd rather avoid making cosmetic changes two weeks away from Vivid release, even when bundled with bugfixes. I don't see why it couldn't wait two more weeks and land in the next release cycle.

Call me extra careful, but it's *very* late in the release so I'd defer the decision of landing this despite it being cosmetic changes to the release team. Could you please bring it up to them?

review: Abstain
Ricardo Salveti (rsalveti) wrote :

The thing about not waiting for two more extra weeks (for next release) is because we're still going to maintain this code base (vivid based) for RTM for a few months.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/patches/0001-wwan-add-support-for-using-oFono-as-a-modem-manager.patch'
2--- debian/patches/0001-wwan-add-support-for-using-oFono-as-a-modem-manager.patch 2015-04-06 22:20:31 +0000
3+++ debian/patches/0001-wwan-add-support-for-using-oFono-as-a-modem-manager.patch 2015-04-06 22:20:31 +0000
4@@ -304,7 +304,7 @@
5 ===================================================================
6 --- /dev/null
7 +++ network-manager-0.9.10.0/src/devices/wwan/nm-modem-ofono.c
8-@@ -0,0 +1,1144 @@
9+@@ -0,0 +1,1140 @@
10 +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
11 +/* NetworkManager -- Network link manager
12 + *
13@@ -376,37 +376,37 @@
14 +static GQuark
15 +nm_ofono_error_quark (void)
16 +{
17-+ static GQuark quark = 0;
18-+ if (!quark)
19-+ quark = g_quark_from_static_string ("nm-ofono-error");
20-+ return quark;
21++ static GQuark quark = 0;
22++ if (!quark)
23++ quark = g_quark_from_static_string ("nm-ofono-error");
24++ return quark;
25 +}
26 +
27 +static gboolean
28 +ip_string_to_network_address (const gchar *str,
29 + guint32 *out)
30 +{
31-+ struct in_addr addr;
32-+
33-+ /* IP address */
34-+ if (inet_pton (AF_INET, str, &addr) <= 0)
35-+ return FALSE;
36-+
37-+ *out = (guint32)addr.s_addr;
38-+ return TRUE;
39++ struct in_addr addr;
40++
41++ /* IP address */
42++ if (inet_pton (AF_INET, str, &addr) <= 0)
43++ return FALSE;
44++
45++ *out = (guint32)addr.s_addr;
46++ return TRUE;
47 +}
48 +
49 +/* Disconnect stuff */
50 +typedef struct {
51-+ NMModemOfono *self;
52-+ gboolean warn;
53++ NMModemOfono *self;
54++ gboolean warn;
55 +} SimpleDisconnectContext;
56 +
57 +static void
58 +simple_disconnect_context_free (SimpleDisconnectContext *ctx)
59 +{
60-+ g_object_unref (ctx->self);
61-+ g_slice_free (SimpleDisconnectContext, ctx);
62++ g_object_unref (ctx->self);
63++ g_slice_free (SimpleDisconnectContext, ctx);
64 +}
65 +
66 +static void
67@@ -427,7 +427,7 @@
68 + g_clear_error (&error);
69 + }
70 +
71-+ simple_disconnect_context_free (ctx);
72++ simple_disconnect_context_free (ctx);
73 +
74 + if (state != NM_MODEM_STATE_SEARCHING)
75 + nm_modem_set_state (NM_MODEM (self),
76@@ -440,14 +440,14 @@
77 + gboolean warn)
78 +{
79 + NMModemOfonoPrivate *priv = NM_MODEM_OFONO_GET_PRIVATE (self);
80-+ SimpleDisconnectContext *ctx;
81++ SimpleDisconnectContext *ctx;
82 + GValue value = G_VALUE_INIT;
83 +
84 + nm_log_dbg (LOGD_MB, "in %s", __func__);
85 +
86-+ ctx = g_slice_new (SimpleDisconnectContext);
87-+ ctx->self = g_object_ref (self);
88-+ ctx->warn = warn;
89++ ctx = g_slice_new (SimpleDisconnectContext);
90++ ctx->self = g_object_ref (self);
91++ ctx->warn = warn;
92 +
93 + g_value_init (&value, G_TYPE_BOOLEAN);
94 + g_value_set_boolean (&value, FALSE);
95@@ -582,8 +582,7 @@
96 +
97 + if (g_strcmp0 (key, "Powered") == 0 && G_VALUE_HOLDS_BOOLEAN (value)) {
98 + priv->gprs_powered = g_value_get_boolean (value);
99-+ }
100-+ else if (g_strcmp0 (key, "Attached") == 0 && G_VALUE_HOLDS_BOOLEAN (value)) {
101++ } else if (g_strcmp0 (key, "Attached") == 0 && G_VALUE_HOLDS_BOOLEAN (value)) {
102 + priv->gprs_attached = g_value_get_boolean (value);
103 + } else
104 + /* No need to update enabled for other property changes */
105@@ -724,8 +723,7 @@
106 + nm_modem_get_path (NM_MODEM (self)),
107 + OFONO_DBUS_INTERFACE_SIM_MANAGER);
108 + }
109-+ }
110-+ else {
111++ } else {
112 + if (priv->simmanager_proxy) {
113 + nm_log_info (LOGD_MB, "(%s): SimManager interface disappeared",
114 + nm_modem_get_path (NM_MODEM (self)));
115@@ -746,31 +744,30 @@
116 + get_ofono_conn_manager_properties (self);
117 +
118 + dbus_g_proxy_add_signal (priv->connman_proxy, "PropertyChanged",
119-+ G_TYPE_STRING, G_TYPE_VALUE,
120-+ G_TYPE_INVALID);
121++ G_TYPE_STRING, G_TYPE_VALUE,
122++ G_TYPE_INVALID);
123 + dbus_g_proxy_connect_signal (priv->connman_proxy, "PropertyChanged",
124-+ G_CALLBACK (ofono_conn_properties_changed),
125-+ self,
126-+ NULL);
127++ G_CALLBACK (ofono_conn_properties_changed),
128++ self,
129++ NULL);
130 +
131 + dbus_g_proxy_add_signal (priv->connman_proxy, "ContextAdded",
132-+ DBUS_TYPE_G_OBJECT_PATH, DBUS_TYPE_G_MAP_OF_VARIANT,
133-+ G_TYPE_INVALID);
134++ DBUS_TYPE_G_OBJECT_PATH, DBUS_TYPE_G_MAP_OF_VARIANT,
135++ G_TYPE_INVALID);
136 + dbus_g_proxy_connect_signal (priv->connman_proxy, "ContextAdded",
137-+ G_CALLBACK (ofono_context_added),
138-+ self,
139-+ NULL);
140++ G_CALLBACK (ofono_context_added),
141++ self,
142++ NULL);
143 + dbus_g_proxy_add_signal (priv->connman_proxy, "ContextRemoved",
144-+ DBUS_TYPE_G_OBJECT_PATH,
145-+ G_TYPE_INVALID);
146++ DBUS_TYPE_G_OBJECT_PATH,
147++ G_TYPE_INVALID);
148 + dbus_g_proxy_connect_signal (priv->connman_proxy, "ContextRemoved",
149-+ G_CALLBACK (ofono_context_removed),
150-+ self,
151-+ NULL);
152++ G_CALLBACK (ofono_context_removed),
153++ self,
154++ NULL);
155 + }
156 + }
157-+ }
158-+ else {
159++ } else {
160 + if (priv->connman_proxy) {
161 + nm_log_info (LOGD_MB, "(%s): ConnectionManager interface disappeared",
162 + nm_modem_get_path (NM_MODEM (self)));
163@@ -923,9 +920,9 @@
164 + dns = (char **) g_value_get_boxed (g_hash_table_lookup (ip_settings, "DomainNameServers"));
165 + for (i = 0; dns[i]; i++) {
166 + if ( ip_string_to_network_address (dns[i], &address_network)
167-+ && address_network > 0) {
168-+ nm_ip4_config_add_nameserver (priv->ip4_config, address_network);
169-+ nm_log_info (LOGD_MB, " DNS %s", dns[i]);
170++ && address_network > 0) {
171++ nm_ip4_config_add_nameserver (priv->ip4_config, address_network);
172++ nm_log_info (LOGD_MB, " DNS %s", dns[i]);
173 + }
174 + }
175 +
176@@ -1072,8 +1069,8 @@
177 + } else {
178 + nm_log_warn (LOGD_MB, "could not set context property '%s': %s", (char*)key,
179 + priv->property_error
180-+ && priv->property_error->message
181-+ ? priv->property_error->message : "(unknown)");
182++ && priv->property_error->message
183++ ? priv->property_error->message : "(unknown)");
184 + }
185 +}
186 +
187@@ -1316,7 +1313,7 @@
188 +
189 + nm_log_info (LOGD_MB, "(%s): trying to set modem to %s",
190 + nm_modem_get_path (self),
191-+ enabled ? "enabled" : "disabled");
192++ enabled ? "enabled" : "disabled");
193 +
194 + /*
195 + * FIXME: this is code is a no-op; we should either make
196@@ -1336,8 +1333,7 @@
197 + NMDeviceModemCapabilities *current_caps)
198 +{
199 + NMModemOfono *self = NM_MODEM_OFONO (_self);
200-+ NMDeviceModemCapabilities all_ofono_caps
201-+ = NM_DEVICE_MODEM_CAPABILITY_GSM_UMTS;
202++ NMDeviceModemCapabilities all_ofono_caps = NM_DEVICE_MODEM_CAPABILITY_GSM_UMTS;
203 +
204 + *modem_caps = all_ofono_caps;
205 + *current_caps = all_ofono_caps;
206@@ -1366,8 +1362,8 @@
207 +
208 +static GObject*
209 +constructor (GType type,
210-+ guint n_construct_params,
211-+ GObjectConstructParam *construct_params)
212++ guint n_construct_params,
213++ GObjectConstructParam *construct_params)
214 +{
215 + GObject *object;
216 + NMModemOfonoPrivate *priv;
217@@ -1440,13 +1436,13 @@
218 + object_class->constructor = constructor;
219 + object_class->dispose = dispose;
220 +
221-+ modem_class->get_capabilities = get_capabilities;
222++ modem_class->get_capabilities = get_capabilities;
223 + modem_class->set_mm_enabled = set_ofono_enabled;
224-+ modem_class->disconnect = disconnect;
225++ modem_class->disconnect = disconnect;
226 + modem_class->deactivate = deactivate;
227 + modem_class->check_connection_compatible = check_connection_compatible;
228 + modem_class->act_stage1_prepare = act_stage1_prepare;
229-+ modem_class->static_stage3_ip4_config_start = static_stage3_ip4_config_start;
230++ modem_class->static_stage3_ip4_config_start = static_stage3_ip4_config_start;
231 +}
232 +
233 Index: network-manager-0.9.10.0/src/devices/wwan/nm-modem-ofono.h

Subscribers

People subscribed via source and target branches