Re: [git-pull -tip] x86: cleanup non-code changing
From: Thomas Gleixner
Date: Tue Mar 17 2009 - 09:45:03 EST
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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/