From: Denis Kenzior <denkenz@gmail.com>
To: ofono@ofono.org
Subject: Re: [PATCH 1/3] gprs: Add DBus method to reset contexts
Date: Mon, 18 May 2015 09:09:22 -0500 [thread overview]
Message-ID: <5559F292.4000604@gmail.com> (raw)
In-Reply-To: <CACM4vuDtBm0T9fwftYino6RYz=+MAXEQSQJqg+JYnaNpoi5y=g@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1546 bytes --]
On 05/18/2015 01:53 AM, Alfonso Sanchez-Beato wrote:
> Hi Denis,
>
<snip>
> +
> + for (l = gprs->contexts; l; l = l->next) {
> + struct pri_context *ctx = l->data;
> +
> + if (ctx->pending)
> + return __ofono_error_busy(msg);
> + }
> +
> + if (!dbus_message_get_args(msg, NULL, DBUS_TYPE_INVALID))
> + return __ofono_error_invalid_args(msg);
> +
> + if (gprs->powered)
> + return __ofono_error_not_allowed(msg);
> +
> + for (l = gprs->contexts; l; l = l->next) {
> + struct pri_context *ctx = l->data;
> +
> + if (ctx->active)
> + return __ofono_error_not_allowed(msg);
>
>
> Is there a particular reason you're running through the list of
> contexts again here? Why not check for ctx->active at the same time
> as ctx->pending?
>
>
> I wanted to make sure that __ofono_error_busy was returned before
> __ofono_error_not_allowed if one context was busy and another one was
> active, for instance. Not that I feel is really important and I can
> change this if the other way is preferred.
>
Makes sense. However, since this is not obvious, we probably should add
a comment as to why this is being done. Want to submit a patch or do
you want me to do this?
Regards,
-Denis
next prev parent reply other threads:[~2015-05-18 14:09 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-14 16:39 [PATCH 0/3] Add method to force re-provisioning of contexts Alfonso Sanchez-Beato
2015-05-14 16:39 ` [PATCH 1/3] gprs: Add DBus method to reset contexts Alfonso Sanchez-Beato
2015-05-15 2:28 ` Denis Kenzior
2015-05-18 6:53 ` Alfonso Sanchez-Beato
2015-05-18 14:09 ` Denis Kenzior [this message]
2015-05-18 17:08 ` Alfonso Sanchez-Beato
2015-05-14 16:39 ` [PATCH 2/3] doc: Add description for ResetContexts method Alfonso Sanchez-Beato
2015-05-14 16:39 ` [PATCH 3/3] test: Add script for resetting contexts Alfonso Sanchez-Beato
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=5559F292.4000604@gmail.com \
--to=denkenz@gmail.com \
--cc=ofono@ofono.org \
/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