Open Source Telephony
 help / color / mirror / Atom feed
From: Kalle Valo <kalle.valo@canonical.com>
To: ofono@ofono.org
Subject: Re: [PATCH v3 1/2] huawei: detect SecondaryDevice which is used for events
Date: Thu, 20 May 2010 10:15:51 +0300	[thread overview]
Message-ID: <87sk5nnivs.fsf@potku.valot.fi> (raw)
In-Reply-To: <201005190840.59307.denkenz@gmail.com>

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

Denis Kenzior <denkenz@gmail.com> writes:

> Hi Kalle,

Hi Denis,

> Please keep the commit header to less than 50 lines.

Fixed.

>> +	device = ofono_modem_get_string(modem, "SecondaryDevice");
>> +	if (!device)
>> +		return -EINVAL;
>
> Two tabs is enough here.

Sorry, but I see only two tabs here. What am I missing? Ah, now I
understand. I think you are commenting the line earlier in
huawei_enable() which is indented wrong. I'll fix that.

>> +	channel = g_at_tty_open(device, NULL);
>> +	if (!channel)
>> +		return -EIO;
>> +
>> +	syntax = g_at_syntax_new_gsm_permissive();
>> +	data->event = g_at_chat_new(channel, syntax);
>> +	g_at_syntax_unref(syntax);
>> +	g_io_channel_unref(channel);
>> +
>> +	if (!data->event)
>> +		return -EIO;
>> +
>> +	g_at_chat_add_terminator(data->event, "COMMAND NOT SUPPORT", -1,
>> +				 FALSE);
>
> Don't mix spaces and tabs for indentation

Fixed.

>> +
>> +	if (getenv("OFONO_AT_DEBUG"))
>> +		g_at_chat_set_debug(data->event, huawei_event_debug, NULL);
>> +
>> +
>
> Why the extra space?

You mean the newline, right? That's by accident, I removed it now.

> Also, this entire sequence leaks the data->chat in case the 2nd port
> could not be opened. See plugins/mbm.c for an example on how to do
> this better.

Damn, so it does. I changed it now to follow the style from mbm.c.

Thanks a lot for the comments.

-- 
Kalle Valo

  reply	other threads:[~2010-05-20  7:15 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-19 14:06 [PATCH v3 0/2] Huawei GPRS support Kalle Valo
2010-05-19 14:06 ` [PATCH v3 1/2] huawei: detect SecondaryDevice which is used for events Kalle Valo
2010-05-19 13:40   ` Denis Kenzior
2010-05-20  7:15     ` Kalle Valo [this message]
2010-05-19 14:06 ` [PATCH v3 2/2] huawei: add gprs context Kalle Valo
2010-05-19 13:44   ` Denis Kenzior
2010-05-20  7:35     ` Kalle Valo
2010-08-04 19:59       ` Inaky Perez-Gonzalez
2010-08-05  5:54         ` Kalle Valo
2010-08-05 17:29           ` Inaky Perez-Gonzalez
2010-08-06  7:26             ` Kalle Valo
2010-08-11  4:56               ` Inaky Perez-Gonzalez

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=87sk5nnivs.fsf@potku.valot.fi \
    --to=kalle.valo@canonical.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