All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jiri Slaby <jirislaby@gmail.com>
To: Pavel Machek <pavel@suse.cz>
Cc: kernel list <linux-kernel@vger.kernel.org>,
	linux-wireless@vger.kernel.org, ath5k-devel@lists.ath5k.org,
	linville@tuxdriver.com
Subject: Re: Small cleanups
Date: Wed, 25 Jun 2008 13:11:14 +0200	[thread overview]
Message-ID: <486227D2.6030801@gmail.com> (raw)
In-Reply-To: <20080625102553.GA2648@elf.ucw.cz>

Pavel Machek napsal(a):
> Small whitespace cleanups for wireless drivers
> 
> Signed-off-by: Pavel Machek <pavel@suse.cz>

The ath5k part
Acked-by: Jiri Slaby <jirislaby@gmail.com>

Thanks!

> diff --git a/drivers/net/wireless/airo.c b/drivers/net/wireless/airo.c
> index 32019fb..329be62 100644
> --- a/drivers/net/wireless/airo.c
> +++ b/drivers/net/wireless/airo.c
[...]
> @@ -5530,11 +5530,13 @@ static int airo_pci_suspend(struct pci_d
>  	Cmd cmd;
>  	Resp rsp;
>  
> -	if ((ai->APList == NULL) &&
> -		(ai->APList = kmalloc(sizeof(APListRid), GFP_KERNEL)) == NULL)
> +	if (!ai->APList)
> +		ai->APList = kmalloc(sizeof(APListRid), GFP_KERNEL);
> +	if (!ai->APList)
>  		return -ENOMEM;
> -	if ((ai->SSID == NULL) &&
> -		(ai->SSID = kmalloc(sizeof(SsidRid), GFP_KERNEL)) == NULL)
> +	if (!ai->SSID)
> +		ai->SSID = kmalloc(sizeof(SsidRid), GFP_KERNEL);
> +	if (!ai->SSID)
>  		return -ENOMEM;

Would you mind sending another patch which would fix the potential leak?

> @@ -5615,15 +5614,11 @@ #endif
>  		airo_entry->gid = proc_gid;
>  	}
>  
> -	for( i = 0; i < 4 && io[i] && irq[i]; i++ ) {
> +	for (i = 0; i < 4 && io[i] && irq[i]; i++) {
>  		airo_print_info("", "Trying to configure ISA adapter at irq=%d "
>  			"io=0x%x", irq[i], io[i] );
>  		if (init_airo_card( irq[i], io[i], 0, NULL ))
> -#if 0
> -			have_isa_dev = 1;
> -#else
>  			/* do nothing */ ;
> -#endif

Why not just remove the if?

>  	}
>  
>  #ifdef CONFIG_PCI


WARNING: multiple messages have this Message-ID (diff)
From: Jiri Slaby <jirislaby@gmail.com>
To: Pavel Machek <pavel@suse.cz>
Cc: kernel list <linux-kernel@vger.kernel.org>,
	linux-wireless@vger.kernel.org, ath5k-devel@venema.h4ckr.net,
	linville@tuxdriver.com
Subject: Re: Small cleanups
Date: Wed, 25 Jun 2008 13:11:14 +0200	[thread overview]
Message-ID: <486227D2.6030801@gmail.com> (raw)
In-Reply-To: <20080625102553.GA2648@elf.ucw.cz>

Pavel Machek napsal(a):
> Small whitespace cleanups for wireless drivers
> 
> Signed-off-by: Pavel Machek <pavel@suse.cz>

The ath5k part
Acked-by: Jiri Slaby <jirislaby@gmail.com>

Thanks!

> diff --git a/drivers/net/wireless/airo.c b/drivers/net/wireless/airo.c
> index 32019fb..329be62 100644
> --- a/drivers/net/wireless/airo.c
> +++ b/drivers/net/wireless/airo.c
[...]
> @@ -5530,11 +5530,13 @@ static int airo_pci_suspend(struct pci_d
>  	Cmd cmd;
>  	Resp rsp;
>  
> -	if ((ai->APList == NULL) &&
> -		(ai->APList = kmalloc(sizeof(APListRid), GFP_KERNEL)) == NULL)
> +	if (!ai->APList)
> +		ai->APList = kmalloc(sizeof(APListRid), GFP_KERNEL);
> +	if (!ai->APList)
>  		return -ENOMEM;
> -	if ((ai->SSID == NULL) &&
> -		(ai->SSID = kmalloc(sizeof(SsidRid), GFP_KERNEL)) == NULL)
> +	if (!ai->SSID)
> +		ai->SSID = kmalloc(sizeof(SsidRid), GFP_KERNEL);
> +	if (!ai->SSID)
>  		return -ENOMEM;

Would you mind sending another patch which would fix the potential leak?

> @@ -5615,15 +5614,11 @@ #endif
>  		airo_entry->gid = proc_gid;
>  	}
>  
> -	for( i = 0; i < 4 && io[i] && irq[i]; i++ ) {
> +	for (i = 0; i < 4 && io[i] && irq[i]; i++) {
>  		airo_print_info("", "Trying to configure ISA adapter at irq=%d "
>  			"io=0x%x", irq[i], io[i] );
>  		if (init_airo_card( irq[i], io[i], 0, NULL ))
> -#if 0
> -			have_isa_dev = 1;
> -#else
>  			/* do nothing */ ;
> -#endif

Why not just remove the if?

>  	}
>  
>  #ifdef CONFIG_PCI


  reply	other threads:[~2008-06-25 11:11 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-25 10:25 Small cleanups Pavel Machek
2008-06-25 10:25 ` Pavel Machek
2008-06-25 11:11 ` Jiri Slaby [this message]
2008-06-25 11:11   ` Jiri Slaby
2008-06-25 11:12   ` Jiri Slaby
2008-06-25 11:12     ` Jiri Slaby
  -- strict thread matches above, loose matches on Subject: below --
2008-02-04 21:00 small cleanups Pavel Machek

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=486227D2.6030801@gmail.com \
    --to=jirislaby@gmail.com \
    --cc=ath5k-devel@lists.ath5k.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=pavel@suse.cz \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.