[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Thu, 04 Apr 2013 16:30:01 +0800
From: Chen Gang <gang.chen@...anux.com>
To: Linus Torvalds <torvalds@...ux-foundation.org>
CC: Eric Dumazet <eric.dumazet@...il.com>,
Michal Kubecek <mkubecek@...e.cz>,
Wu Fengguang <fengguang.wu@...el.com>,
Karsten Keil <isdn@...ux-pingi.de>,
David Miller <davem@...emloft.net>,
netdev <netdev@...r.kernel.org>, Joe Perches <joe@...ches.com>
Subject: Re: [Suggestion] ISDN: isdnloop: C grammar issue, '}' miss match
'if' and 'switch' statement.
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 <eric.dumazet@...il.com> 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
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists