ConnMan network manager
 help / color / mirror / Atom feed
From: Denis Kenzior <denkenz@gmail.com>
To: connman@lists.linux.dev
Cc: Denis Kenzior <denkenz@gmail.com>
Subject: [PATCH v2 2/2] ofono: Don't invoke SetProperty unnecessarily
Date: Thu, 25 Jan 2024 16:28:48 -0600	[thread overview]
Message-ID: <20240125222858.640572-2-denkenz@gmail.com> (raw)
In-Reply-To: <20240125222858.640572-1-denkenz@gmail.com>

When org.ofono.Modem.Powered property changes, connman invokes the
SetProperty method again with the new value.  This is pointless and
only creates unnecessary DBus traffic.

connmand[30]: plugins/ofono.c:modem_set_powered() /phonesim powered 1
connmand[30]: plugins/ofono.c:set_property() /phonesim path /phonesim org.ofono.Modem.Powered
connmand[30]: plugins/ofono.c:set_property_reply() /phonesim path /phonesim org.ofono.Modem.Powered
connmand[30]: plugins/ofono.c:modem_changed() /phonesim Powered 1
connmand[30]: plugins/ofono.c:modem_set_powered() /phonesim powered 1
connmand[30]: plugins/ofono.c:set_property() /phonesim path /phonesim org.ofono.Modem.Powered
connmand[30]: plugins/ofono.c:set_property_reply() /phonesim path /phonesim org.ofono.Modem.Powered

Fixes: 054dacc71c6a ("ofono: Set "powered" property according to value")
---
 plugins/ofono.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/plugins/ofono.c b/plugins/ofono.c
index 9d0d44547a2c..65a722fd85d6 100644
--- a/plugins/ofono.c
+++ b/plugins/ofono.c
@@ -1969,12 +1969,11 @@ static gboolean modem_changed(DBusConnection *conn, DBusMessage *message,
 		dbus_bool_t powered;
 
 		dbus_message_iter_get_basic(&value, &powered);
+
 		modem->powered = powered;
+		modem->set_powered = powered;
 
 		DBG("%s Powered %d", modem->path, modem->powered);
-
-		/* Set the powered according to the value */
-		modem_set_powered(modem, powered);
 	} else if (g_str_equal(key, "Online")) {
 		dbus_bool_t online;
 
-- 
2.43.0


  reply	other threads:[~2024-01-25 22:29 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-25 22:28 [PATCH v2 1/2] ofono: Remove support for CDMA Denis Kenzior
2024-01-25 22:28 ` Denis Kenzior [this message]
2024-01-26 13:30 ` patchwork-bot+connman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240125222858.640572-2-denkenz@gmail.com \
    --to=denkenz@gmail.com \
    --cc=connman@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).