From: Krzysztof Halasa <khc@pm.waw.pl>
To: Stefan Richter <stefanr@s5r6.in-berlin.de>
Cc: "H. Peter Anvin" <hpa@zytor.com>,
Paolo Ciarrocchi <paolo.ciarrocchi@gmail.com>,
Ingo Molnar <mingo@elte.hu>,
Linux Kernel <linux-kernel@vger.kernel.org>,
tglx <tglx@linutronix.de>
Subject: Re: [PATCH 2/5] x86: Coding style fixes to arch/x86/kernel/bios_uv.c
Date: Sun, 03 Aug 2008 13:54:03 +0200 [thread overview]
Message-ID: <m3iquigvqc.fsf@maximus.localdomain> (raw)
In-Reply-To: <48958DC2.7070506@s5r6.in-berlin.de> (Stefan Richter's message of "Sun\, 03 Aug 2008 12\:51\:46 +0200")
Stefan Richter <stefanr@s5r6.in-berlin.de> writes:
>>> const char *str;
>>> switch (status) {
>>> - case 0: str = "Call completed without error"; break;
>>> - case -1: str = "Not implemented"; break;
>>> - case -2: str = "Invalid argument"; break;
>>> - case -3: str = "Call completed with error"; break;
>>> - default: str = "Unknown BIOS status code"; break;
>>> + case 0:
>>> + str = "Call completed without error";
>>> + break;
>>> + case -1:
>>> + str = "Not implemented";
>>> + break;
>>> + case -2:
>>> + str = "Invalid argument";
>>> + break;
>>> + case -3:
>>> + str = "Call completed with error";
>>> + break;
>>> + default:
>>> + str = "Unknown BIOS status code";
>>> + break;
>>> }
>>> return str;
>>> }
>>
>> This should be an array in the first place...
>
> Besides, by following CodingStyle to the letter, it arguably breaks
> rather than fixes coding style. The former code was easy enough to
> read.
Right. The latter is much worse. That's why nobody can trust
CodingStyle and/or checkpatch automatically. It's only sane mode
of operation is as a help tool for authors and maintainers, to
quickly locate _potential_ problems.
--
Krzysztof Halasa
next prev parent reply other threads:[~2008-08-03 11:54 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-08-02 19:24 Paolo Ciarrocchi
2008-08-03 4:01 ` H. Peter Anvin
2008-08-03 10:51 ` Stefan Richter
2008-08-03 11:54 ` Krzysztof Halasa [this message]
2008-08-03 12:21 ` Paolo Ciarrocchi
2008-08-05 2:15 ` H. Peter Anvin
2008-08-15 14:52 ` Ingo Molnar
2008-08-16 10:30 ` Paolo Ciarrocchi
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=m3iquigvqc.fsf@maximus.localdomain \
--to=khc@pm.waw.pl \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=paolo.ciarrocchi@gmail.com \
--cc=stefanr@s5r6.in-berlin.de \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
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
all inboxes | Powered by JetHome®