netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [Suggestion] drivers/isdn: about the loop after call isdn_tty_send_msg
@ 2013-02-27  9:32 Chen Gang
  2013-02-27 10:00 ` Jiri Slaby
  0 siblings, 1 reply; 9+ messages in thread
From: Chen Gang @ 2013-02-27  9:32 UTC (permalink / raw)
  To: Jiri Kosina, isdn, Jiri Slaby; +Cc: Greg KH, Alan Cox, netdev

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 }

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2013-03-29  2:23 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-02-27  9:32 [Suggestion] drivers/isdn: about the loop after call isdn_tty_send_msg Chen Gang
2013-02-27 10:00 ` 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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).