[PATCH] Fixed coding style issues at ieee80211_crypt_wep.c

Joe Perches joe at perches.com
Sat May 16 06:56:41 UTC 2015


On Sat, 2015-05-16 at 10:40 +0200, Pedro Marzo Perez wrote:
> This patch just fixes some warnings and style errors reported by checkpatch.pl script
>     - Braces should not start in a new line
>     - C99 comments are not allowed (never use //)
>     - Literal strings should never be parted in several lines
>     - There was a useless return on a void function

Some will say this is doing too many things in a single patch.

> diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_wep.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_wep.c
[]

> +		pr_debug("ieee80211_crypt_wep: could not allocate crypto API arc4\n");
[]
> +		pr_debug("ieee80211_crypt_wep: could not allocate crypto API arc4\n");

These could use a pr_fmt prefix and the "ieee80211_crypt_wep: "
could be removed.

In fact, these could be consolidated into a single line if
moved into the fail block if the first allocation does
a direct return NULL instead of goto fail.

> @@ -293,6 +288,5 @@ void __exit ieee80211_crypto_wep_exit(void)
>  
>  void ieee80211_wep_null(void)
>  {
> -//	printk("============>%s()\n", __func__);
> -	return;
> +    /*printk("============>%s()\n", __func__);*/

Just delete this instead.

>  }





More information about the devel mailing list