From: Thomas Gleixner <tglx@linutronix.de>
To: Jaswinder Singh Rajput <jaswinder@kernel.org>
Cc: Ingo Molnar <mingo@elte.hu>, x86 maintainers <x86@kernel.org>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [git-pull -tip] x86: cleanup non-code changing
Date: Tue, 17 Mar 2009 14:43:41 +0100 (CET) [thread overview]
Message-ID: <alpine.LFD.2.00.0903171425250.29264@localhost.localdomain> (raw)
In-Reply-To: <1237290417.10142.4.camel@ht.satnam>
On Tue, 17 Mar 2009, Jaswinder Singh Rajput wrote:
> --- a/arch/x86/kernel/kdebugfs.c
> +++ b/arch/x86/kernel/kdebugfs.c
> static int __init
> @@ -84,24 +85,20 @@ create_setup_data_node(struct dentry *parent, int no,
> {
> struct dentry *d, *type, *data;
> char buf[16];
> - int error;
>
> sprintf(buf, "%d", no);
> d = debugfs_create_dir(buf, parent);
> - if (!d) {
> - error = -ENOMEM;
> + if (!d)
> goto err_return;
Sigh. return -ENOMEM; perhaps ????
> static int __init create_setup_data_nodes(struct dentry *parent)
> {
> struct setup_data_node *node;
> struct setup_data *data;
> - int error, no = 0;
> + int error = 0, no = 0;
> struct dentry *d;
> struct page *pg;
> u64 pa_data;
>
> d = debugfs_create_dir("setup_data", parent);
> - if (!d) {
> - error = -ENOMEM;
> + if (!d)
> goto err_return;
Yuck. This is the most stupid change I have seen so far.
error = 0;
goto err_return;
err_return:
if (!error)
error = -ENOMEM;
return error;
WTF can't you just initialize error with -ENOMEM ?
> @@ -175,28 +171,26 @@ static struct debugfs_blob_wrapper boot_params_blob = {
> static int __init boot_params_kdebugfs_init(void)
> {
> struct dentry *dbp, *version, *data;
> - int error;
> + int error = 0;
>
> dbp = debugfs_create_dir("boot_params", NULL);
> - if (!dbp) {
> - error = -ENOMEM;
> + if (!dbp)
> goto err_return;
...
> err_return:
> + if (!error)
> + error = -ENOMEM;
> return error;
> }
At least it is conistently stupid.
> static int
> @@ -20,8 +20,10 @@ check_addr(char *name, struct device *hwdev, dma_addr_t bus, size_t size)
> "nommu_%s: overflow %Lx+%zu of device mask %Lx\n",
> name, (long long)bus, size,
> (long long)*hwdev->dma_mask);
> +
> return 0;
> }
> +
> return 1;
> }
What's the exact point of these newlines ? The code is perfectly
readable except for the weird formatted printk which you ignored.
This newlines business just has the effect that I have less code on
one screen than before.
Can we please stop this time waste and take care of real problems ?
Thanks,
tglx
prev parent reply other threads:[~2009-03-17 13:45 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-17 11:46 Jaswinder Singh Rajput
2009-03-17 13:43 ` Thomas Gleixner [this message]
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=alpine.LFD.2.00.0903171425250.29264@localhost.localdomain \
--to=tglx@linutronix.de \
--cc=jaswinder@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=x86@kernel.org \
/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®