All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marcel Holtmann <marcel@holtmann.org>
To: ofono@ofono.org
Subject: RE: Patch on unsupported AT command
Date: Sat, 21 Nov 2009 11:41:33 +0100	[thread overview]
Message-ID: <1258800093.25879.37.camel@localhost.localdomain> (raw)
In-Reply-To: <38D9F46DFF92C54980D2F2C1E8EE313001B4CCBB20@pdsmsx503.ccr.corp.intel.com>

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

Hi Yang,

> >> >> >+	g_at_chat_add_terminator(chat, "+EXT ERROR:", 11, FALSE);
> >> >> >+	g_at_chat_add_terminator(chat, "+CME ERROR:", 11, FALSE);
> >> >> >+	g_at_chat_add_terminator(chat, "+CMS ERROR:", 11, FALSE);
> >> >> >+	g_at_chat_add_terminator(chat, "NO ANSWER", -1, FALSE);
> >> >> >+	g_at_chat_add_terminator(chat, "CONNECT", -1, TRUE);
> >> >> >+	g_at_chat_add_terminator(chat, "NO CARRIER", -1, FALSE);
> >> >> >+	g_at_chat_add_terminator(chat, "BUSY", -1, FALSE);
> >> >> >+	g_at_chat_add_terminator(chat, "NO DIALTONE", -1, FALSE);
> >> >> >+	g_at_chat_add_terminator(chat, "ERROR", -1, FALSE);
> >> >> >+	g_at_chat_add_terminator(chat, "OK", -1, TRUE);
> >> >>
> >> >> I really don't like this.  Lets keep the non-standard terminators in a
> >> >> separate list.  I don't want the vast majority of the drivers incurring the
> >> >> cost of multiple g_new/g_frees.
> >> >
> >> >I have to agree on this. We should keep the penalty for well behaving
> >> >cards as small as possible.
> >>
> >> Thank you for the comments. Modified patches are attached!
> >
> >please do casts with a space between. Like (char *) terminator etc. Also
> >why do you bother with making it const. Just leave that out. Since you
> >do actually copy the string anyway.
> 
> Fixed!

I don't like this casting at all actually. Please just store the
terminator as char and not const char. That is internal code anyway and
you do allocate it. So no need to mark it as read-only. Also please use
g_strdup since you are using g_free to free it.

+static gboolean meet_terminator(GAtChat *chat,
+                               struct terminator_info *info, char *line)

About this function name, I don't really like it since it confuses the
hell out of me what it is meant do be doing. I do get what you are
trying to do here, but I would just name it check_terminator and then
leave the g_at_chat_finish_command() call in the original code.

Regards

Marcel



  reply	other threads:[~2009-11-21 10:41 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-13  7:11 Patch on unsupported AT command Gu, Yang
2009-11-13 11:18 ` Marcel Holtmann
2009-11-13 16:38   ` Denis Kenzior
2009-11-13 16:58     ` Marcel Holtmann
2009-11-13 17:05       ` Denis Kenzior
2009-11-17  9:38         ` Gu, Yang
2009-11-17 10:40           ` Marcel Holtmann
2009-11-17 16:27             ` Gu, Yang
2009-11-17 17:56               ` Denis Kenzior
2009-11-17 20:35                 ` Marcel Holtmann
2009-11-20  9:02                   ` Gu, Yang
2009-11-20 13:30                     ` Marcel Holtmann
2009-11-21  5:54                       ` Gu, Yang
2009-11-21 10:41                         ` Marcel Holtmann [this message]
2009-11-23  2:41                           ` Gu, Yang
2009-11-23  6:21                             ` Marcel Holtmann
2009-11-23 10:54                               ` Denis Kenzior
2009-11-23 16:08                                 ` Marcel Holtmann
2009-11-24 16:01                               ` Gu, Yang
2009-11-24 17:07                                 ` Marcel Holtmann

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=1258800093.25879.37.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 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.