public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Chen Gang <gang.chen@asianux•com>
To: Jiri Kosina <jkosina@suse•cz>,
	isdn@linux-pingi•de, Jiri Slaby <jslaby@suse•cz>
Cc: Greg KH <gregkh@linuxfoundation•org>,
	Alan Cox <alan@lxorguk•ukuu.org.uk>,
	netdev <netdev@vger•kernel.org>
Subject: [Suggestion] drivers/isdn: about the loop after call isdn_tty_send_msg
Date: Wed, 27 Feb 2013 17:32:35 +0800	[thread overview]
Message-ID: <512DD2B3.2070404@asianux.com> (raw)

Hello Maintainers:

  do we need break out of the loop after call isdn_tty_send_msg ?
    p is not increased after finish calling isdn_tty_send_msg.
    and then will loop back to process the p again.

  do we intend to scan again the string which appended "+M..." ?

  we also assume "+M..." is a NUL terminated string, is it OK ? (it seems ok)


  thanks.

gchen.


in drivers/isdn/i4l/isdn_tty.c:


3408 static void
3409 isdn_tty_parse_at(modem_info *info)
3410 {
3411         atemu *m = &info->emu;
3412         char *p;
3413         char ds[ISDN_MSNLEN];
3414
3415 #ifdef ISDN_DEBUG_AT
3416         printk(KERN_DEBUG "AT: '%s'\n", m->mdmcmd);
3417 #endif
3418         for (p = &m->mdmcmd[2]; *p;) {
3419                 switch (*p) {
3420                 case ' ':
3421                         p++;
3422                         break;
...

3559                 case '+':
3560                         p++;
3561                         switch (*p) {
3562 #ifdef CONFIG_ISDN_AUDIO
3563                         case 'F':
3564                                 p++;
3565                                 if (isdn_tty_cmd_PLUSF(&p, info))
3566                                         return;
3567                                 break;
3568                         case 'V':
3569                                 if ((!(m->mdmreg[REG_SI1] & 1)) ||
3570                                     (m->mdmreg[REG_L2PROT] == ISDN_PROTO_L2_MODEM))
3571                                         PARSE_ERROR;
3572                                 p++;
3573                                 if (isdn_tty_cmd_PLUSV(&p, info))
3574                                         return;
3575                                 break;
3576 #endif                          /* CONFIG_ISDN_AUDIO */
3577                         case 'S':       /* SUSPEND */
3578                                 p++;
3579                                 isdn_tty_get_msnstr(ds, &p);
3580                                 isdn_tty_suspend(ds, info, m);
3581                                 break;
3582                         case 'R':       /* RESUME */
3583                                 p++;
3584                                 isdn_tty_get_msnstr(ds, &p);
3585                                 isdn_tty_resume(ds, info, m);
3586                                 break;
3587                         case 'M':       /* MESSAGE */
3588                                 p++;
3589                                 isdn_tty_send_msg(info, m, p);
3590                                 break;
3591                         default:
3592                                 PARSE_ERROR;
3593                         }
3594                         break;
3595                 case '&':
3596                         p++;
3597                         if (isdn_tty_cmd_ATand(&p, info))
3598                                 return;
3599                         break;
3600                 default:
3601                         PARSE_ERROR;
3602                 }
3603         }
3604 #ifdef CONFIG_ISDN_AUDIO
3605         if (!info->vonline)
3606 #endif
3607                 isdn_tty_modem_result(RESULT_OK, info);
3608 }

             reply	other threads:[~2013-02-27  9:32 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-27  9:32 Chen Gang [this message]
2013-02-27 10:00 ` [Suggestion] drivers/isdn: about the loop after call isdn_tty_send_msg Jiri Slaby
2013-02-27 10:08   ` Chen Gang
2013-02-28  2:57   ` [PATCH] drivers/isdn: break out of " Chen Gang
2013-02-28  9:54     ` Jiri Slaby
2013-03-15  2:02       ` Chen Gang
2013-03-20  5:03         ` Chen Gang
2013-03-25  3:27           ` Chen Gang
2013-03-29  1:56             ` Chen Gang

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=512DD2B3.2070404@asianux.com \
    --to=gang.chen@asianux$(echo .)com \
    --cc=alan@lxorguk$(echo .)ukuu.org.uk \
    --cc=gregkh@linuxfoundation$(echo .)org \
    --cc=isdn@linux-pingi$(echo .)de \
    --cc=jkosina@suse$(echo .)cz \
    --cc=jslaby@suse$(echo .)cz \
    --cc=netdev@vger$(echo .)kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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