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: <1492873234.30293.38.camel@perches.com>
Date:   Sat, 22 Apr 2017 08:00:34 -0700
From:   Joe Perches <joe@...ches.com>
To:     richard@...pro.work, gregkh@...uxfoundation.org
Cc:     linux-wireless@...r.kernel.org, devel@...verdev.osuosl.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] staging: wilc1000: Fixes Alignment should match open
 parenthesis

On Sat, 2017-04-22 at 07:28 +0100, richard@...pro.work wrote:
> This patch fixes the following checkpatch.pl
> check: CHECK: Alignment should match open parenthesis

Please strive for improved code for human readers and
not just shutting up checkpatch.

> diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c
[]
> @@ -870,12 +870,12 @@ static int wilc_mac_open(struct net_device *ndev)
>  				if (memcmp(wl->vif[i ^ 1]->bssid,
>  					   wl->vif[i ^ 1]->src_addr, 6))
>  					wilc_set_wfi_drv_handler(vif,
> -							 wilc_get_vif_idx(vif),
> -							 0);
> +					                         wilc_get_vif_idx(vif),
> +					                         0);
>  				else
>  					wilc_set_wfi_drv_handler(vif,
> -							 wilc_get_vif_idx(vif),
> -							 1);
> +					                         wilc_get_vif_idx(vif),
> +					                         1);

Depending on alignment, perhaps a good bit of this code
could use ether_addr_<foo> functions.

				wilc_set_wfi_drv_handler(vif, wilc_get_vif_idx(vif),
							 ether_addr_equals(wl->vif[i ^ 1]->bssid,
									   wl->vif[i ^ 1]->src_addr));

The code could also be restructured to reduce
indentation by using if / continue;

		if (ndev != wl->vif[i]->ndev)
			continue;

Using a temporary for the repeated use of
wilc_get_vif_idx(vif) would also help code length.

> diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
[]
> @@ -1301,16 +1301,16 @@ static int set_pmksa(struct wiphy *wiphy, struct net_device *netdev,
>  
>  	for (i = 0; i < priv->pmkid_list.numpmkid; i++)	{
>  		if (!memcmp(pmksa->bssid, priv->pmkid_list.pmkidlist[i].bssid,
> -				 ETH_ALEN)) {
> +		            ETH_ALEN)) {

		ether_addr_equals()

>  			flag = PMKID_FOUND;
>  			break;
>  		}
>  	}
>  	if (i < WILC_MAX_NUM_PMKIDS) {
>  		memcpy(priv->pmkid_list.pmkidlist[i].bssid, pmksa->bssid,
> -			    ETH_ALEN);
> +		       ETH_ALEN);

		ether_addr_copy()

etc.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ