From: Chen Gang <gang.chen@asianux•com>
To: Linus Torvalds <torvalds@linux-foundation•org>
Cc: Eric Dumazet <eric.dumazet@gmail•com>,
Michal Kubecek <mkubecek@suse•cz>,
Wu Fengguang <fengguang.wu@intel•com>,
Karsten Keil <isdn@linux-pingi•de>,
David Miller <davem@davemloft•net>,
netdev <netdev@vger•kernel.org>, Joe Perches <joe@perches•com>
Subject: Re: [Suggestion] ISDN: isdnloop: C grammar issue, '}' miss match 'if' and 'switch' statement.
Date: Thu, 04 Apr 2013 16:30:01 +0800 [thread overview]
Message-ID: <515D3A09.7040202@asianux.com> (raw)
In-Reply-To: <CA+55aFw+Efs+um15_V6t-9rXd-U1VJS9p+_6E-m5jr87h-BPVg@mail.gmail.com>
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@gmail•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
next prev parent reply other threads:[~2013-04-04 8:30 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-03 13:35 [Suggestion] ISDN: isdnloop: C grammar issue, '}' miss match 'if' and 'switch' statement Chen Gang
2013-04-03 14:08 ` Michal Kubecek
2013-04-03 14:31 ` Eric Dumazet
2013-04-03 15:08 ` Michal Kubecek
2013-04-03 15:30 ` Linus Torvalds
2013-04-04 8:30 ` Chen Gang [this message]
2013-04-04 18:09 ` David Miller
2013-04-05 3:00 ` Joe Perches
2013-04-05 6:13 ` Chen Gang
2013-04-05 20:37 ` Dan Williams
2013-04-06 4:56 ` Chen Gang
2013-04-05 6:09 ` Chen Gang
2013-04-04 9:05 ` Chen Gang
2013-04-04 14:42 ` Joe Perches
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=515D3A09.7040202@asianux.com \
--to=gang.chen@asianux$(echo .)com \
--cc=davem@davemloft$(echo .)net \
--cc=eric.dumazet@gmail$(echo .)com \
--cc=fengguang.wu@intel$(echo .)com \
--cc=isdn@linux-pingi$(echo .)de \
--cc=joe@perches$(echo .)com \
--cc=mkubecek@suse$(echo .)cz \
--cc=netdev@vger$(echo .)kernel.org \
--cc=torvalds@linux-foundation$(echo .)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