lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <alpine.LFD.2.00.0903171425250.29264@localhost.localdomain>
Date:	Tue, 17 Mar 2009 14:43:41 +0100 (CET)
From:	Thomas Gleixner <tglx@...utronix.de>
To:	Jaswinder Singh Rajput <jaswinder@...nel.org>
cc:	Ingo Molnar <mingo@...e.hu>, x86 maintainers <x86@...nel.org>,
	LKML <linux-kernel@...r.kernel.org>
Subject: Re: [git-pull -tip] x86: cleanup non-code changing

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@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ