* add a common exit function for interfaces when manager_free and manager_destroy function is called
@ 2009-06-02 7:02 Li, Minjun
0 siblings, 0 replies; 4+ messages in thread
From: Li, Minjun @ 2009-06-02 7:02 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 283 bytes --]
Hi Folks,
I regenerated the patch.
Because I found that manager_destroy function is lack of some exit function calls comparing to manager_free function, I add a common exit function for interfaces when manager_free and manager_destroy function is called.
Best Regards,
Minjun
[-- Attachment #2: attachment.html --]
[-- Type: text/html, Size: 2633 bytes --]
[-- Attachment #3: 0001-Adding-an-interface-exit-function-for-at-modem.patch --]
[-- Type: application/octet-stream, Size: 4185 bytes --]
From b2f3f7ec4e75a2e51462c2ef75a35c832bfbc27e Mon Sep 17 00:00:00 2001
From: Minjun Li <minjun.li@intel.com>
Date: Mon, 1 Jun 2009 14:57:32 +0800
Subject: [PATCH] Adding an interface exit function for at modem
---
drivers/atmodem/atmodem.c | 28 ++++++++++++++++------------
1 files changed, 16 insertions(+), 12 deletions(-)
mode change 100644 => 100755 drivers/Makefile.am
mode change 100644 => 100755 drivers/atmodem/at.h
mode change 100644 => 100755 drivers/atmodem/atmodem.c
mode change 100644 => 100755 drivers/atmodem/call-barring.c
mode change 100644 => 100755 drivers/atmodem/call-forwarding.c
mode change 100644 => 100755 drivers/atmodem/call-meter.c
mode change 100644 => 100755 drivers/atmodem/call-settings.c
mode change 100644 => 100755 drivers/atmodem/network-registration.c
mode change 100644 => 100755 drivers/atmodem/session.c
mode change 100644 => 100755 drivers/atmodem/session.h
mode change 100644 => 100755 drivers/atmodem/sim.c
mode change 100644 => 100755 drivers/atmodem/sms.c
mode change 100644 => 100755 drivers/atmodem/ussd.c
mode change 100644 => 100755 drivers/atmodem/voicecall.c
mode change 100644 => 100755 drivers/phonet/phonet.c
diff --git a/drivers/Makefile.am b/drivers/Makefile.am
old mode 100644
new mode 100755
diff --git a/drivers/atmodem/at.h b/drivers/atmodem/at.h
old mode 100644
new mode 100755
diff --git a/drivers/atmodem/atmodem.c b/drivers/atmodem/atmodem.c
old mode 100644
new mode 100755
index 2f1e430..78155be
--- a/drivers/atmodem/atmodem.c
+++ b/drivers/atmodem/atmodem.c
@@ -89,7 +89,20 @@ static void at_destroy(struct at_data *at)
g_free(at);
}
-
+static void interface_exit(struct at_data *at)
+{
+ if (at) {
+ at_sms_exit(at->modem);
+ at_call_forwarding_exit(at->modem);
+ at_call_settings_exit(at->modem);
+ at_network_registration_exit(at->modem);
+ at_voicecall_exit(at->modem);
+ at_call_meter_exit(at->modem);
+ at_call_barring_exit(at->modem);
+ at_ussd_exit(at->modem);
+ at_sim_exit(at->modem);
+ }
+}
static void manager_free(gpointer user)
{
GSList *l;
@@ -102,15 +115,7 @@ static void manager_free(gpointer user)
for (l = g_sessions; l; l = l->next) {
struct at_data *at = l->data;
- at_sms_exit(at->modem);
- at_call_forwarding_exit(at->modem);
- at_call_settings_exit(at->modem);
- at_network_registration_exit(at->modem);
- at_voicecall_exit(at->modem);
- at_call_meter_exit(at->modem);
- at_call_barring_exit(at->modem);
- at_ussd_exit(at->modem);
- at_sim_exit(at->modem);
+ interface_exit(at);
ofono_modem_unregister(at->modem);
at_destroy(at);
@@ -421,8 +426,7 @@ static DBusMessage *manager_destroy(DBusConnection *conn, DBusMessage *msg,
if (strcmp(at->modem->path, path))
continue;
- at_network_registration_exit(at->modem);
- at_voicecall_exit(at->modem);
+ interface_exit(at);
ofono_modem_unregister(at->modem);
g_sessions = g_slist_remove(g_sessions, at);
diff --git a/drivers/atmodem/call-barring.c b/drivers/atmodem/call-barring.c
old mode 100644
new mode 100755
diff --git a/drivers/atmodem/call-forwarding.c b/drivers/atmodem/call-forwarding.c
old mode 100644
new mode 100755
diff --git a/drivers/atmodem/call-meter.c b/drivers/atmodem/call-meter.c
old mode 100644
new mode 100755
diff --git a/drivers/atmodem/call-settings.c b/drivers/atmodem/call-settings.c
old mode 100644
new mode 100755
diff --git a/drivers/atmodem/network-registration.c b/drivers/atmodem/network-registration.c
old mode 100644
new mode 100755
diff --git a/drivers/atmodem/session.c b/drivers/atmodem/session.c
old mode 100644
new mode 100755
diff --git a/drivers/atmodem/session.h b/drivers/atmodem/session.h
old mode 100644
new mode 100755
diff --git a/drivers/atmodem/sim.c b/drivers/atmodem/sim.c
old mode 100644
new mode 100755
diff --git a/drivers/atmodem/sms.c b/drivers/atmodem/sms.c
old mode 100644
new mode 100755
diff --git a/drivers/atmodem/ussd.c b/drivers/atmodem/ussd.c
old mode 100644
new mode 100755
diff --git a/drivers/atmodem/voicecall.c b/drivers/atmodem/voicecall.c
old mode 100644
new mode 100755
diff --git a/drivers/phonet/phonet.c b/drivers/phonet/phonet.c
old mode 100644
new mode 100755
--
1.6.0.3
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: add a common exit function for interfaces when manager_free and manager_destroy function is called
2009-06-03 1:11 ` Li, Minjun
@ 2009-06-03 2:43 ` Denis Kenzior
0 siblings, 0 replies; 4+ messages in thread
From: Denis Kenzior @ 2009-06-03 2:43 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 265 bytes --]
Hi Minjun,
On Tuesday 02 June 2009 20:11:37 Li, Minjun wrote:
> I regenerated the patch again.
> Thank denis for good advice.
>
Applied (with a reworded commit description) and pushed upstream. Thanks.
> Best Regards,
>
> Minjun
Regards,
-Denis
^ permalink raw reply [flat|nested] 4+ messages in thread
* RE: add a common exit function for interfaces when manager_free and manager_destroy function is called
[not found] <200906021738.04488.denis.kenzior@intel.com>
@ 2009-06-03 1:11 ` Li, Minjun
2009-06-03 2:43 ` Denis Kenzior
0 siblings, 1 reply; 4+ messages in thread
From: Li, Minjun @ 2009-06-03 1:11 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 979 bytes --]
I regenerated the patch again.
Thank denis for good advice.
Best Regards,
Minjun
-----Original Message-----
From: Kenzior, Denis
Sent: 2009年6月3日 6:38
To: ofono(a)ofono.org
Cc: Li, Minjun
Subject: Re: add a common exit function for interfaces when manager_free and manager_destroy function is called
Hi Minjun,
On Tuesday 02 June 2009 02:02:29 Li, Minjun wrote:
> Hi Folks,
> I regenerated the patch.
> Because I found that manager_destroy function is lack of some exit function
> calls comparing to manager_free function, I add a common exit function for
> interfaces when manager_free and manager_destroy function is called.
>
In interface_exit: Please remove if (at) block, its pointless.
Please get rid of all mode changes, only submit changes to files that are
relevant to the fix.
Get a proper commit message. E.g. put the description in the email into the
commit message.
> Best Regards,
> Minjun
Regards,
-Denis
[-- Attachment #2: 0001-Adding-a-common-exit-function-for-interfaces-when-ma.patch --]
[-- Type: application/octet-stream, Size: 2008 bytes --]
From 96939e631f526a2c89cdb95cf5b8e6360ecbd7d3 Mon Sep 17 00:00:00 2001
From: Minjun Li <minjun.li@intel.com>
Date: Tue, 2 Jun 2009 08:50:35 +0800
Subject: [PATCH] Adding a common exit function for interfaces when manager_free
and manager_destroy function is called because manager_destroy
function is lack of some exit function calls comparing to
manager_free
---
drivers/atmodem/atmodem.c | 26 +++++++++++++++-----------
1 files changed, 15 insertions(+), 11 deletions(-)
diff --git a/drivers/atmodem/atmodem.c b/drivers/atmodem/atmodem.c
index 2f1e430..20b95a5 100644
--- a/drivers/atmodem/atmodem.c
+++ b/drivers/atmodem/atmodem.c
@@ -90,6 +90,19 @@ static void at_destroy(struct at_data *at)
g_free(at);
}
+static void interface_exit(struct at_data *at)
+{
+ at_sms_exit(at->modem);
+ at_call_forwarding_exit(at->modem);
+ at_call_settings_exit(at->modem);
+ at_network_registration_exit(at->modem);
+ at_voicecall_exit(at->modem);
+ at_call_meter_exit(at->modem);
+ at_call_barring_exit(at->modem);
+ at_ussd_exit(at->modem);
+ at_sim_exit(at->modem);
+}
+
static void manager_free(gpointer user)
{
GSList *l;
@@ -102,15 +115,7 @@ static void manager_free(gpointer user)
for (l = g_sessions; l; l = l->next) {
struct at_data *at = l->data;
- at_sms_exit(at->modem);
- at_call_forwarding_exit(at->modem);
- at_call_settings_exit(at->modem);
- at_network_registration_exit(at->modem);
- at_voicecall_exit(at->modem);
- at_call_meter_exit(at->modem);
- at_call_barring_exit(at->modem);
- at_ussd_exit(at->modem);
- at_sim_exit(at->modem);
+ interface_exit(at);
ofono_modem_unregister(at->modem);
at_destroy(at);
@@ -421,8 +426,7 @@ static DBusMessage *manager_destroy(DBusConnection *conn, DBusMessage *msg,
if (strcmp(at->modem->path, path))
continue;
- at_network_registration_exit(at->modem);
- at_voicecall_exit(at->modem);
+ interface_exit(at);
ofono_modem_unregister(at->modem);
g_sessions = g_slist_remove(g_sessions, at);
--
1.6.0.3
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: add a common exit function for interfaces when manager_free and manager_destroy function is called
@ 2009-06-02 22:39 Denis Kenzior
0 siblings, 0 replies; 4+ messages in thread
From: Denis Kenzior @ 2009-06-02 22:39 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 659 bytes --]
Hi Minjun,
On Tuesday 02 June 2009 02:02:29 Li, Minjun wrote:
> Hi Folks,
> I regenerated the patch.
> Because I found that manager_destroy function is lack of some exit function
> calls comparing to manager_free function, I add a common exit function for
> interfaces when manager_free and manager_destroy function is called.
>
In interface_exit: Please remove if (at) block, its pointless.
Please get rid of all mode changes, only submit changes to files that are
relevant to the fix.
Get a proper commit message. E.g. put the description in the email into the
commit message.
> Best Regards,
> Minjun
Regards,
-Denis
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2009-06-03 2:43 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-06-02 7:02 add a common exit function for interfaces when manager_free and manager_destroy function is called Li, Minjun
2009-06-02 22:39 Denis Kenzior
[not found] <200906021738.04488.denis.kenzior@intel.com>
2009-06-03 1:11 ` Li, Minjun
2009-06-03 2:43 ` Denis Kenzior
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.