Subject: Re: [Suggestion] ISDN: isdnloop: C grammar issue, '}' miss match 'if' and 'switch' statement.

From: Chen Gang <[email-masked]>
Date: Thu, 04 Apr 2013 16:30:01 +0800

firstly, thank you very much for your details reply and your patch.

On 2013年04月03日 23:30, Linus Torvalds wrote:
> On Wed, Apr 3, 2013 at 7:31 AM, Eric Dumazet <[email-masked]> wrote:
>>
>> And what is the problem exactly ?
> 
> The indentation does look completely broken.
> 
> It should still *work*, because case-statements don't actually care
> about nesting (you can use a case statement to jump into other control
> statements, the traditional example is the so-called "duff's device"),
> but I agree with Chen Gang that it looks wrong.
> 

  ok, thanks.

> I'm attaching a patch that would appear to fix the nesting, but I
> haven't actually tested it. Also, regardless of that patch, the code
> looks like complete and utter crap, because it sets the "i" variable
> in many of the case statements, and then doesn't actually *use* it.
> Finally, almost all of the case statements test for something like
> 
>     if (c->arg < ISDNLOOP_BCH) {
> 
> but if "c->arg" is out of range, it will then just break out of the
> switch statement and return 0, even though it looks like it should be
> an error.
> 

  really, it is.

> Of course, nobody sane actually cares about ISDN any more, so I think
> this is all pretty academic. I think even Germany (where ISDN *used*
> to be very common due to telephone monopolies and odd rules) no longer
> uses it. I can't imagine that anybody else does either.
> 

  can we delete it ?

  it will not provide contributes any more, but can waste other members'
time resources.

> But if somebody does care, and can validate my patch (if not by
> actually using it, then by at least looking at it more), feel free to
> take it and take my sign-off.
> 
>      Linus
> 

  for me, I suggest:
    if we can not delete it, we'd better to apply Linus' patch.

-- 
Chen Gang

Asianux Corporation