Open Source Telephony
 help / color / mirror / Atom feed
From: Marcel Holtmann <marcel@holtmann.org>
To: ofono@ofono.org
Subject: Re: [PATCH 5/5] Implement STATUS polling in atmodem driver, enable it for phonesim & atgen.
Date: Wed, 31 Mar 2010 11:42:23 -0700	[thread overview]
Message-ID: <1270060943.22331.4.camel@localhost.localdomain> (raw)
In-Reply-To: <1270011519-6947-1-git-send-email-andrew.zaborowski@intel.com>

[-- Attachment #1: Type: text/plain, Size: 659 bytes --]

Hi Andrzej,

> +
> +	if (!g_at_result_iter_next_hexstring(&iter, &response, &len))
> +		return;
> +
> +	if (rlen != len * 2 || len < 2 || (response[len - 2] != 0x90 &&
> +				response[len - 2] != 0x91) ||
> +			(response[len - 2] == 0x90 && response[len - 1] != 0))
> +		return;
> +

let me re-write this into something readable ;)

	if (len < 2 || rlen != len * 2)
		return;

	if (response[len - 2] != 0x90 || response[len - 2] != 0x91)
		return;

	if (response[len - 2] == 0x90 && response[len - 1] != 0)
		return;

And please add comments on top of the if statements to explain what they
are checking for.

Regards

Marcel



      reply	other threads:[~2010-03-31 18:42 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-31  4:58 [PATCH 5/5] Implement STATUS polling in atmodem driver, enable it for phonesim & atgen Andrzej Zaborowski
2010-03-31 18:42 ` Marcel Holtmann [this message]

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=1270060943.22331.4.camel@localhost.localdomain \
    --to=marcel@holtmann.org \
    --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