All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/12] staging: ks7010: fix checkpatch ks_wlan_net.c
@ 2017-03-13 22:53 Tobin C. Harding
  2017-03-13 22:53 ` [PATCH 01/12] staging: ks7010: fix checkpatch SPACING Tobin C. Harding
                   ` (11 more replies)
  0 siblings, 12 replies; 27+ messages in thread
From: Tobin C. Harding @ 2017-03-13 22:53 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: driverdev-devel, Wolfram Sang

Checkpatch emits various checks, warnings, and errors when parsing
ks_wlan_net.c.

Patch 01 fixes spacing issues.

Patch 02 converts block comments to use networking style block
comments.

Patch 03 converts function comments to use kernel doc format.

Patch 04 moves logical operators to the end of the previous line.

Patch 05 removes commented out code (dead code).

Patch 06 removes multiple assignment on single line.

Patch 07 moves comparison constant to the right hand side.

Patch 08 removes unnecessary else statements.

Patch 09 removes unnecessary cast from kmalloc() call.

Patch 10 replaces single byte memset with assignment.

Patch 11 reduces the level of indentation multiple times.

This patch is the meat of the patch set. I was not able to easily
visually parse the diff, admittedly I do not have a maintainers skill
at this but if there is an easier way to split this patch up I'm happy
to re-work it. First I tried reducing one level of indentation per
patch but then found there was no easy way to uniquely describe each
patch.

Patch breaks out of case block in multiple places - is
this ok? The result of this patch is less indentation, enhanced
readability, and most importantly opens up the way to refactoring that
fixes multiple types and instances of checkpatch warnings.

Multiple break statements are intermingled, breaking out of loops and
case blocks. For this reason a comment string was added to each
'break' in similar fashion to that used on #endif preprocessor
directives.

Patch 12 does whitespace refactor taking advantage of changes made in
the previous patch.

Code has not been tested. Series has been run through checkpatch
--strict, Smatch, and Sparse and does not introduce any new
errors. Each patch in series has been applied and built on x86_64 and
PowerPC. 

Tobin C. Harding (12):
  staging: ks7010: fix checkpatch SPACING
  staging: ks7010: fix checkpatch BLOCK_COMMENT_STYLE
  staging: ks7010: convert comments to kernel doc format
  staging: ks7010: fix logical line continuation
  staging: ks7010: remove dead code
  staging: ks7010: remove multiple assignment
  staging: ks7010: move comparison to right hand side
  staging: ks7010: remove unnecessary else statement
  staging: ks7010: remove unnecessary cast
  staging: ks7010: fix checkpatch memset warning
  staging: ks7010: reduce level of indentation
  staging: ks7010: refactor, whitespace only

 drivers/staging/ks7010/ks_wlan_net.c | 1040 +++++++++++++++++++++-------------
 1 file changed, 640 insertions(+), 400 deletions(-)

-- 
2.7.4

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

^ permalink raw reply	[flat|nested] 27+ messages in thread

* [PATCH 01/12] staging: ks7010: fix checkpatch SPACING
  2017-03-13 22:53 [PATCH 00/12] staging: ks7010: fix checkpatch ks_wlan_net.c Tobin C. Harding
@ 2017-03-13 22:53 ` Tobin C. Harding
  2017-03-13 22:54 ` [PATCH 02/12] staging: ks7010: fix checkpatch BLOCK_COMMENT_STYLE Tobin C. Harding
                   ` (10 subsequent siblings)
  11 siblings, 0 replies; 27+ messages in thread
From: Tobin C. Harding @ 2017-03-13 22:53 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: driverdev-devel, Wolfram Sang

Checkpatch emits over 100 instances of CHECK: No space is necessary
after a cast.

Remove unnecessary space.

Signed-off-by: Tobin C. Harding <me@tobin.cc>
---
 drivers/staging/ks7010/ks_wlan_net.c | 212 +++++++++++++++++------------------
 1 file changed, 106 insertions(+), 106 deletions(-)

diff --git a/drivers/staging/ks7010/ks_wlan_net.c b/drivers/staging/ks7010/ks_wlan_net.c
index 2b4d6c1..75e42a7 100644
--- a/drivers/staging/ks7010/ks_wlan_net.c
+++ b/drivers/staging/ks7010/ks_wlan_net.c
@@ -238,7 +238,7 @@ static int ks_wlan_set_freq(struct net_device *dev,
 			rc = -EINVAL;
 		} else {
 			/* Yes ! We can set it !!! */
-			priv->reg.channel = (u8) (channel);
+			priv->reg.channel = (u8)(channel);
 			priv->need_commit |= SME_MODE_SET;
 		}
 	}
@@ -493,12 +493,12 @@ static int ks_wlan_set_rate(struct net_device *dev,
 			case 11000000:
 			case 5500000:
 				priv->reg.rate_set.body[0] =
-				    (uint8_t) (vwrq->value / 500000);
+				    (uint8_t)(vwrq->value / 500000);
 				break;
 			case 2000000:
 			case 1000000:
 				priv->reg.rate_set.body[0] =
-				    ((uint8_t) (vwrq->value / 500000)) |
+				    ((uint8_t)(vwrq->value / 500000)) |
 				    BASIC_RATE;
 				break;
 			default:
@@ -550,7 +550,7 @@ static int ks_wlan_set_rate(struct net_device *dev,
 			case 18000000:
 			case 9000000:
 				priv->reg.rate_set.body[0] =
-				    (uint8_t) (vwrq->value / 500000);
+				    (uint8_t)(vwrq->value / 500000);
 				break;
 			case 24000000:
 			case 12000000:
@@ -560,7 +560,7 @@ static int ks_wlan_set_rate(struct net_device *dev,
 			case 2000000:
 			case 1000000:
 				priv->reg.rate_set.body[0] =
-				    ((uint8_t) (vwrq->value / 500000)) |
+				    ((uint8_t)(vwrq->value / 500000)) |
 				    BASIC_RATE;
 				break;
 			default:
@@ -3127,119 +3127,119 @@ static const struct iw_priv_args ks_wlan_private_args[] = {
 };
 
 static const iw_handler ks_wlan_handler[] = {
-	(iw_handler) ks_wlan_config_commit,	/* SIOCSIWCOMMIT */
-	(iw_handler) ks_wlan_get_name,	/* SIOCGIWNAME */
-	(iw_handler) NULL,	/* SIOCSIWNWID */
-	(iw_handler) NULL,	/* SIOCGIWNWID */
-	(iw_handler) ks_wlan_set_freq,	/* SIOCSIWFREQ */
-	(iw_handler) ks_wlan_get_freq,	/* SIOCGIWFREQ */
-	(iw_handler) ks_wlan_set_mode,	/* SIOCSIWMODE */
-	(iw_handler) ks_wlan_get_mode,	/* SIOCGIWMODE */
+	(iw_handler)ks_wlan_config_commit,	/* SIOCSIWCOMMIT */
+	(iw_handler)ks_wlan_get_name,	/* SIOCGIWNAME */
+	(iw_handler)NULL,	/* SIOCSIWNWID */
+	(iw_handler)NULL,	/* SIOCGIWNWID */
+	(iw_handler)ks_wlan_set_freq,	/* SIOCSIWFREQ */
+	(iw_handler)ks_wlan_get_freq,	/* SIOCGIWFREQ */
+	(iw_handler)ks_wlan_set_mode,	/* SIOCSIWMODE */
+	(iw_handler)ks_wlan_get_mode,	/* SIOCGIWMODE */
 #ifndef KSC_OPNOTSUPP
-	(iw_handler) ks_wlan_set_sens,	/* SIOCSIWSENS */
-	(iw_handler) ks_wlan_get_sens,	/* SIOCGIWSENS */
+	(iw_handler)ks_wlan_set_sens,	/* SIOCSIWSENS */
+	(iw_handler)ks_wlan_get_sens,	/* SIOCGIWSENS */
 #else /* KSC_OPNOTSUPP */
-	(iw_handler) NULL,	/* SIOCSIWSENS */
-	(iw_handler) NULL,	/* SIOCGIWSENS */
+	(iw_handler)NULL,	/* SIOCSIWSENS */
+	(iw_handler)NULL,	/* SIOCGIWSENS */
 #endif /* KSC_OPNOTSUPP */
-	(iw_handler) NULL,	/* SIOCSIWRANGE */
-	(iw_handler) ks_wlan_get_range,	/* SIOCGIWRANGE */
-	(iw_handler) NULL,	/* SIOCSIWPRIV */
-	(iw_handler) NULL,	/* SIOCGIWPRIV */
-	(iw_handler) NULL,	/* SIOCSIWSTATS */
-	(iw_handler) ks_wlan_get_iwstats,	/* SIOCGIWSTATS */
-	(iw_handler) NULL,	/* SIOCSIWSPY */
-	(iw_handler) NULL,	/* SIOCGIWSPY */
-	(iw_handler) NULL,	/* SIOCSIWTHRSPY */
-	(iw_handler) NULL,	/* SIOCGIWTHRSPY */
-	(iw_handler) ks_wlan_set_wap,	/* SIOCSIWAP */
-	(iw_handler) ks_wlan_get_wap,	/* SIOCGIWAP */
-//      (iw_handler) NULL,                      /* SIOCSIWMLME */
-	(iw_handler) ks_wlan_set_mlme,	/* SIOCSIWMLME */
-	(iw_handler) ks_wlan_get_aplist,	/* SIOCGIWAPLIST */
-	(iw_handler) ks_wlan_set_scan,	/* SIOCSIWSCAN */
-	(iw_handler) ks_wlan_get_scan,	/* SIOCGIWSCAN */
-	(iw_handler) ks_wlan_set_essid,	/* SIOCSIWESSID */
-	(iw_handler) ks_wlan_get_essid,	/* SIOCGIWESSID */
-	(iw_handler) ks_wlan_set_nick,	/* SIOCSIWNICKN */
-	(iw_handler) ks_wlan_get_nick,	/* SIOCGIWNICKN */
-	(iw_handler) NULL,	/* -- hole -- */
-	(iw_handler) NULL,	/* -- hole -- */
-	(iw_handler) ks_wlan_set_rate,	/* SIOCSIWRATE */
-	(iw_handler) ks_wlan_get_rate,	/* SIOCGIWRATE */
-	(iw_handler) ks_wlan_set_rts,	/* SIOCSIWRTS */
-	(iw_handler) ks_wlan_get_rts,	/* SIOCGIWRTS */
-	(iw_handler) ks_wlan_set_frag,	/* SIOCSIWFRAG */
-	(iw_handler) ks_wlan_get_frag,	/* SIOCGIWFRAG */
+	(iw_handler)NULL,	/* SIOCSIWRANGE */
+	(iw_handler)ks_wlan_get_range,	/* SIOCGIWRANGE */
+	(iw_handler)NULL,	/* SIOCSIWPRIV */
+	(iw_handler)NULL,	/* SIOCGIWPRIV */
+	(iw_handler)NULL,	/* SIOCSIWSTATS */
+	(iw_handler)ks_wlan_get_iwstats,	/* SIOCGIWSTATS */
+	(iw_handler)NULL,	/* SIOCSIWSPY */
+	(iw_handler)NULL,	/* SIOCGIWSPY */
+	(iw_handler)NULL,	/* SIOCSIWTHRSPY */
+	(iw_handler)NULL,	/* SIOCGIWTHRSPY */
+	(iw_handler)ks_wlan_set_wap,	/* SIOCSIWAP */
+	(iw_handler)ks_wlan_get_wap,	/* SIOCGIWAP */
+//      (iw_handler)NULL,                      /* SIOCSIWMLME */
+	(iw_handler)ks_wlan_set_mlme,	/* SIOCSIWMLME */
+	(iw_handler)ks_wlan_get_aplist,	/* SIOCGIWAPLIST */
+	(iw_handler)ks_wlan_set_scan,	/* SIOCSIWSCAN */
+	(iw_handler)ks_wlan_get_scan,	/* SIOCGIWSCAN */
+	(iw_handler)ks_wlan_set_essid,	/* SIOCSIWESSID */
+	(iw_handler)ks_wlan_get_essid,	/* SIOCGIWESSID */
+	(iw_handler)ks_wlan_set_nick,	/* SIOCSIWNICKN */
+	(iw_handler)ks_wlan_get_nick,	/* SIOCGIWNICKN */
+	(iw_handler)NULL,	/* -- hole -- */
+	(iw_handler)NULL,	/* -- hole -- */
+	(iw_handler)ks_wlan_set_rate,	/* SIOCSIWRATE */
+	(iw_handler)ks_wlan_get_rate,	/* SIOCGIWRATE */
+	(iw_handler)ks_wlan_set_rts,	/* SIOCSIWRTS */
+	(iw_handler)ks_wlan_get_rts,	/* SIOCGIWRTS */
+	(iw_handler)ks_wlan_set_frag,	/* SIOCSIWFRAG */
+	(iw_handler)ks_wlan_get_frag,	/* SIOCGIWFRAG */
 #ifndef KSC_OPNOTSUPP
-	(iw_handler) ks_wlan_set_txpow,	/* SIOCSIWTXPOW */
-	(iw_handler) ks_wlan_get_txpow,	/* SIOCGIWTXPOW */
-	(iw_handler) ks_wlan_set_retry,	/* SIOCSIWRETRY */
-	(iw_handler) ks_wlan_get_retry,	/* SIOCGIWRETRY */
+	(iw_handler)ks_wlan_set_txpow,	/* SIOCSIWTXPOW */
+	(iw_handler)ks_wlan_get_txpow,	/* SIOCGIWTXPOW */
+	(iw_handler)ks_wlan_set_retry,	/* SIOCSIWRETRY */
+	(iw_handler)ks_wlan_get_retry,	/* SIOCGIWRETRY */
 #else /* KSC_OPNOTSUPP */
-	(iw_handler) NULL,	/* SIOCSIWTXPOW */
-	(iw_handler) NULL,	/* SIOCGIWTXPOW */
-	(iw_handler) NULL,	/* SIOCSIWRETRY */
-	(iw_handler) NULL,	/* SIOCGIWRETRY */
+	(iw_handler)NULL,	/* SIOCSIWTXPOW */
+	(iw_handler)NULL,	/* SIOCGIWTXPOW */
+	(iw_handler)NULL,	/* SIOCSIWRETRY */
+	(iw_handler)NULL,	/* SIOCGIWRETRY */
 #endif /* KSC_OPNOTSUPP */
-	(iw_handler) ks_wlan_set_encode,	/* SIOCSIWENCODE */
-	(iw_handler) ks_wlan_get_encode,	/* SIOCGIWENCODE */
-	(iw_handler) ks_wlan_set_power,	/* SIOCSIWPOWER */
-	(iw_handler) ks_wlan_get_power,	/* SIOCGIWPOWER */
-	(iw_handler) NULL,	/* -- hole -- */
-	(iw_handler) NULL,	/* -- hole -- */
-//      (iw_handler) NULL,                      /* SIOCSIWGENIE */
-	(iw_handler) ks_wlan_set_genie,	/* SIOCSIWGENIE */
-	(iw_handler) NULL,	/* SIOCGIWGENIE */
-	(iw_handler) ks_wlan_set_auth_mode,	/* SIOCSIWAUTH */
-	(iw_handler) ks_wlan_get_auth_mode,	/* SIOCGIWAUTH */
-	(iw_handler) ks_wlan_set_encode_ext,	/* SIOCSIWENCODEEXT */
-	(iw_handler) ks_wlan_get_encode_ext,	/* SIOCGIWENCODEEXT */
-	(iw_handler) ks_wlan_set_pmksa,	/* SIOCSIWPMKSA */
-	(iw_handler) NULL,	/* -- hole -- */
+	(iw_handler)ks_wlan_set_encode,	/* SIOCSIWENCODE */
+	(iw_handler)ks_wlan_get_encode,	/* SIOCGIWENCODE */
+	(iw_handler)ks_wlan_set_power,	/* SIOCSIWPOWER */
+	(iw_handler)ks_wlan_get_power,	/* SIOCGIWPOWER */
+	(iw_handler)NULL,	/* -- hole -- */
+	(iw_handler)NULL,	/* -- hole -- */
+//      (iw_handler)NULL,                      /* SIOCSIWGENIE */
+	(iw_handler)ks_wlan_set_genie,	/* SIOCSIWGENIE */
+	(iw_handler)NULL,	/* SIOCGIWGENIE */
+	(iw_handler)ks_wlan_set_auth_mode,	/* SIOCSIWAUTH */
+	(iw_handler)ks_wlan_get_auth_mode,	/* SIOCGIWAUTH */
+	(iw_handler)ks_wlan_set_encode_ext,	/* SIOCSIWENCODEEXT */
+	(iw_handler)ks_wlan_get_encode_ext,	/* SIOCGIWENCODEEXT */
+	(iw_handler)ks_wlan_set_pmksa,	/* SIOCSIWPMKSA */
+	(iw_handler)NULL,	/* -- hole -- */
 };
 
 /* private_handler */
 static const iw_handler ks_wlan_private_handler[] = {
-	(iw_handler) NULL,	/*  0 */
-	(iw_handler) NULL,	/*  1, used to be: KS_WLAN_GET_DRIVER_VERSION */
-	(iw_handler) NULL,	/*  2 */
-	(iw_handler) ks_wlan_get_firmware_version,	/*  3 KS_WLAN_GET_FIRM_VERSION */
+	(iw_handler)NULL,	/*  0 */
+	(iw_handler)NULL,	/*  1, used to be: KS_WLAN_GET_DRIVER_VERSION */
+	(iw_handler)NULL,	/*  2 */
+	(iw_handler)ks_wlan_get_firmware_version,	/*  3 KS_WLAN_GET_FIRM_VERSION */
 #ifdef WPS
-	(iw_handler) ks_wlan_set_wps_enable,	/*  4 KS_WLAN_SET_WPS_ENABLE  */
-	(iw_handler) ks_wlan_get_wps_enable,	/*  5 KS_WLAN_GET_WPS_ENABLE  */
-	(iw_handler) ks_wlan_set_wps_probe_req,	/*  6 KS_WLAN_SET_WPS_PROBE_REQ */
+	(iw_handler)ks_wlan_set_wps_enable,	/*  4 KS_WLAN_SET_WPS_ENABLE  */
+	(iw_handler)ks_wlan_get_wps_enable,	/*  5 KS_WLAN_GET_WPS_ENABLE  */
+	(iw_handler)ks_wlan_set_wps_probe_req,	/*  6 KS_WLAN_SET_WPS_PROBE_REQ */
 #else
-	(iw_handler) NULL,	/*  4 */
-	(iw_handler) NULL,	/*  5 */
-	(iw_handler) NULL,	/*  6 */
+	(iw_handler)NULL,	/*  4 */
+	(iw_handler)NULL,	/*  5 */
+	(iw_handler)NULL,	/*  6 */
 #endif /* WPS */
 
-	(iw_handler) ks_wlan_get_eeprom_cksum,	/*  7 KS_WLAN_GET_CONNECT */
-	(iw_handler) ks_wlan_set_preamble,	/*  8 KS_WLAN_SET_PREAMBLE */
-	(iw_handler) ks_wlan_get_preamble,	/*  9 KS_WLAN_GET_PREAMBLE */
-	(iw_handler) ks_wlan_set_powermgt,	/* 10 KS_WLAN_SET_POWER_SAVE */
-	(iw_handler) ks_wlan_get_powermgt,	/* 11 KS_WLAN_GET_POWER_SAVE */
-	(iw_handler) ks_wlan_set_scan_type,	/* 12 KS_WLAN_SET_SCAN_TYPE */
-	(iw_handler) ks_wlan_get_scan_type,	/* 13 KS_WLAN_GET_SCAN_TYPE */
-	(iw_handler) ks_wlan_set_rx_gain,	/* 14 KS_WLAN_SET_RX_GAIN */
-	(iw_handler) ks_wlan_get_rx_gain,	/* 15 KS_WLAN_GET_RX_GAIN */
-	(iw_handler) ks_wlan_hostt,	/* 16 KS_WLAN_HOSTT */
-	(iw_handler) NULL,	/* 17 */
-	(iw_handler) ks_wlan_set_beacon_lost,	/* 18 KS_WLAN_SET_BECAN_LOST */
-	(iw_handler) ks_wlan_get_beacon_lost,	/* 19 KS_WLAN_GET_BECAN_LOST */
-	(iw_handler) ks_wlan_set_tx_gain,	/* 20 KS_WLAN_SET_TX_GAIN */
-	(iw_handler) ks_wlan_get_tx_gain,	/* 21 KS_WLAN_GET_TX_GAIN */
-	(iw_handler) ks_wlan_set_phy_type,	/* 22 KS_WLAN_SET_PHY_TYPE */
-	(iw_handler) ks_wlan_get_phy_type,	/* 23 KS_WLAN_GET_PHY_TYPE */
-	(iw_handler) ks_wlan_set_cts_mode,	/* 24 KS_WLAN_SET_CTS_MODE */
-	(iw_handler) ks_wlan_get_cts_mode,	/* 25 KS_WLAN_GET_CTS_MODE */
-	(iw_handler) NULL,	/* 26 */
-	(iw_handler) NULL,	/* 27 */
-	(iw_handler) ks_wlan_set_sleep_mode,	/* 28 KS_WLAN_SET_SLEEP_MODE */
-	(iw_handler) ks_wlan_get_sleep_mode,	/* 29 KS_WLAN_GET_SLEEP_MODE */
-	(iw_handler) NULL,	/* 30 */
-	(iw_handler) NULL,	/* 31 */
+	(iw_handler)ks_wlan_get_eeprom_cksum,	/*  7 KS_WLAN_GET_CONNECT */
+	(iw_handler)ks_wlan_set_preamble,	/*  8 KS_WLAN_SET_PREAMBLE */
+	(iw_handler)ks_wlan_get_preamble,	/*  9 KS_WLAN_GET_PREAMBLE */
+	(iw_handler)ks_wlan_set_powermgt,	/* 10 KS_WLAN_SET_POWER_SAVE */
+	(iw_handler)ks_wlan_get_powermgt,	/* 11 KS_WLAN_GET_POWER_SAVE */
+	(iw_handler)ks_wlan_set_scan_type,	/* 12 KS_WLAN_SET_SCAN_TYPE */
+	(iw_handler)ks_wlan_get_scan_type,	/* 13 KS_WLAN_GET_SCAN_TYPE */
+	(iw_handler)ks_wlan_set_rx_gain,	/* 14 KS_WLAN_SET_RX_GAIN */
+	(iw_handler)ks_wlan_get_rx_gain,	/* 15 KS_WLAN_GET_RX_GAIN */
+	(iw_handler)ks_wlan_hostt,	/* 16 KS_WLAN_HOSTT */
+	(iw_handler)NULL,	/* 17 */
+	(iw_handler)ks_wlan_set_beacon_lost,	/* 18 KS_WLAN_SET_BECAN_LOST */
+	(iw_handler)ks_wlan_get_beacon_lost,	/* 19 KS_WLAN_GET_BECAN_LOST */
+	(iw_handler)ks_wlan_set_tx_gain,	/* 20 KS_WLAN_SET_TX_GAIN */
+	(iw_handler)ks_wlan_get_tx_gain,	/* 21 KS_WLAN_GET_TX_GAIN */
+	(iw_handler)ks_wlan_set_phy_type,	/* 22 KS_WLAN_SET_PHY_TYPE */
+	(iw_handler)ks_wlan_get_phy_type,	/* 23 KS_WLAN_GET_PHY_TYPE */
+	(iw_handler)ks_wlan_set_cts_mode,	/* 24 KS_WLAN_SET_CTS_MODE */
+	(iw_handler)ks_wlan_get_cts_mode,	/* 25 KS_WLAN_GET_CTS_MODE */
+	(iw_handler)NULL,	/* 26 */
+	(iw_handler)NULL,	/* 27 */
+	(iw_handler)ks_wlan_set_sleep_mode,	/* 28 KS_WLAN_SET_SLEEP_MODE */
+	(iw_handler)ks_wlan_get_sleep_mode,	/* 29 KS_WLAN_GET_SLEEP_MODE */
+	(iw_handler)NULL,	/* 30 */
+	(iw_handler)NULL,	/* 31 */
 };
 
 static const struct iw_handler_def ks_wlan_handler_def = {
@@ -3247,8 +3247,8 @@ static const struct iw_handler_def ks_wlan_handler_def = {
 	.num_private = sizeof(ks_wlan_private_handler) / sizeof(iw_handler),
 	.num_private_args =
 	    sizeof(ks_wlan_private_args) / sizeof(struct iw_priv_args),
-	.standard = (iw_handler *) ks_wlan_handler,
-	.private = (iw_handler *) ks_wlan_private_handler,
+	.standard = (iw_handler *)ks_wlan_handler,
+	.private = (iw_handler *)ks_wlan_private_handler,
 	.private_args = (struct iw_priv_args *)ks_wlan_private_args,
 	.get_wireless_stats = ks_get_wireless_stats,
 };
-- 
2.7.4

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

^ permalink raw reply related	[flat|nested] 27+ messages in thread

* [PATCH 02/12] staging: ks7010: fix checkpatch BLOCK_COMMENT_STYLE
  2017-03-13 22:53 [PATCH 00/12] staging: ks7010: fix checkpatch ks_wlan_net.c Tobin C. Harding
  2017-03-13 22:53 ` [PATCH 01/12] staging: ks7010: fix checkpatch SPACING Tobin C. Harding
@ 2017-03-13 22:54 ` Tobin C. Harding
  2017-03-13 22:54 ` [PATCH 03/12] staging: ks7010: convert comments to kernel doc format Tobin C. Harding
                   ` (9 subsequent siblings)
  11 siblings, 0 replies; 27+ messages in thread
From: Tobin C. Harding @ 2017-03-13 22:54 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: driverdev-devel, Wolfram Sang

Checkpatch emits block comments warnings.

Change comments blocks to be inline with kernel coding style for
networking code.

Signed-off-by: Tobin C. Harding <me@tobin.cc>
---
 drivers/staging/ks7010/ks_wlan_net.c | 51 ++++++++++++++++++++++--------------
 1 file changed, 32 insertions(+), 19 deletions(-)

diff --git a/drivers/staging/ks7010/ks_wlan_net.c b/drivers/staging/ks7010/ks_wlan_net.c
index 75e42a7..1ff1948 100644
--- a/drivers/staging/ks7010/ks_wlan_net.c
+++ b/drivers/staging/ks7010/ks_wlan_net.c
@@ -230,7 +230,8 @@ static int ks_wlan_set_freq(struct net_device *dev,
 	} else {
 		int channel = fwrq->m;
 		/* We should do a better check than that,
-		 * based on the card capability !!! */
+		 * based on the card capability !!!
+		 */
 		if ((channel < 1) || (channel > 14)) {
 			netdev_dbg(dev,
 				   "%s: New channel value of %d is invalid!\n",
@@ -343,7 +344,8 @@ static int ks_wlan_get_essid(struct net_device *dev,
 
 	/* for SLEEP MODE */
 	/* Note : if dwrq->flags != 0, we should
-	 * get the relevant SSID from the SSID list... */
+	 * get the relevant SSID from the SSID list...
+	 */
 	if (priv->reg.ssid.size) {
 		/* Get the current SSID */
 		memcpy(extra, priv->reg.ssid.body, priv->reg.ssid.size);
@@ -1139,7 +1141,8 @@ static int ks_wlan_get_range(struct net_device *dev,
 	range->max_nwid = 0x0000;
 	range->num_channels = 14;
 	/* Should be based on cap_rid.country to give only
-	 * what the current card support */
+	 * what the current card support
+	 */
 	k = 0;
 	for (i = 0; i < 13; i++) {	/* channel 1 -- 13 */
 		range->freq[k].i = i + 1;	/* List index */
@@ -1191,7 +1194,8 @@ static int ks_wlan_get_range(struct net_device *dev,
 
 	/* Set an indication of the max TCP throughput
 	 * in bit/s that we can expect using this interface.
-	 * May be use for QoS stuff... Jean II */
+	 * May be use for QoS stuff... Jean II
+	 */
 	if (i > 2)
 		range->throughput = 5000 * 1000;
 	else
@@ -1225,9 +1229,11 @@ static int ks_wlan_get_range(struct net_device *dev,
 	range->retry_flags = IW_RETRY_ON;
 	range->r_time_flags = IW_RETRY_ON;
 
-	/* Experimental measurements - boundary 11/5.5 Mb/s */
-	/* Note : with or without the (local->rssi), results
-	 * are somewhat different. - Jean II */
+	/* Experimental measurements - boundary 11/5.5 Mb/s
+	 *
+	 * Note : with or without the (local->rssi), results
+	 * are somewhat different. - Jean II
+	 */
 	range->avg_qual.qual = 50;
 	range->avg_qual.level = 186;	/* -70 dBm */
 	range->avg_qual.noise = 0;
@@ -1500,7 +1506,8 @@ static inline char *ks_wlan_translate_scan(struct net_device *dev,
 				 ap->ssid.body);
 
 	/* Rate : stuffing multiple values in a single event require a bit
-	 * more of magic - Jean II */
+	 * more of magic - Jean II
+	 */
 	current_val = current_ev + IW_EV_LCP_LEN;
 
 	iwe.cmd = SIOCGIWRATE;
@@ -1572,7 +1579,8 @@ static inline char *ks_wlan_translate_scan(struct net_device *dev,
 	}
 
 	/* The other data in the scan result are not really
-	 * interesting, so for now drop it - Jean II */
+	 * interesting, so for now drop it - Jean II
+	 */
 	return current_ev;
 }
 
@@ -1599,7 +1607,8 @@ static int ks_wlan_get_scan(struct net_device *dev,
 
 	if (priv->aplist.size == 0) {
 		/* Client error, no scan results...
-		 * The caller need to restart the scan. */
+		 * The caller need to restart the scan.
+		 */
 		DPRINTK(2, "aplist 0\n");
 		return -ENODATA;
 	}
@@ -1974,12 +1983,13 @@ static int ks_wlan_get_encode_ext(struct net_device *dev,
 		return -EPERM;
 
 	/* for SLEEP MODE */
-	/*  WPA (not used ?? wpa_supplicant)
-	   struct ks_wlan_private *priv = (struct ks_wlan_private *)dev->priv;
-	   struct iw_encode_ext *enc;
-	   enc = (struct iw_encode_ext *)extra;
-	   int index = dwrq->flags & IW_ENCODE_INDEX;
-	   WPA (not used ?? wpa_supplicant) */
+	/* WPA (not used ?? wpa_supplicant)
+	 * struct ks_wlan_private *priv = (struct ks_wlan_private *)dev->priv;
+	 * struct iw_encode_ext *enc;
+	 * enc = (struct iw_encode_ext *)extra;
+	 * int index = dwrq->flags & IW_ENCODE_INDEX;
+	 * WPA (not used ?? wpa_supplicant)
+	 */
 	return 0;
 }
 
@@ -2109,7 +2119,8 @@ static struct iw_statistics *ks_get_wireless_stats(struct net_device *dev)
 	}
 
 	/* Packets discarded in the wireless adapter due to wireless
-	 * specific problems */
+	 * specific problems
+	 */
 	wstats->discard.nwid = 0;	/* Rx invalid nwid      */
 	wstats->discard.code = 0;	/* Rx invalid crypt     */
 	wstats->discard.fragment = 0;	/* Rx invalid frag      */
@@ -3362,8 +3373,10 @@ void send_packet_complete(void *arg1, void *arg2)
 	}
 }
 
-/* Set or clear the multicast filter for this adaptor.
-   This routine is not state sensitive and need not be SMP locked. */
+/*
+ * Set or clear the multicast filter for this adaptor.
+ * This routine is not state sensitive and need not be SMP locked.
+ */
 static
 void ks_wlan_set_multicast_list(struct net_device *dev)
 {
-- 
2.7.4

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

^ permalink raw reply related	[flat|nested] 27+ messages in thread

* [PATCH 03/12] staging: ks7010: convert comments to kernel doc format
  2017-03-13 22:53 [PATCH 00/12] staging: ks7010: fix checkpatch ks_wlan_net.c Tobin C. Harding
  2017-03-13 22:53 ` [PATCH 01/12] staging: ks7010: fix checkpatch SPACING Tobin C. Harding
  2017-03-13 22:54 ` [PATCH 02/12] staging: ks7010: fix checkpatch BLOCK_COMMENT_STYLE Tobin C. Harding
@ 2017-03-13 22:54 ` Tobin C. Harding
  2017-03-14  0:06   ` Greg Kroah-Hartman
  2017-03-13 22:54 ` [PATCH 04/12] staging: ks7010: fix logical line continuation Tobin C. Harding
                   ` (8 subsequent siblings)
  11 siblings, 1 reply; 27+ messages in thread
From: Tobin C. Harding @ 2017-03-13 22:54 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: driverdev-devel, Wolfram Sang

Function comments use a custom format. We have a standard function
comment format, kernel doc format. Using the standard format aids
readability and allows documentation to be produced using kernel
tools.

Convert function comments to use kernel doc format.

Signed-off-by: Tobin C. Harding <me@tobin.cc>
---
 drivers/staging/ks7010/ks_wlan_net.c | 554 +++++++++++++++++++++++++----------
 1 file changed, 395 insertions(+), 159 deletions(-)

diff --git a/drivers/staging/ks7010/ks_wlan_net.c b/drivers/staging/ks7010/ks_wlan_net.c
index 1ff1948..c6f891e 100644
--- a/drivers/staging/ks7010/ks_wlan_net.c
+++ b/drivers/staging/ks7010/ks_wlan_net.c
@@ -163,8 +163,7 @@ int ks_wlan_setup_parameter(struct ks_wlan_private *priv,
 	return 0;
 }
 
-/*
- * Initial Wireless Extension code for Ks_Wlannet driver by :
+/* Initial Wireless Extension code for Ks_Wlannet driver by :
  *	Jean Tourrilhes <jt@hpl.hp.com> - HPL - 17 November 00
  * Conversion to new driver API by :
  *	Jean Tourrilhes <jt@hpl.hp.com> - HPL - 26 March 02
@@ -173,8 +172,11 @@ int ks_wlan_setup_parameter(struct ks_wlan_private *priv,
  * would not work at all... - Jean II
  */
 
-/*------------------------------------------------------------------*/
-/* Wireless Handler : get protocol name */
+/**
+ * ks_wlan_get_name() - Get protocol name.
+ *
+ * Wireless Handler
+ */
 static int ks_wlan_get_name(struct net_device *dev,
 			    struct iw_request_info *info, char *cwrq,
 			    char *extra)
@@ -198,8 +200,11 @@ static int ks_wlan_get_name(struct net_device *dev,
 	return 0;
 }
 
-/*------------------------------------------------------------------*/
-/* Wireless Handler : set frequency */
+/**
+ * ks_wlan_set_freq() - Set frequency.
+ *
+ * Wireless Handler
+ */
 static int ks_wlan_set_freq(struct net_device *dev,
 			    struct iw_request_info *info, struct iw_freq *fwrq,
 			    char *extra)
@@ -247,8 +252,11 @@ static int ks_wlan_set_freq(struct net_device *dev,
 	return rc;
 }
 
-/*------------------------------------------------------------------*/
-/* Wireless Handler : get frequency */
+/**
+ * ks_wlan_get_freq() - Get frequency.
+ *
+ * Wireless Handler
+ */
 static int ks_wlan_get_freq(struct net_device *dev,
 			    struct iw_request_info *info, struct iw_freq *fwrq,
 			    char *extra)
@@ -271,8 +279,11 @@ static int ks_wlan_get_freq(struct net_device *dev,
 	return 0;
 }
 
-/*------------------------------------------------------------------*/
-/* Wireless Handler : set ESSID */
+/**
+ * ks_wlan_set_essid() - Set ESSID.
+ *
+ * Wireless Handler
+ */
 static int ks_wlan_set_essid(struct net_device *dev,
 			     struct iw_request_info *info,
 			     struct iw_point *dwrq, char *extra)
@@ -330,8 +341,11 @@ static int ks_wlan_set_essid(struct net_device *dev,
 	return 0;
 }
 
-/*------------------------------------------------------------------*/
-/* Wireless Handler : get ESSID */
+/**
+ * ks_wlan_get_essid() - Get ESSID.
+ *
+ * Wireless Handler
+ */
 static int ks_wlan_get_essid(struct net_device *dev,
 			     struct iw_request_info *info,
 			     struct iw_point *dwrq, char *extra)
@@ -374,8 +388,11 @@ static int ks_wlan_get_essid(struct net_device *dev,
 	return 0;
 }
 
-/*------------------------------------------------------------------*/
-/* Wireless Handler : set AP address */
+/**
+ * ks_wlan_set_wap() - Set AP address.
+ *
+ * Wireless Handler
+ */
 static int ks_wlan_set_wap(struct net_device *dev, struct iw_request_info *info,
 			   struct sockaddr *ap_addr, char *extra)
 {
@@ -410,8 +427,11 @@ static int ks_wlan_set_wap(struct net_device *dev, struct iw_request_info *info,
 	return 0;
 }
 
-/*------------------------------------------------------------------*/
-/* Wireless Handler : get AP address */
+/**
+ * ks_wlan_get_wap() - Get AP address.
+ *
+ * Wireless Handler
+ */
 static int ks_wlan_get_wap(struct net_device *dev, struct iw_request_info *info,
 			   struct sockaddr *awrq, char *extra)
 {
@@ -432,8 +452,11 @@ static int ks_wlan_get_wap(struct net_device *dev, struct iw_request_info *info,
 	return 0;
 }
 
-/*------------------------------------------------------------------*/
-/* Wireless Handler : set Nickname */
+/**
+ * ks_wlan_set_nick() - Set Nickname.
+ *
+ * Wireless Handler
+ */
 static int ks_wlan_set_nick(struct net_device *dev,
 			    struct iw_request_info *info, struct iw_point *dwrq,
 			    char *extra)
@@ -455,8 +478,11 @@ static int ks_wlan_set_nick(struct net_device *dev,
 	return -EINPROGRESS;	/* Call commit handler */
 }
 
-/*------------------------------------------------------------------*/
-/* Wireless Handler : get Nickname */
+/**
+ * ks_wlan_get_nick() - Get Nickname.
+ *
+ * Wireless Handler
+ */
 static int ks_wlan_get_nick(struct net_device *dev,
 			    struct iw_request_info *info, struct iw_point *dwrq,
 			    char *extra)
@@ -475,8 +501,11 @@ static int ks_wlan_get_nick(struct net_device *dev,
 	return 0;
 }
 
-/*------------------------------------------------------------------*/
-/* Wireless Handler : set Bit-Rate */
+/**
+ * ks_wlan_set_rate() - Set bit-rate.
+ *
+ * Wireless Handler
+ */
 static int ks_wlan_set_rate(struct net_device *dev,
 			    struct iw_request_info *info, struct iw_param *vwrq,
 			    char *extra)
@@ -710,8 +739,11 @@ static int ks_wlan_set_rate(struct net_device *dev,
 	return -EINPROGRESS;	/* Call commit handler */
 }
 
-/*------------------------------------------------------------------*/
-/* Wireless Handler : get Bit-Rate */
+/**
+ * ks_wlan_get_rate() - Get bit-rate.
+ *
+ * Wireless Handler
+ */
 static int ks_wlan_get_rate(struct net_device *dev,
 			    struct iw_request_info *info, struct iw_param *vwrq,
 			    char *extra)
@@ -738,8 +770,11 @@ static int ks_wlan_get_rate(struct net_device *dev,
 	return 0;
 }
 
-/*------------------------------------------------------------------*/
-/* Wireless Handler : set RTS threshold */
+/**
+ * ks_wlan_set_rts() - Set RTS threshold.
+ *
+ * Wireless Handler
+ */
 static int ks_wlan_set_rts(struct net_device *dev, struct iw_request_info *info,
 			   struct iw_param *vwrq, char *extra)
 {
@@ -762,8 +797,11 @@ static int ks_wlan_set_rts(struct net_device *dev, struct iw_request_info *info,
 	return -EINPROGRESS;	/* Call commit handler */
 }
 
-/*------------------------------------------------------------------*/
-/* Wireless Handler : get RTS threshold */
+/**
+ * ks_wlan_get_rts() - Get RTS threshold.
+ *
+ * Wireless Handler
+ */
 static int ks_wlan_get_rts(struct net_device *dev, struct iw_request_info *info,
 			   struct iw_param *vwrq, char *extra)
 {
@@ -781,8 +819,11 @@ static int ks_wlan_get_rts(struct net_device *dev, struct iw_request_info *info,
 	return 0;
 }
 
-/*------------------------------------------------------------------*/
-/* Wireless Handler : set Fragmentation threshold */
+/**
+ * ks_wlan_set_frag() - Set fragmentation threshold.
+ *
+ * Wireless Handler
+ */
 static int ks_wlan_set_frag(struct net_device *dev,
 			    struct iw_request_info *info, struct iw_param *vwrq,
 			    char *extra)
@@ -807,8 +848,11 @@ static int ks_wlan_set_frag(struct net_device *dev,
 	return -EINPROGRESS;	/* Call commit handler */
 }
 
-/*------------------------------------------------------------------*/
-/* Wireless Handler : get Fragmentation threshold */
+/**
+ * ks_wlan_get_frag() - Get fragmentation threshold.
+ *
+ * Wireless Handler
+ */
 static int ks_wlan_get_frag(struct net_device *dev,
 			    struct iw_request_info *info, struct iw_param *vwrq,
 			    char *extra)
@@ -827,8 +871,11 @@ static int ks_wlan_get_frag(struct net_device *dev,
 	return 0;
 }
 
-/*------------------------------------------------------------------*/
-/* Wireless Handler : set Mode of Operation */
+/**
+ * ks_wlan_set_mode() - Set mode of operation.
+ *
+ * Wireless Handler
+ */
 static int ks_wlan_set_mode(struct net_device *dev,
 			    struct iw_request_info *info, __u32 *uwrq,
 			    char *extra)
@@ -863,8 +910,11 @@ static int ks_wlan_set_mode(struct net_device *dev,
 	return -EINPROGRESS;	/* Call commit handler */
 }
 
-/*------------------------------------------------------------------*/
-/* Wireless Handler : get Mode of Operation */
+/**
+ * ks_wlan_get_mode() - Get mode of operation.
+ *
+ * Wireless Handler
+ */
 static int ks_wlan_get_mode(struct net_device *dev,
 			    struct iw_request_info *info, __u32 *uwrq,
 			    char *extra)
@@ -891,8 +941,11 @@ static int ks_wlan_get_mode(struct net_device *dev,
 	return 0;
 }
 
-/*------------------------------------------------------------------*/
-/* Wireless Handler : set Encryption Key */
+/**
+ * ks_wlan_set_encode() - Set encryption key.
+ *
+ * Wireless Handler
+ */
 static int ks_wlan_set_encode(struct net_device *dev,
 			      struct iw_request_info *info,
 			      struct iw_point *dwrq, char *extra)
@@ -1009,8 +1062,11 @@ static int ks_wlan_set_encode(struct net_device *dev,
 	return 0;
 }
 
-/*------------------------------------------------------------------*/
-/* Wireless Handler : get Encryption Key */
+/**
+ * ks_wlan_get_encode() - Get encryption key.
+ *
+ * Wireless Handler
+ */
 static int ks_wlan_get_encode(struct net_device *dev,
 			      struct iw_request_info *info,
 			      struct iw_point *dwrq, char *extra)
@@ -1065,8 +1121,12 @@ static int ks_wlan_get_encode(struct net_device *dev,
 }
 
 #ifndef KSC_OPNOTSUPP
-/*------------------------------------------------------------------*/
-/* Wireless Handler : set Tx-Power */
+
+/**
+ * ks_wlan_set_txpow() - Set Tx power.
+ *
+ * Wireless Handler
+ */
 static int ks_wlan_set_txpow(struct net_device *dev,
 			     struct iw_request_info *info,
 			     struct iw_param *vwrq, char *extra)
@@ -1074,8 +1134,11 @@ static int ks_wlan_set_txpow(struct net_device *dev,
 	return -EOPNOTSUPP;	/* Not Support */
 }
 
-/*------------------------------------------------------------------*/
-/* Wireless Handler : get Tx-Power */
+/**
+ * ks_wlan_get_txpow() - Get Tx power.
+ *
+ * Wireless Handler
+ */
 static int ks_wlan_get_txpow(struct net_device *dev,
 			     struct iw_request_info *info,
 			     struct iw_param *vwrq, char *extra)
@@ -1091,8 +1154,11 @@ static int ks_wlan_get_txpow(struct net_device *dev,
 	return 0;
 }
 
-/*------------------------------------------------------------------*/
-/* Wireless Handler : set Retry limits */
+/**
+ * ks_wlan_set_retry() - Set retry limits.
+ *
+ * Wireless Handler
+ */
 static int ks_wlan_set_retry(struct net_device *dev,
 			     struct iw_request_info *info,
 			     struct iw_param *vwrq, char *extra)
@@ -1100,8 +1166,11 @@ static int ks_wlan_set_retry(struct net_device *dev,
 	return -EOPNOTSUPP;	/* Not Support */
 }
 
-/*------------------------------------------------------------------*/
-/* Wireless Handler : get Retry limits */
+/**
+ * ks_wlan_get_retry() - Get retry limits.
+ *
+ * Wireless Handler
+ */
 static int ks_wlan_get_retry(struct net_device *dev,
 			     struct iw_request_info *info,
 			     struct iw_param *vwrq, char *extra)
@@ -1118,8 +1187,11 @@ static int ks_wlan_get_retry(struct net_device *dev,
 }
 #endif /* KSC_OPNOTSUPP */
 
-/*------------------------------------------------------------------*/
-/* Wireless Handler : get range info */
+/**
+ * ks_wlan_get_range() - Get range info.
+ *
+ * Wireless Handler
+ */
 static int ks_wlan_get_range(struct net_device *dev,
 			     struct iw_request_info *info,
 			     struct iw_point *dwrq, char *extra)
@@ -1253,8 +1325,11 @@ static int ks_wlan_get_range(struct net_device *dev,
 	return 0;
 }
 
-/*------------------------------------------------------------------*/
-/* Wireless Handler : set Power Management */
+/**
+ * ks_wlan_set_power() - Set power management.
+ *
+ * Wireless Handler
+ */
 static int ks_wlan_set_power(struct net_device *dev,
 			     struct iw_request_info *info,
 			     struct iw_param *vwrq, char *extra)
@@ -1289,8 +1364,11 @@ static int ks_wlan_set_power(struct net_device *dev,
 	return 0;
 }
 
-/*------------------------------------------------------------------*/
-/* Wireless Handler : get Power Management */
+/**
+ * ks_wlan_get_power() - Get power management.
+ *
+ * Wireless Handler
+ */
 static int ks_wlan_get_power(struct net_device *dev,
 			     struct iw_request_info *info,
 			     struct iw_param *vwrq, char *extra)
@@ -1309,8 +1387,11 @@ static int ks_wlan_get_power(struct net_device *dev,
 	return 0;
 }
 
-/*------------------------------------------------------------------*/
-/* Wireless Handler : get wirless statistics */
+/**
+ * ks_wlan_get_iwstats() - Get wireless statistics.
+ *
+ * Wireless Handler
+ */
 static int ks_wlan_get_iwstats(struct net_device *dev,
 			       struct iw_request_info *info,
 			       struct iw_quality *vwrq, char *extra)
@@ -1330,8 +1411,12 @@ static int ks_wlan_get_iwstats(struct net_device *dev,
 }
 
 #ifndef KSC_OPNOTSUPP
-/*------------------------------------------------------------------*/
-/* Wireless Handler : set Sensitivity */
+
+/**
+ * ks_wlan_set_sens() - Set sensitivity.
+ *
+ * Wireless Handler
+ */
 static int ks_wlan_set_sens(struct net_device *dev,
 			    struct iw_request_info *info, struct iw_param *vwrq,
 			    char *extra)
@@ -1339,8 +1424,11 @@ static int ks_wlan_set_sens(struct net_device *dev,
 	return -EOPNOTSUPP;	/* Not Support */
 }
 
-/*------------------------------------------------------------------*/
-/* Wireless Handler : get Sensitivity */
+/**
+ * ks_wlan_get_sens() - Get sensitivity.
+ *
+ * Wireless Handler
+ */
 static int ks_wlan_get_sens(struct net_device *dev,
 			    struct iw_request_info *info, struct iw_param *vwrq,
 			    char *extra)
@@ -1353,9 +1441,13 @@ static int ks_wlan_get_sens(struct net_device *dev,
 }
 #endif /* KSC_OPNOTSUPP */
 
-/*------------------------------------------------------------------*/
-/* Wireless Handler : get AP List */
-/* Note : this is deprecated in favor of IWSCAN */
+/**
+ * ks_wlan_get_aplist() - Get AP list.
+ *
+ * Note: this is deprecated in favor of IWSCAN.
+ *
+ * Wireless Handler
+ */
 static int ks_wlan_get_aplist(struct net_device *dev,
 			      struct iw_request_info *info,
 			      struct iw_point *dwrq, char *extra)
@@ -1389,8 +1481,11 @@ static int ks_wlan_get_aplist(struct net_device *dev,
 	return 0;
 }
 
-/*------------------------------------------------------------------*/
-/* Wireless Handler : Initiate Scan */
+/**
+ * ks_wlan_set_scan() - Initiate scan.
+ *
+ * Wireless Handler
+ */
 static int ks_wlan_set_scan(struct net_device *dev,
 			    struct iw_request_info *info,
 			    union iwreq_data *wrqu, char *extra)
@@ -1423,10 +1518,11 @@ static int ks_wlan_set_scan(struct net_device *dev,
 	return 0;
 }
 
-/*------------------------------------------------------------------*/
-/*
+/**
+ * ks_wlan_translate_scan() - Translate scan.
+ *
  * Translate scan data returned from the card to a card independent
- * format that the Wireless Tools will understand - Jean II
+ * format that the Wireless Tools will understand - Jean II.
  */
 static inline char *ks_wlan_translate_scan(struct net_device *dev,
 					   struct iw_request_info *info,
@@ -1584,8 +1680,11 @@ static inline char *ks_wlan_translate_scan(struct net_device *dev,
 	return current_ev;
 }
 
-/*------------------------------------------------------------------*/
-/* Wireless Handler : Read Scan Results */
+/**
+ * ks_wlan_get_scan() - Read scan results.
+ *
+ * Wireless Handler
+ */
 static int ks_wlan_get_scan(struct net_device *dev,
 			    struct iw_request_info *info, struct iw_point *dwrq,
 			    char *extra)
@@ -1644,8 +1743,11 @@ static int ks_wlan_get_scan(struct net_device *dev,
 	return 0;
 }
 
-/*------------------------------------------------------------------*/
-/* Commit handler : called after a bunch of SET operations */
+/**
+ * ks_wlan_config_commit()
+ *
+ * Commit handler: Called after a bunch of SET operations.
+ */
 static int ks_wlan_config_commit(struct net_device *dev,
 				 struct iw_request_info *info, void *zwrq,
 				 char *extra)
@@ -1661,8 +1763,11 @@ static int ks_wlan_config_commit(struct net_device *dev,
 	return 0;
 }
 
-/*------------------------------------------------------------------*/
-/* Wireless handler : set association ie params */
+/**
+ * ks_wlan_set_genie() - Set association.
+ *
+ * Wireless Handler: Set association i.e params
+ */
 static int ks_wlan_set_genie(struct net_device *dev,
 			     struct iw_request_info *info,
 			     struct iw_point *dwrq, char *extra)
@@ -1679,8 +1784,11 @@ static int ks_wlan_set_genie(struct net_device *dev,
 //      return -EOPNOTSUPP;
 }
 
-/*------------------------------------------------------------------*/
-/* Wireless handler : set authentication mode params */
+/**
+ * ks_wlan_set_auth_mode() - Set authentication mode params.
+ *
+ * Wireless Handler
+ */
 static int ks_wlan_set_auth_mode(struct net_device *dev,
 				 struct iw_request_info *info,
 				 struct iw_param *vwrq, char *extra)
@@ -1816,8 +1924,11 @@ static int ks_wlan_set_auth_mode(struct net_device *dev,
 	return 0;
 }
 
-/*------------------------------------------------------------------*/
-/* Wireless handler : get authentication mode params */
+/**
+ * ks_wlan_get_auth_mode() - Get authentication mode params.
+ *
+ * Wireless Handler
+ */
 static int ks_wlan_get_auth_mode(struct net_device *dev,
 				 struct iw_request_info *info,
 				 struct iw_param *vwrq, char *extra)
@@ -1862,8 +1973,11 @@ static int ks_wlan_get_auth_mode(struct net_device *dev,
 	return 0;
 }
 
-/*------------------------------------------------------------------*/
-/* Wireless Handler : set encoding token & mode (WPA)*/
+/**
+ * ks_wlan_set_encode_ext() - Set encoding token & mode (WPA).
+ *
+ * Wireless Handler
+ */
 static int ks_wlan_set_encode_ext(struct net_device *dev,
 				  struct iw_request_info *info,
 				  struct iw_point *dwrq, char *extra)
@@ -1970,8 +2084,11 @@ static int ks_wlan_set_encode_ext(struct net_device *dev,
 	return 0;
 }
 
-/*------------------------------------------------------------------*/
-/* Wireless Handler : get encoding token & mode (WPA)*/
+/**
+ * ks_wlan_get_encode_ext() - Get encoding token & mode (WPA).
+ *
+ * Wireless Handler
+ */
 static int ks_wlan_get_encode_ext(struct net_device *dev,
 				  struct iw_request_info *info,
 				  struct iw_point *dwrq, char *extra)
@@ -1993,8 +2110,11 @@ static int ks_wlan_get_encode_ext(struct net_device *dev,
 	return 0;
 }
 
-/*------------------------------------------------------------------*/
-/* Wireless Handler : PMKSA cache operation (WPA2) */
+/**
+ * ks_wlan_set_pmksa() - PMKSA cache operation (WPA2).
+ *
+ * Wireless Handler
+ */
 static int ks_wlan_set_pmksa(struct net_device *dev,
 			     struct iw_request_info *info,
 			     struct iw_point *dwrq, char *extra)
@@ -2131,8 +2251,11 @@ static struct iw_statistics *ks_get_wireless_stats(struct net_device *dev)
 	return wstats;
 }
 
-/*------------------------------------------------------------------*/
-/* Private handler : set stop request */
+/**
+ * ks_wlan_set_stop_request() - Set stop request.
+ *
+ * Private Handler
+ */
 static int ks_wlan_set_stop_request(struct net_device *dev,
 				    struct iw_request_info *info, __u32 *uwrq,
 				    char *extra)
@@ -2152,9 +2275,12 @@ static int ks_wlan_set_stop_request(struct net_device *dev,
 	return 0;
 }
 
-/*------------------------------------------------------------------*/
-/* Wireless Handler : set MLME */
 #include <linux/ieee80211.h>
+/**
+ * ks_wlan_set_mlme() - Set MLME.
+ *
+ * Wireless Handler
+ */
 static int ks_wlan_set_mlme(struct net_device *dev,
 			    struct iw_request_info *info, struct iw_point *dwrq,
 			    char *extra)
@@ -2182,8 +2308,11 @@ static int ks_wlan_set_mlme(struct net_device *dev,
 	}
 }
 
-/*------------------------------------------------------------------*/
-/* Private handler : get firemware version */
+/**
+ * ks_wlan_get_firmware_version() - Get firmware version.
+ *
+ * Private Handler
+ */
 static int ks_wlan_get_firmware_version(struct net_device *dev,
 					struct iw_request_info *info,
 					struct iw_point *dwrq, char *extra)
@@ -2196,8 +2325,12 @@ static int ks_wlan_get_firmware_version(struct net_device *dev,
 }
 
 #if 0
-/*------------------------------------------------------------------*/
-/* Private handler : set force disconnect status */
+
+/**
+ * ks_wlan_set_detach() - Set force disconnect status.
+ *
+ * Private Handler
+ */
 static int ks_wlan_set_detach(struct net_device *dev,
 			      struct iw_request_info *info, __u32 *uwrq,
 			      char *extra)
@@ -2222,8 +2355,11 @@ static int ks_wlan_set_detach(struct net_device *dev,
 	return 0;
 }
 
-/*------------------------------------------------------------------*/
-/* Private handler : get force disconnect status */
+/**
+ * ks_wlan_get_detach() - Get force disconnect status.
+ *
+ * Private Handler
+ */
 static int ks_wlan_get_detach(struct net_device *dev,
 			      struct iw_request_info *info, __u32 *uwrq,
 			      char *extra)
@@ -2238,8 +2374,11 @@ static int ks_wlan_get_detach(struct net_device *dev,
 	return 0;
 }
 
-/*------------------------------------------------------------------*/
-/* Private handler : get connect status */
+/**
+ * ks_wlan_get_connect() - Get connect status.
+ *
+ * Private Handler
+ */
 static int ks_wlan_get_connect(struct net_device *dev,
 			       struct iw_request_info *info, __u32 *uwrq,
 			       char *extra)
@@ -2255,8 +2394,11 @@ static int ks_wlan_get_connect(struct net_device *dev,
 }
 #endif
 
-/*------------------------------------------------------------------*/
-/* Private handler : set preamble */
+/**
+ * ks_wlan_set_preamble() - Set preamble.
+ *
+ * Private Handler
+ */
 static int ks_wlan_set_preamble(struct net_device *dev,
 				struct iw_request_info *info, __u32 *uwrq,
 				char *extra)
@@ -2280,8 +2422,11 @@ static int ks_wlan_set_preamble(struct net_device *dev,
 	return -EINPROGRESS;	/* Call commit handler */
 }
 
-/*------------------------------------------------------------------*/
-/* Private handler : get preamble */
+/**
+ * ks_wlan_get_preamble() - Get preamble.
+ *
+ * Private Handler
+ */
 static int ks_wlan_get_preamble(struct net_device *dev,
 				struct iw_request_info *info, __u32 *uwrq,
 				char *extra)
@@ -2297,8 +2442,11 @@ static int ks_wlan_get_preamble(struct net_device *dev,
 	return 0;
 }
 
-/*------------------------------------------------------------------*/
-/* Private handler : set power save mode */
+/**
+ * ks_wlan_set_powermgt() - Set power save mode.
+ *
+ * Private Handler
+ */
 static int ks_wlan_set_powermgt(struct net_device *dev,
 				struct iw_request_info *info, __u32 *uwrq,
 				char *extra)
@@ -2331,8 +2479,11 @@ static int ks_wlan_set_powermgt(struct net_device *dev,
 	return 0;
 }
 
-/*------------------------------------------------------------------*/
-/* Private handler : get power save made */
+/**
+ * ks_wlan_get_powermgt() - Get power save mode.
+ *
+ * Private Handler
+ */
 static int ks_wlan_get_powermgt(struct net_device *dev,
 				struct iw_request_info *info, __u32 *uwrq,
 				char *extra)
@@ -2348,8 +2499,11 @@ static int ks_wlan_get_powermgt(struct net_device *dev,
 	return 0;
 }
 
-/*------------------------------------------------------------------*/
-/* Private handler : set scan type */
+/**
+ * ks_wlan_set_scan_type() - Set scan type.
+ *
+ * Private Handler
+ */
 static int ks_wlan_set_scan_type(struct net_device *dev,
 				 struct iw_request_info *info, __u32 *uwrq,
 				 char *extra)
@@ -2371,8 +2525,11 @@ static int ks_wlan_set_scan_type(struct net_device *dev,
 	return 0;
 }
 
-/*------------------------------------------------------------------*/
-/* Private handler : get scan type */
+/**
+ * ks_wlan_get_scan_type() - Get scan type.
+ *
+ * Private Handler
+ */
 static int ks_wlan_get_scan_type(struct net_device *dev,
 				 struct iw_request_info *info, __u32 *uwrq,
 				 char *extra)
@@ -2388,8 +2545,12 @@ static int ks_wlan_get_scan_type(struct net_device *dev,
 }
 
 #if 0
-/*------------------------------------------------------------------*/
-/* Private handler : write raw data to device */
+
+/**
+ * ks_wlan_data_write() - Write raw data to device.
+ *
+ * Private Handler
+ */
 static int ks_wlan_data_write(struct net_device *dev,
 			      struct iw_request_info *info,
 			      struct iw_point *dwrq, char *extra)
@@ -2411,8 +2572,11 @@ static int ks_wlan_data_write(struct net_device *dev,
 	return 0;
 }
 
-/*------------------------------------------------------------------*/
-/* Private handler : read raw data form device */
+/**
+ * ks_wlan_data_read() - Read raw data to device.
+ *
+ * Private Handler
+ */
 static int ks_wlan_data_read(struct net_device *dev,
 			     struct iw_request_info *info,
 			     struct iw_point *dwrq, char *extra)
@@ -2468,9 +2632,12 @@ static int ks_wlan_data_read(struct net_device *dev,
 #endif
 
 #if 0
-/*------------------------------------------------------------------*/
-/* Private handler : get wep string */
 #define WEP_ASCII_BUFF_SIZE (17 + 64 * 4 + 1)
+/**
+ * ks_wlan_get_wep_ascii() - Get WEP string.
+ *
+ * Private Handler
+ */
 static int ks_wlan_get_wep_ascii(struct net_device *dev,
 				 struct iw_request_info *info,
 				 struct iw_point *dwrq, char *extra)
@@ -2518,8 +2685,11 @@ static int ks_wlan_get_wep_ascii(struct net_device *dev,
 }
 #endif
 
-/*------------------------------------------------------------------*/
-/* Private handler : set beacon lost count */
+/**
+ * ks_wlan_set_beacon_lost() - Set beacon lost count.
+ *
+ * Private Handler
+ */
 static int ks_wlan_set_beacon_lost(struct net_device *dev,
 				   struct iw_request_info *info, __u32 *uwrq,
 				   char *extra)
@@ -2543,8 +2713,11 @@ static int ks_wlan_set_beacon_lost(struct net_device *dev,
 	}
 }
 
-/*------------------------------------------------------------------*/
-/* Private handler : get beacon lost count */
+/**
+ * ks_wlan_get_beacon_lost() - Get beacon lost count.
+ *
+ * Private Handler
+ */
 static int ks_wlan_get_beacon_lost(struct net_device *dev,
 				   struct iw_request_info *info, __u32 *uwrq,
 				   char *extra)
@@ -2559,8 +2732,11 @@ static int ks_wlan_get_beacon_lost(struct net_device *dev,
 	return 0;
 }
 
-/*------------------------------------------------------------------*/
-/* Private handler : set phy type */
+/**
+ * ks_wlan_set_phy_type() - Set phy type.
+ *
+ * Private Handler
+ */
 static int ks_wlan_set_phy_type(struct net_device *dev,
 				struct iw_request_info *info, __u32 *uwrq,
 				char *extra)
@@ -2585,8 +2761,11 @@ static int ks_wlan_set_phy_type(struct net_device *dev,
 	return -EINPROGRESS;	/* Call commit handler */
 }
 
-/*------------------------------------------------------------------*/
-/* Private handler : get phy type */
+/**
+ * ks_wlan_get_phy_type() - Get phy type.
+ *
+ * Private Handler
+ */
 static int ks_wlan_get_phy_type(struct net_device *dev,
 				struct iw_request_info *info, __u32 *uwrq,
 				char *extra)
@@ -2601,8 +2780,11 @@ static int ks_wlan_get_phy_type(struct net_device *dev,
 	return 0;
 }
 
-/*------------------------------------------------------------------*/
-/* Private handler : set cts mode */
+/**
+ * ks_wlan_set_cts_mode() - Set CTS mode.
+ *
+ * Private Handler
+ */
 static int ks_wlan_set_cts_mode(struct net_device *dev,
 				struct iw_request_info *info, __u32 *uwrq,
 				char *extra)
@@ -2630,8 +2812,11 @@ static int ks_wlan_set_cts_mode(struct net_device *dev,
 	return -EINPROGRESS;	/* Call commit handler */
 }
 
-/*------------------------------------------------------------------*/
-/* Private handler : get cts mode */
+/**
+ * ks_wlan_get_cts_mode() - Get CTS mode.
+ *
+ * Private Handler
+ */
 static int ks_wlan_get_cts_mode(struct net_device *dev,
 				struct iw_request_info *info, __u32 *uwrq,
 				char *extra)
@@ -2646,8 +2831,11 @@ static int ks_wlan_get_cts_mode(struct net_device *dev,
 	return 0;
 }
 
-/*------------------------------------------------------------------*/
-/* Private handler : set sleep mode */
+/**
+ * ks_wlan_set_sleep_mode() - Set sleep mode.
+ *
+ * Private Handler
+ */
 static int ks_wlan_set_sleep_mode(struct net_device *dev,
 				  struct iw_request_info *info,
 				  __u32 *uwrq, char *extra)
@@ -2676,8 +2864,11 @@ static int ks_wlan_set_sleep_mode(struct net_device *dev,
 	return 0;
 }
 
-/*------------------------------------------------------------------*/
-/* Private handler : get sleep mode */
+/**
+ * ks_wlan_get_sleep_mode() - Get sleep mode.
+ *
+ * Private Handler
+ */
 static int ks_wlan_get_sleep_mode(struct net_device *dev,
 				  struct iw_request_info *info,
 				  __u32 *uwrq, char *extra)
@@ -2692,8 +2883,12 @@ static int ks_wlan_get_sleep_mode(struct net_device *dev,
 }
 
 #if 0
-/*------------------------------------------------------------------*/
-/* Private handler : set phy information timer */
+
+/**
+ * ks_wlan_set_phy_information_timer() - Set phy information timer.
+ *
+ * Private Handler
+ */
 static int ks_wlan_set_phy_information_timer(struct net_device *dev,
 					     struct iw_request_info *info,
 					     __u32 *uwrq, char *extra)
@@ -2713,8 +2908,11 @@ static int ks_wlan_set_phy_information_timer(struct net_device *dev,
 	return 0;
 }
 
-/*------------------------------------------------------------------*/
-/* Private handler : get phy information timer */
+/**
+ * ks_wlan_get_phy_information_timer() - Get phy information timer.
+ *
+ * Private Handler
+ */
 static int ks_wlan_get_phy_information_timer(struct net_device *dev,
 					     struct iw_request_info *info,
 					     __u32 *uwrq, char *extra)
@@ -2730,8 +2928,12 @@ static int ks_wlan_get_phy_information_timer(struct net_device *dev,
 #endif
 
 #ifdef WPS
-/*------------------------------------------------------------------*/
-/* Private handler : set WPS enable */
+
+/**
+ * ks_wlan_set_wps_enable() - Set WPS enable.
+ *
+ * Private Handler
+ */
 static int ks_wlan_set_wps_enable(struct net_device *dev,
 				  struct iw_request_info *info, __u32 *uwrq,
 				  char *extra)
@@ -2753,8 +2955,11 @@ static int ks_wlan_set_wps_enable(struct net_device *dev,
 	return 0;
 }
 
-/*------------------------------------------------------------------*/
-/* Private handler : get WPS enable */
+/**
+ * ks_wlan_get_wps_enable() - Get WPS enable.
+ *
+ * Private Handler
+ */
 static int ks_wlan_get_wps_enable(struct net_device *dev,
 				  struct iw_request_info *info, __u32 *uwrq,
 				  char *extra)
@@ -2772,8 +2977,11 @@ static int ks_wlan_get_wps_enable(struct net_device *dev,
 	return 0;
 }
 
-/*------------------------------------------------------------------*/
-/* Private handler : set WPS probe req */
+/**
+ * ks_wlan_set_wps_probe_req() - Set WPS probe req.
+ *
+ * Private Handler
+ */
 static int ks_wlan_set_wps_probe_req(struct net_device *dev,
 				     struct iw_request_info *info,
 				     struct iw_point *dwrq, char *extra)
@@ -2811,8 +3019,12 @@ static int ks_wlan_set_wps_probe_req(struct net_device *dev,
 }
 
 #if 0
-/*------------------------------------------------------------------*/
-/* Private handler : get WPS probe req */
+
+/**
+ * ks_wlan_get_wps_probe_req() - Get WPS probe req.
+ *
+ * Private Handler
+ */
 static int ks_wlan_get_wps_probe_req(struct net_device *dev,
 				     struct iw_request_info *info,
 				     __u32 *uwrq, char *extra)
@@ -2829,8 +3041,11 @@ static int ks_wlan_get_wps_probe_req(struct net_device *dev,
 #endif
 #endif /* WPS */
 
-/*------------------------------------------------------------------*/
-/* Private handler : set tx gain control value */
+/**
+ * ks_wlan_set_tx_gain() - Set tx gain control value.
+ *
+ * Private Handler
+ */
 static int ks_wlan_set_tx_gain(struct net_device *dev,
 			       struct iw_request_info *info, __u32 *uwrq,
 			       char *extra)
@@ -2855,8 +3070,11 @@ static int ks_wlan_set_tx_gain(struct net_device *dev,
 	return 0;
 }
 
-/*------------------------------------------------------------------*/
-/* Private handler : get tx gain control value */
+/**
+ * ks_wlan_get_tx_gain() - Get Tx gain control value.
+ *
+ * Private Handler
+ */
 static int ks_wlan_get_tx_gain(struct net_device *dev,
 			       struct iw_request_info *info, __u32 *uwrq,
 			       char *extra)
@@ -2872,8 +3090,11 @@ static int ks_wlan_get_tx_gain(struct net_device *dev,
 	return 0;
 }
 
-/*------------------------------------------------------------------*/
-/* Private handler : set rx gain control value */
+/**
+ * ks_wlan_set_rx_gain() - Set Rx gain control value.
+ *
+ * Private Handler
+ */
 static int ks_wlan_set_rx_gain(struct net_device *dev,
 			       struct iw_request_info *info, __u32 *uwrq,
 			       char *extra)
@@ -2898,8 +3119,11 @@ static int ks_wlan_set_rx_gain(struct net_device *dev,
 	return 0;
 }
 
-/*------------------------------------------------------------------*/
-/* Private handler : get rx gain control value */
+/**
+ * ks_wlan_get_rx_gain() - Get Rx gain control value.
+ *
+ * Private Handler
+ */
 static int ks_wlan_get_rx_gain(struct net_device *dev,
 			       struct iw_request_info *info, __u32 *uwrq,
 			       char *extra)
@@ -2916,8 +3140,12 @@ static int ks_wlan_get_rx_gain(struct net_device *dev,
 }
 
 #if 0
-/*------------------------------------------------------------------*/
-/* Private handler : set region value */
+
+/**
+ * ks_wlan_set_region() - Set region value.
+ *
+ * Private Handler
+ */
 static int ks_wlan_set_region(struct net_device *dev,
 			      struct iw_request_info *info, __u32 *uwrq,
 			      char *extra)
@@ -2937,8 +3165,11 @@ static int ks_wlan_set_region(struct net_device *dev,
 }
 #endif
 
-/*------------------------------------------------------------------*/
-/* Private handler : get eeprom checksum result */
+/**
+ * ks_wlan_get_eeprom_cksum() - Get eeprom checksum result.
+ *
+ * Private Handler
+ */
 static int ks_wlan_get_eeprom_cksum(struct net_device *dev,
 				    struct iw_request_info *info, __u32 *uwrq,
 				    char *extra)
@@ -3063,8 +3294,11 @@ static void print_hif_event(struct net_device *dev, int event)
 	}
 }
 
-/*------------------------------------------------------------------*/
-/* Private handler : get host command history */
+/**
+ * ks_wlan_hostt() - Get host command history.
+ *
+ * Private Handler
+ */
 static int ks_wlan_hostt(struct net_device *dev, struct iw_request_info *info,
 			 __u32 *uwrq, char *extra)
 {
@@ -3373,9 +3607,11 @@ void send_packet_complete(void *arg1, void *arg2)
 	}
 }
 
-/*
- * Set or clear the multicast filter for this adaptor.
- * This routine is not state sensitive and need not be SMP locked.
+/**
+ * ks_wlan_set_multicast() - Set or clear the multicast filter.
+ *
+ * Set or clear the multicast filter for this adaptor. This routine is
+ * not state sensitive and need not be SMP locked.
  */
 static
 void ks_wlan_set_multicast_list(struct net_device *dev)
-- 
2.7.4

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

^ permalink raw reply related	[flat|nested] 27+ messages in thread

* [PATCH 04/12] staging: ks7010: fix logical line continuation
  2017-03-13 22:53 [PATCH 00/12] staging: ks7010: fix checkpatch ks_wlan_net.c Tobin C. Harding
                   ` (2 preceding siblings ...)
  2017-03-13 22:54 ` [PATCH 03/12] staging: ks7010: convert comments to kernel doc format Tobin C. Harding
@ 2017-03-13 22:54 ` Tobin C. Harding
  2017-03-13 22:54 ` [PATCH 05/12] staging: ks7010: remove dead code Tobin C. Harding
                   ` (7 subsequent siblings)
  11 siblings, 0 replies; 27+ messages in thread
From: Tobin C. Harding @ 2017-03-13 22:54 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: Tobin C. Harding, Wolfram Sang, driverdev-devel

Checkpatch emits CHECK: Logical continuations should be on the
previous line.

Move logical continuation to previous line.

Signed-off-by: Tobin C. Harding <me@tobin.cc>
---
 drivers/staging/ks7010/ks_wlan_net.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/ks7010/ks_wlan_net.c b/drivers/staging/ks7010/ks_wlan_net.c
index c6f891e..bae4011 100644
--- a/drivers/staging/ks7010/ks_wlan_net.c
+++ b/drivers/staging/ks7010/ks_wlan_net.c
@@ -1501,8 +1501,8 @@ static int ks_wlan_set_scan(struct net_device *dev,
 
 	/* for SLEEP MODE */
 	/* specified SSID SCAN */
-	if (wrqu->data.length == sizeof(struct iw_scan_req)
-	    && wrqu->data.flags & IW_SCAN_THIS_ESSID) {
+	if (wrqu->data.length == sizeof(struct iw_scan_req) &&
+	    wrqu->data.flags & IW_SCAN_THIS_ESSID) {
 		req = (struct iw_scan_req *)extra;
 		priv->scan_ssid_len = req->essid_len;
 		memcpy(priv->scan_ssid, req->essid, priv->scan_ssid_len);
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 27+ messages in thread

* [PATCH 05/12] staging: ks7010: remove dead code
  2017-03-13 22:53 [PATCH 00/12] staging: ks7010: fix checkpatch ks_wlan_net.c Tobin C. Harding
                   ` (3 preceding siblings ...)
  2017-03-13 22:54 ` [PATCH 04/12] staging: ks7010: fix logical line continuation Tobin C. Harding
@ 2017-03-13 22:54 ` Tobin C. Harding
  2017-03-13 22:54 ` [PATCH 06/12] staging: ks7010: remove multiple assignment Tobin C. Harding
                   ` (6 subsequent siblings)
  11 siblings, 0 replies; 27+ messages in thread
From: Tobin C. Harding @ 2017-03-13 22:54 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: Tobin C. Harding, Wolfram Sang, driverdev-devel

Checkpatch emits CHECK: Alignment should match open parenthesis. This
is due to commented out code.

Remove commented out (dead) code.

Signed-off-by: Tobin C. Harding <me@tobin.cc>
---
 drivers/staging/ks7010/ks_wlan_net.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/staging/ks7010/ks_wlan_net.c b/drivers/staging/ks7010/ks_wlan_net.c
index bae4011..fdacdae 100644
--- a/drivers/staging/ks7010/ks_wlan_net.c
+++ b/drivers/staging/ks7010/ks_wlan_net.c
@@ -1719,7 +1719,6 @@ static int ks_wlan_get_scan(struct net_device *dev,
 			return -E2BIG;
 		}
 		current_ev = ks_wlan_translate_scan(dev, current_ev,
-//                                                  extra + IW_SCAN_MAX_DATA,
 						    extra + dwrq->length,
 						    &priv->current_ap);
 	}
@@ -1732,7 +1731,6 @@ static int ks_wlan_get_scan(struct net_device *dev,
 		}
 		/* Translate to WE format this entry */
 		current_ev = ks_wlan_translate_scan(dev, info, current_ev,
-//                                                  extra + IW_SCAN_MAX_DATA,
 						    extra + dwrq->length,
 						    &priv->aplist.ap[i]);
 	}
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 27+ messages in thread

* [PATCH 06/12] staging: ks7010: remove multiple assignment
  2017-03-13 22:53 [PATCH 00/12] staging: ks7010: fix checkpatch ks_wlan_net.c Tobin C. Harding
                   ` (4 preceding siblings ...)
  2017-03-13 22:54 ` [PATCH 05/12] staging: ks7010: remove dead code Tobin C. Harding
@ 2017-03-13 22:54 ` Tobin C. Harding
  2017-03-13 22:54 ` [PATCH 07/12] staging: ks7010: move comparison to right hand side Tobin C. Harding
                   ` (5 subsequent siblings)
  11 siblings, 0 replies; 27+ messages in thread
From: Tobin C. Harding @ 2017-03-13 22:54 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: Tobin C. Harding, Wolfram Sang, driverdev-devel

Checkpatch emits CHECK: multiple assignments should be avoided.

Move multiple assignment onto separate lines. Fix comment to use more
natural English.

Signed-off-by: Tobin C. Harding <me@tobin.cc>
---
 drivers/staging/ks7010/ks_wlan_net.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/ks7010/ks_wlan_net.c b/drivers/staging/ks7010/ks_wlan_net.c
index fdacdae..59eabb9 100644
--- a/drivers/staging/ks7010/ks_wlan_net.c
+++ b/drivers/staging/ks7010/ks_wlan_net.c
@@ -1607,8 +1607,10 @@ static inline char *ks_wlan_translate_scan(struct net_device *dev,
 	current_val = current_ev + IW_EV_LCP_LEN;
 
 	iwe.cmd = SIOCGIWRATE;
-	/* Those two flags are ignored... */
-	iwe.u.bitrate.fixed = iwe.u.bitrate.disabled = 0;
+
+	/* These two flags are ignored... */
+	iwe.u.bitrate.fixed = 0;
+	iwe.u.bitrate.disabled = 0;
 
 	/* Max 16 values */
 	for (i = 0; i < 16; i++) {
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 27+ messages in thread

* [PATCH 07/12] staging: ks7010: move comparison to right hand side
  2017-03-13 22:53 [PATCH 00/12] staging: ks7010: fix checkpatch ks_wlan_net.c Tobin C. Harding
                   ` (5 preceding siblings ...)
  2017-03-13 22:54 ` [PATCH 06/12] staging: ks7010: remove multiple assignment Tobin C. Harding
@ 2017-03-13 22:54 ` Tobin C. Harding
  2017-03-14  9:17   ` Dan Carpenter
  2017-03-13 22:54 ` [PATCH 08/12] staging: ks7010: remove unnecessary else statement Tobin C. Harding
                   ` (4 subsequent siblings)
  11 siblings, 1 reply; 27+ messages in thread
From: Tobin C. Harding @ 2017-03-13 22:54 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: Tobin C. Harding, Wolfram Sang, driverdev-devel

Checkpatch emits WARNING: Comparisons should place the constant on the
right side of the test.

Move constant to right hand side of test, modify operator to ensure
logic is maintained.

Signed-off-by: Tobin C. Harding <me@tobin.cc>
---
 drivers/staging/ks7010/ks_wlan_net.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/ks7010/ks_wlan_net.c b/drivers/staging/ks7010/ks_wlan_net.c
index 59eabb9..cee3971 100644
--- a/drivers/staging/ks7010/ks_wlan_net.c
+++ b/drivers/staging/ks7010/ks_wlan_net.c
@@ -2164,7 +2164,7 @@ static int ks_wlan_set_pmksa(struct net_device *dev,
 				}
 			}
 			if (ptr == &priv->pmklist.head) {	/* not find address. */
-				if (PMK_LIST_MAX > priv->pmklist.size) {	/* new cache data */
+				if (priv->pmklist.size <= PMK_LIST_MAX) {	/* new cache data */
 					for (i = 0; i < PMK_LIST_MAX; i++) {
 						pmk = &priv->pmklist.pmk[i];
 						if (!memcmp
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 27+ messages in thread

* [PATCH 08/12] staging: ks7010: remove unnecessary else statement
  2017-03-13 22:53 [PATCH 00/12] staging: ks7010: fix checkpatch ks_wlan_net.c Tobin C. Harding
                   ` (6 preceding siblings ...)
  2017-03-13 22:54 ` [PATCH 07/12] staging: ks7010: move comparison to right hand side Tobin C. Harding
@ 2017-03-13 22:54 ` Tobin C. Harding
  2017-03-14  9:23   ` Dan Carpenter
  2017-03-13 22:54 ` [PATCH 09/12] staging: ks7010: remove unnecessary cast Tobin C. Harding
                   ` (3 subsequent siblings)
  11 siblings, 1 reply; 27+ messages in thread
From: Tobin C. Harding @ 2017-03-13 22:54 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: Tobin C. Harding, Wolfram Sang, driverdev-devel

Checkpatch emits WARNING: else is not generally useful after a break
or return. Two warnings of this type are emitted, both are the result
of a else statement after a return statement. The 'else' can safely be
removed.

Remove unnecessary else statement.

Signed-off-by: Tobin C. Harding <me@tobin.cc>
---
 drivers/staging/ks7010/ks_wlan_net.c | 28 ++++++++++++++--------------
 1 file changed, 14 insertions(+), 14 deletions(-)

diff --git a/drivers/staging/ks7010/ks_wlan_net.c b/drivers/staging/ks7010/ks_wlan_net.c
index cee3971..1451ba7 100644
--- a/drivers/staging/ks7010/ks_wlan_net.c
+++ b/drivers/staging/ks7010/ks_wlan_net.c
@@ -1999,8 +1999,7 @@ static int ks_wlan_set_encode_ext(struct net_device *dev,
 	/* for SLEEP MODE */
 	if (index < 1 || index > 4)
 		return -EINVAL;
-	else
-		index--;
+	index--;
 
 	if (dwrq->flags & IW_ENCODE_DISABLED)
 		priv->wpa.key[index].key_len = 0;
@@ -2196,20 +2195,21 @@ static int ks_wlan_set_pmksa(struct net_device *dev,
 	case IW_PMKSA_REMOVE:
 		if (list_empty(&priv->pmklist.head)) {	/* list empty */
 			return -EINVAL;
-		} else {	/* search cache data */
-			list_for_each(ptr, &priv->pmklist.head) {
-				pmk = list_entry(ptr, struct pmk_t, list);
-				if (!memcmp(pmksa->bssid.sa_data, pmk->bssid, ETH_ALEN)) {	/* match address! list del. */
-					eth_zero_addr(pmk->bssid);
-					memset(pmk->pmkid, 0, IW_PMKID_LEN);
-					list_del_init(&pmk->list);
-					break;
-				}
-			}
-			if (ptr == &priv->pmklist.head) {	/* not find address. */
-				return 0;
+		}
+		/* search cache data */
+		list_for_each(ptr, &priv->pmklist.head) {
+			pmk = list_entry(ptr, struct pmk_t, list);
+			if (!memcmp(pmksa->bssid.sa_data, pmk->bssid, ETH_ALEN)) {	/* match address! list del. */
+				eth_zero_addr(pmk->bssid);
+				memset(pmk->pmkid, 0, IW_PMKID_LEN);
+				list_del_init(&pmk->list);
+				break;
 			}
 		}
+		if (ptr == &priv->pmklist.head) {	/* not find address. */
+			return 0;
+		}
+
 		break;
 	case IW_PMKSA_FLUSH:
 		memset(&priv->pmklist, 0, sizeof(priv->pmklist));
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 27+ messages in thread

* [PATCH 09/12] staging: ks7010: remove unnecessary cast
  2017-03-13 22:53 [PATCH 00/12] staging: ks7010: fix checkpatch ks_wlan_net.c Tobin C. Harding
                   ` (7 preceding siblings ...)
  2017-03-13 22:54 ` [PATCH 08/12] staging: ks7010: remove unnecessary else statement Tobin C. Harding
@ 2017-03-13 22:54 ` Tobin C. Harding
  2017-03-14  0:07   ` Greg Kroah-Hartman
  2017-03-13 22:54 ` [PATCH 10/12] staging: ks7010: fix checkpatch memset warning Tobin C. Harding
                   ` (2 subsequent siblings)
  11 siblings, 1 reply; 27+ messages in thread
From: Tobin C. Harding @ 2017-03-13 22:54 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: Tobin C. Harding, Wolfram Sang, driverdev-devel

Return value from kmalloc() does not require a cast.

Remove unnecessary cast.

Signed-off-by: Tobin C. Harding <me@tobin.cc>
---
 drivers/staging/ks7010/ks_wlan_net.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/ks7010/ks_wlan_net.c b/drivers/staging/ks7010/ks_wlan_net.c
index 1451ba7..e1e4a31 100644
--- a/drivers/staging/ks7010/ks_wlan_net.c
+++ b/drivers/staging/ks7010/ks_wlan_net.c
@@ -2561,7 +2561,7 @@ static int ks_wlan_data_write(struct net_device *dev,
 	if (priv->sleep_mode == SLP_SLEEP)
 		return -EPERM;
 	/* for SLEEP MODE */
-	wbuff = (unsigned char *)kmalloc(dwrq->length, GFP_ATOMIC);
+	wbuff = kmalloc(dwrq->length, GFP_ATOMIC);
 	if (!wbuff)
 		return -EFAULT;
 	memcpy(wbuff, extra, dwrq->length);
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 27+ messages in thread

* [PATCH 10/12] staging: ks7010: fix checkpatch memset warning
  2017-03-13 22:53 [PATCH 00/12] staging: ks7010: fix checkpatch ks_wlan_net.c Tobin C. Harding
                   ` (8 preceding siblings ...)
  2017-03-13 22:54 ` [PATCH 09/12] staging: ks7010: remove unnecessary cast Tobin C. Harding
@ 2017-03-13 22:54 ` Tobin C. Harding
  2017-03-14  9:27   ` Dan Carpenter
  2017-03-13 22:54 ` [PATCH 11/12] staging: ks7010: reduce level of indentation Tobin C. Harding
  2017-03-13 22:54 ` [PATCH 12/12] staging: ks7010: refactor, whitespace only Tobin C. Harding
  11 siblings, 1 reply; 27+ messages in thread
From: Tobin C. Harding @ 2017-03-13 22:54 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: Tobin C. Harding, Wolfram Sang, driverdev-devel

Checkpatch emits WARNING: single byte memset is suspicious. Swapped
2nd/3rd argument? Call site in question is correct but is an unusual
use of memset() to zero a single byte. The same can be achieved by
assigning 0 directly to the memory location.

Dereference pointer and assign 0 to that memory location. Use '\0' to
make explicit that it is a char pointer.

Signed-off-by: Tobin C. Harding <me@tobin.cc>
---
 drivers/staging/ks7010/ks_wlan_net.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/ks7010/ks_wlan_net.c b/drivers/staging/ks7010/ks_wlan_net.c
index e1e4a31..bb20bb9 100644
--- a/drivers/staging/ks7010/ks_wlan_net.c
+++ b/drivers/staging/ks7010/ks_wlan_net.c
@@ -2595,7 +2595,7 @@ static int ks_wlan_data_read(struct net_device *dev,
 			return 0;
 		}
 		read_length = 0;
-		memset(extra, 0, 1);
+		*extra = '\0';
 		dwrq->length = 0;
 		return 0;
 	}
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 27+ messages in thread

* [PATCH 11/12] staging: ks7010: reduce level of indentation
  2017-03-13 22:53 [PATCH 00/12] staging: ks7010: fix checkpatch ks_wlan_net.c Tobin C. Harding
                   ` (9 preceding siblings ...)
  2017-03-13 22:54 ` [PATCH 10/12] staging: ks7010: fix checkpatch memset warning Tobin C. Harding
@ 2017-03-13 22:54 ` Tobin C. Harding
  2017-03-13 22:54 ` [PATCH 12/12] staging: ks7010: refactor, whitespace only Tobin C. Harding
  11 siblings, 0 replies; 27+ messages in thread
From: Tobin C. Harding @ 2017-03-13 22:54 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: Tobin C. Harding, Wolfram Sang, driverdev-devel

Checkpatch emits WARNING: Too many leading tabs - consider code
refactoring. One level of indentation may be removed by inverting an
if statement conditional (and returning if new conditional evaluates
to true). Code contains switch statement that also contains multiple
layers of indentation. Indentation may be reduced by breaking out of
the case statement in multiple places instead of guarding code with
if/else statements.

Invert conditional. Return original error code if new conditional
evaluates to true. Break out of case blocks instead of using
if/else. Do not modify program logic.

Signed-off-by: Tobin C. Harding <me@tobin.cc>
---
 drivers/staging/ks7010/ks_wlan_net.c | 195 ++++++++++++++++++-----------------
 1 file changed, 98 insertions(+), 97 deletions(-)

diff --git a/drivers/staging/ks7010/ks_wlan_net.c b/drivers/staging/ks7010/ks_wlan_net.c
index bb20bb9..ca46869 100644
--- a/drivers/staging/ks7010/ks_wlan_net.c
+++ b/drivers/staging/ks7010/ks_wlan_net.c
@@ -2004,72 +2004,71 @@ static int ks_wlan_set_encode_ext(struct net_device *dev,
 	if (dwrq->flags & IW_ENCODE_DISABLED)
 		priv->wpa.key[index].key_len = 0;
 
-	if (enc) {
-		priv->wpa.key[index].ext_flags = enc->ext_flags;
-		if (enc->ext_flags & IW_ENCODE_EXT_SET_TX_KEY) {
-			priv->wpa.txkey = index;
-			commit |= SME_WEP_INDEX;
-		} else if (enc->ext_flags & IW_ENCODE_EXT_RX_SEQ_VALID) {
-			memcpy(&priv->wpa.key[index].rx_seq[0],
-			       enc->rx_seq, IW_ENCODE_SEQ_MAX_SIZE);
-		}
+	if (!enc)
+		return -EINVAL;
 
-		memcpy(&priv->wpa.key[index].addr.sa_data[0],
-		       &enc->addr.sa_data[0], ETH_ALEN);
+	priv->wpa.key[index].ext_flags = enc->ext_flags;
+	if (enc->ext_flags & IW_ENCODE_EXT_SET_TX_KEY) {
+		priv->wpa.txkey = index;
+		commit |= SME_WEP_INDEX;
+	} else if (enc->ext_flags & IW_ENCODE_EXT_RX_SEQ_VALID) {
+		memcpy(&priv->wpa.key[index].rx_seq[0],
+			enc->rx_seq, IW_ENCODE_SEQ_MAX_SIZE);
+	}
 
-		switch (enc->alg) {
-		case IW_ENCODE_ALG_NONE:
-			if (priv->reg.privacy_invoked) {
-				priv->reg.privacy_invoked = 0x00;
-				commit |= SME_WEP_FLAG;
-			}
-			priv->wpa.key[index].key_len = 0;
+	memcpy(&priv->wpa.key[index].addr.sa_data[0],
+		&enc->addr.sa_data[0], ETH_ALEN);
 
-			break;
-		case IW_ENCODE_ALG_WEP:
-		case IW_ENCODE_ALG_CCMP:
-			if (!priv->reg.privacy_invoked) {
-				priv->reg.privacy_invoked = 0x01;
-				commit |= SME_WEP_FLAG;
-			}
-			if (enc->key_len) {
-				memcpy(&priv->wpa.key[index].key_val[0],
-				       &enc->key[0], enc->key_len);
-				priv->wpa.key[index].key_len = enc->key_len;
-				commit |= (SME_WEP_VAL1 << index);
-			}
-			break;
-		case IW_ENCODE_ALG_TKIP:
-			if (!priv->reg.privacy_invoked) {
-				priv->reg.privacy_invoked = 0x01;
-				commit |= SME_WEP_FLAG;
-			}
-			if (enc->key_len == 32) {
-				memcpy(&priv->wpa.key[index].key_val[0],
-				       &enc->key[0], enc->key_len - 16);
-				priv->wpa.key[index].key_len =
-				    enc->key_len - 16;
-				if (priv->wpa.key_mgmt_suite == 4) {	/* WPA_NONE */
-					memcpy(&priv->wpa.key[index].
-					       tx_mic_key[0], &enc->key[16], 8);
-					memcpy(&priv->wpa.key[index].
-					       rx_mic_key[0], &enc->key[16], 8);
-				} else {
-					memcpy(&priv->wpa.key[index].
-					       tx_mic_key[0], &enc->key[16], 8);
-					memcpy(&priv->wpa.key[index].
-					       rx_mic_key[0], &enc->key[24], 8);
-				}
-				commit |= (SME_WEP_VAL1 << index);
+	switch (enc->alg) {
+	case IW_ENCODE_ALG_NONE:
+		if (priv->reg.privacy_invoked) {
+			priv->reg.privacy_invoked = 0x00;
+			commit |= SME_WEP_FLAG;
+		}
+		priv->wpa.key[index].key_len = 0;
+
+		break;
+	case IW_ENCODE_ALG_WEP:
+	case IW_ENCODE_ALG_CCMP:
+		if (!priv->reg.privacy_invoked) {
+			priv->reg.privacy_invoked = 0x01;
+			commit |= SME_WEP_FLAG;
+		}
+		if (enc->key_len) {
+			memcpy(&priv->wpa.key[index].key_val[0],
+				&enc->key[0], enc->key_len);
+			priv->wpa.key[index].key_len = enc->key_len;
+			commit |= (SME_WEP_VAL1 << index);
+		}
+		break;
+	case IW_ENCODE_ALG_TKIP:
+		if (!priv->reg.privacy_invoked) {
+			priv->reg.privacy_invoked = 0x01;
+			commit |= SME_WEP_FLAG;
+		}
+		if (enc->key_len == 32) {
+			memcpy(&priv->wpa.key[index].key_val[0],
+				&enc->key[0], enc->key_len - 16);
+			priv->wpa.key[index].key_len =
+				enc->key_len - 16;
+			if (priv->wpa.key_mgmt_suite == 4) {	/* WPA_NONE */
+				memcpy(&priv->wpa.key[index].
+					tx_mic_key[0], &enc->key[16], 8);
+				memcpy(&priv->wpa.key[index].
+					rx_mic_key[0], &enc->key[16], 8);
+			} else {
+				memcpy(&priv->wpa.key[index].
+					tx_mic_key[0], &enc->key[16], 8);
+				memcpy(&priv->wpa.key[index].
+					rx_mic_key[0], &enc->key[24], 8);
 			}
-			break;
-		default:
-			return -EINVAL;
+			commit |= (SME_WEP_VAL1 << index);
 		}
-		priv->wpa.key[index].alg = enc->alg;
-	} else {
+		break;
+	default:
 		return -EINVAL;
 	}
+	priv->wpa.key[index].alg = enc->alg;
 
 	if (commit) {
 		if (commit & SME_WEP_INDEX)
@@ -2145,51 +2144,53 @@ static int ks_wlan_set_pmksa(struct net_device *dev,
 				if (!memcmp
 				    ("\x00\x00\x00\x00\x00\x00", pmk->bssid,
 				     ETH_ALEN))
-					break;
+					break; /* loop */
 			}
 			memcpy(pmk->bssid, pmksa->bssid.sa_data, ETH_ALEN);
 			memcpy(pmk->pmkid, pmksa->pmkid, IW_PMKID_LEN);
 			list_add(&pmk->list, &priv->pmklist.head);
 			priv->pmklist.size++;
-		} else {	/* search cache data */
-			list_for_each(ptr, &priv->pmklist.head) {
-				pmk = list_entry(ptr, struct pmk_t, list);
-				if (!memcmp(pmksa->bssid.sa_data, pmk->bssid, ETH_ALEN)) {	/* match address! list move to head. */
-					memcpy(pmk->pmkid, pmksa->pmkid,
-					       IW_PMKID_LEN);
-					list_move(&pmk->list,
-						  &priv->pmklist.head);
-					break;
-				}
+			break;	/* case */
+		}
+		/* search cache data */
+		list_for_each(ptr, &priv->pmklist.head) {
+			pmk = list_entry(ptr, struct pmk_t, list);
+			if (!memcmp(pmksa->bssid.sa_data, pmk->bssid, ETH_ALEN)) {	/* match address! list move to head. */
+				memcpy(pmk->pmkid, pmksa->pmkid,
+					IW_PMKID_LEN);
+				list_move(&pmk->list,
+					&priv->pmklist.head);
+				break; /* list_for_each */
 			}
-			if (ptr == &priv->pmklist.head) {	/* not find address. */
-				if (priv->pmklist.size <= PMK_LIST_MAX) {	/* new cache data */
-					for (i = 0; i < PMK_LIST_MAX; i++) {
-						pmk = &priv->pmklist.pmk[i];
-						if (!memcmp
-						    ("\x00\x00\x00\x00\x00\x00",
-						     pmk->bssid, ETH_ALEN))
-							break;
-					}
-					memcpy(pmk->bssid, pmksa->bssid.sa_data,
-					       ETH_ALEN);
-					memcpy(pmk->pmkid, pmksa->pmkid,
-					       IW_PMKID_LEN);
-					list_add(&pmk->list,
-						 &priv->pmklist.head);
-					priv->pmklist.size++;
-				} else {	/* overwrite old cache data */
-					pmk =
-					    list_entry(priv->pmklist.head.prev,
-						       struct pmk_t, list);
-					memcpy(pmk->bssid, pmksa->bssid.sa_data,
-					       ETH_ALEN);
-					memcpy(pmk->pmkid, pmksa->pmkid,
-					       IW_PMKID_LEN);
-					list_move(&pmk->list,
-						  &priv->pmklist.head);
-				}
+		}
+		if (ptr != &priv->pmklist.head)	/* not find address. */
+			break;	/* case */
+
+		if (priv->pmklist.size <= PMK_LIST_MAX) {	/* new cache data */
+			for (i = 0; i < PMK_LIST_MAX; i++) {
+				pmk = &priv->pmklist.pmk[i];
+				if (!memcmp
+					("\x00\x00\x00\x00\x00\x00",
+						pmk->bssid, ETH_ALEN))
+					break;
 			}
+			memcpy(pmk->bssid, pmksa->bssid.sa_data,
+				ETH_ALEN);
+			memcpy(pmk->pmkid, pmksa->pmkid,
+				IW_PMKID_LEN);
+			list_add(&pmk->list,
+				&priv->pmklist.head);
+			priv->pmklist.size++;
+		} else {	/* overwrite old cache data */
+			pmk =
+				list_entry(priv->pmklist.head.prev,
+					struct pmk_t, list);
+			memcpy(pmk->bssid, pmksa->bssid.sa_data,
+				ETH_ALEN);
+			memcpy(pmk->pmkid, pmksa->pmkid,
+				IW_PMKID_LEN);
+			list_move(&pmk->list,
+				&priv->pmklist.head);
 		}
 		break;
 	case IW_PMKSA_REMOVE:
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 27+ messages in thread

* [PATCH 12/12] staging: ks7010: refactor, whitespace only
  2017-03-13 22:53 [PATCH 00/12] staging: ks7010: fix checkpatch ks_wlan_net.c Tobin C. Harding
                   ` (10 preceding siblings ...)
  2017-03-13 22:54 ` [PATCH 11/12] staging: ks7010: reduce level of indentation Tobin C. Harding
@ 2017-03-13 22:54 ` Tobin C. Harding
  11 siblings, 0 replies; 27+ messages in thread
From: Tobin C. Harding @ 2017-03-13 22:54 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: Tobin C. Harding, Wolfram Sang, driverdev-devel

Code may be refactored to take advantage of previous patches which
reduced the level of indentation. Function parameter line breaks can
be adjusted in line with kernel coding standards.

Refactor layout of function call parameters. Make whitespace changes
only.

Signed-off-by: Tobin C. Harding <me@tobin.cc>
---
 drivers/staging/ks7010/ks_wlan_net.c | 36 +++++++++++++-----------------------
 1 file changed, 13 insertions(+), 23 deletions(-)

diff --git a/drivers/staging/ks7010/ks_wlan_net.c b/drivers/staging/ks7010/ks_wlan_net.c
index ca46869..4d86d8a 100644
--- a/drivers/staging/ks7010/ks_wlan_net.c
+++ b/drivers/staging/ks7010/ks_wlan_net.c
@@ -2156,10 +2156,8 @@ static int ks_wlan_set_pmksa(struct net_device *dev,
 		list_for_each(ptr, &priv->pmklist.head) {
 			pmk = list_entry(ptr, struct pmk_t, list);
 			if (!memcmp(pmksa->bssid.sa_data, pmk->bssid, ETH_ALEN)) {	/* match address! list move to head. */
-				memcpy(pmk->pmkid, pmksa->pmkid,
-					IW_PMKID_LEN);
-				list_move(&pmk->list,
-					&priv->pmklist.head);
+				memcpy(pmk->pmkid, pmksa->pmkid, IW_PMKID_LEN);
+				list_move(&pmk->list, &priv->pmklist.head);
 				break; /* list_for_each */
 			}
 		}
@@ -2169,28 +2167,20 @@ static int ks_wlan_set_pmksa(struct net_device *dev,
 		if (priv->pmklist.size <= PMK_LIST_MAX) {	/* new cache data */
 			for (i = 0; i < PMK_LIST_MAX; i++) {
 				pmk = &priv->pmklist.pmk[i];
-				if (!memcmp
-					("\x00\x00\x00\x00\x00\x00",
-						pmk->bssid, ETH_ALEN))
-					break;
+				if (!memcmp("\x00\x00\x00\x00\x00\x00",
+					    pmk->bssid, ETH_ALEN))
+					break; /* loop */
 			}
-			memcpy(pmk->bssid, pmksa->bssid.sa_data,
-				ETH_ALEN);
-			memcpy(pmk->pmkid, pmksa->pmkid,
-				IW_PMKID_LEN);
-			list_add(&pmk->list,
-				&priv->pmklist.head);
+			memcpy(pmk->bssid, pmksa->bssid.sa_data, ETH_ALEN);
+			memcpy(pmk->pmkid, pmksa->pmkid, IW_PMKID_LEN);
+			list_add(&pmk->list, &priv->pmklist.head);
 			priv->pmklist.size++;
 		} else {	/* overwrite old cache data */
-			pmk =
-				list_entry(priv->pmklist.head.prev,
-					struct pmk_t, list);
-			memcpy(pmk->bssid, pmksa->bssid.sa_data,
-				ETH_ALEN);
-			memcpy(pmk->pmkid, pmksa->pmkid,
-				IW_PMKID_LEN);
-			list_move(&pmk->list,
-				&priv->pmklist.head);
+			pmk = list_entry(priv->pmklist.head.prev, struct pmk_t,
+					 list);
+			memcpy(pmk->bssid, pmksa->bssid.sa_data, ETH_ALEN);
+			memcpy(pmk->pmkid, pmksa->pmkid, IW_PMKID_LEN);
+			list_move(&pmk->list, &priv->pmklist.head);
 		}
 		break;
 	case IW_PMKSA_REMOVE:
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 27+ messages in thread

* Re: [PATCH 03/12] staging: ks7010: convert comments to kernel doc format
  2017-03-13 22:54 ` [PATCH 03/12] staging: ks7010: convert comments to kernel doc format Tobin C. Harding
@ 2017-03-14  0:06   ` Greg Kroah-Hartman
  2017-03-14  1:39     ` Tobin C. Harding
  0 siblings, 1 reply; 27+ messages in thread
From: Greg Kroah-Hartman @ 2017-03-14  0:06 UTC (permalink / raw)
  To: Tobin C. Harding; +Cc: driverdev-devel, Wolfram Sang

On Tue, Mar 14, 2017 at 09:54:01AM +1100, Tobin C. Harding wrote:
> Function comments use a custom format. We have a standard function
> comment format, kernel doc format. Using the standard format aids
> readability and allows documentation to be produced using kernel
> tools.
> 
> Convert function comments to use kernel doc format.
> 
> Signed-off-by: Tobin C. Harding <me@tobin.cc>
> ---
>  drivers/staging/ks7010/ks_wlan_net.c | 554 +++++++++++++++++++++++++----------
>  1 file changed, 395 insertions(+), 159 deletions(-)
> 
> diff --git a/drivers/staging/ks7010/ks_wlan_net.c b/drivers/staging/ks7010/ks_wlan_net.c
> index 1ff1948..c6f891e 100644
> --- a/drivers/staging/ks7010/ks_wlan_net.c
> +++ b/drivers/staging/ks7010/ks_wlan_net.c
> @@ -163,8 +163,7 @@ int ks_wlan_setup_parameter(struct ks_wlan_private *priv,
>  	return 0;
>  }
>  
> -/*
> - * Initial Wireless Extension code for Ks_Wlannet driver by :
> +/* Initial Wireless Extension code for Ks_Wlannet driver by :
>   *	Jean Tourrilhes <jt@hpl.hp.com> - HPL - 17 November 00
>   * Conversion to new driver API by :
>   *	Jean Tourrilhes <jt@hpl.hp.com> - HPL - 26 March 02
> @@ -173,8 +172,11 @@ int ks_wlan_setup_parameter(struct ks_wlan_private *priv,
>   * would not work at all... - Jean II
>   */
>  
> -/*------------------------------------------------------------------*/
> -/* Wireless Handler : get protocol name */
> +/**
> + * ks_wlan_get_name() - Get protocol name.
> + *
> + * Wireless Handler
> + */
>  static int ks_wlan_get_name(struct net_device *dev,

static functions never need to be converted to kerneldoc, as no
documentation would need to be created for them.

All that needs to be done here is, at the most:
/* get protocol name */

But really, given that the function name is pretty good, there's no need
for a comment about it at all, right?

Same for lots of other ones in this patch.

thanks,

greg k-h
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH 09/12] staging: ks7010: remove unnecessary cast
  2017-03-13 22:54 ` [PATCH 09/12] staging: ks7010: remove unnecessary cast Tobin C. Harding
@ 2017-03-14  0:07   ` Greg Kroah-Hartman
  2017-03-14  1:41     ` Tobin C. Harding
  0 siblings, 1 reply; 27+ messages in thread
From: Greg Kroah-Hartman @ 2017-03-14  0:07 UTC (permalink / raw)
  To: Tobin C. Harding; +Cc: driverdev-devel, Wolfram Sang

On Tue, Mar 14, 2017 at 09:54:07AM +1100, Tobin C. Harding wrote:
> Return value from kmalloc() does not require a cast.
> 
> Remove unnecessary cast.
> 
> Signed-off-by: Tobin C. Harding <me@tobin.cc>
> ---
>  drivers/staging/ks7010/ks_wlan_net.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/ks7010/ks_wlan_net.c b/drivers/staging/ks7010/ks_wlan_net.c
> index 1451ba7..e1e4a31 100644
> --- a/drivers/staging/ks7010/ks_wlan_net.c
> +++ b/drivers/staging/ks7010/ks_wlan_net.c
> @@ -2561,7 +2561,7 @@ static int ks_wlan_data_write(struct net_device *dev,
>  	if (priv->sleep_mode == SLP_SLEEP)
>  		return -EPERM;
>  	/* for SLEEP MODE */
> -	wbuff = (unsigned char *)kmalloc(dwrq->length, GFP_ATOMIC);
> +	wbuff = kmalloc(dwrq->length, GFP_ATOMIC);
>  	if (!wbuff)
>  		return -EFAULT;

This should also return -ENOMEM, but that's a separate fix :)

thanks,

greg k-h
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH 03/12] staging: ks7010: convert comments to kernel doc format
  2017-03-14  0:06   ` Greg Kroah-Hartman
@ 2017-03-14  1:39     ` Tobin C. Harding
  2017-03-14  1:41       ` Greg Kroah-Hartman
  0 siblings, 1 reply; 27+ messages in thread
From: Tobin C. Harding @ 2017-03-14  1:39 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: driverdev-devel, Wolfram Sang

On Tue, Mar 14, 2017 at 08:06:18AM +0800, Greg Kroah-Hartman wrote:
> On Tue, Mar 14, 2017 at 09:54:01AM +1100, Tobin C. Harding wrote:
> > Function comments use a custom format. We have a standard function
> > comment format, kernel doc format. Using the standard format aids
> > readability and allows documentation to be produced using kernel
> > tools.
> > 
> > Convert function comments to use kernel doc format.
> > 
> > Signed-off-by: Tobin C. Harding <me@tobin.cc>
> > ---
> >  drivers/staging/ks7010/ks_wlan_net.c | 554 +++++++++++++++++++++++++----------
> >  1 file changed, 395 insertions(+), 159 deletions(-)
> > 
> > diff --git a/drivers/staging/ks7010/ks_wlan_net.c b/drivers/staging/ks7010/ks_wlan_net.c
> > index 1ff1948..c6f891e 100644
> > --- a/drivers/staging/ks7010/ks_wlan_net.c
> > +++ b/drivers/staging/ks7010/ks_wlan_net.c
> > @@ -163,8 +163,7 @@ int ks_wlan_setup_parameter(struct ks_wlan_private *priv,
> >  	return 0;
> >  }
> >  
> > -/*
> > - * Initial Wireless Extension code for Ks_Wlannet driver by :
> > +/* Initial Wireless Extension code for Ks_Wlannet driver by :
> >   *	Jean Tourrilhes <jt@hpl.hp.com> - HPL - 17 November 00
> >   * Conversion to new driver API by :
> >   *	Jean Tourrilhes <jt@hpl.hp.com> - HPL - 26 March 02
> > @@ -173,8 +172,11 @@ int ks_wlan_setup_parameter(struct ks_wlan_private *priv,
> >   * would not work at all... - Jean II
> >   */
> >  
> > -/*------------------------------------------------------------------*/
> > -/* Wireless Handler : get protocol name */
> > +/**
> > + * ks_wlan_get_name() - Get protocol name.
> > + *
> > + * Wireless Handler
> > + */
> >  static int ks_wlan_get_name(struct net_device *dev,
> 
> static functions never need to be converted to kerneldoc, as no
> documentation would need to be created for them.
> 
> All that needs to be done here is, at the most:
> /* get protocol name */
> 
> But really, given that the function name is pretty good, there's no need
> for a comment about it at all, right?
> 
> Same for lots of other ones in this patch.

Righto. What about the 'Wireless Handler' and 'Private Handler'. If we
remove the comment won't that be some loss of information?

thanks,
Tobin.

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH 09/12] staging: ks7010: remove unnecessary cast
  2017-03-14  0:07   ` Greg Kroah-Hartman
@ 2017-03-14  1:41     ` Tobin C. Harding
  0 siblings, 0 replies; 27+ messages in thread
From: Tobin C. Harding @ 2017-03-14  1:41 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: driverdev-devel, Wolfram Sang

On Tue, Mar 14, 2017 at 08:07:15AM +0800, Greg Kroah-Hartman wrote:
> On Tue, Mar 14, 2017 at 09:54:07AM +1100, Tobin C. Harding wrote:
> > Return value from kmalloc() does not require a cast.
> > 
> > Remove unnecessary cast.
> > 
> > Signed-off-by: Tobin C. Harding <me@tobin.cc>
> > ---
> >  drivers/staging/ks7010/ks_wlan_net.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/drivers/staging/ks7010/ks_wlan_net.c b/drivers/staging/ks7010/ks_wlan_net.c
> > index 1451ba7..e1e4a31 100644
> > --- a/drivers/staging/ks7010/ks_wlan_net.c
> > +++ b/drivers/staging/ks7010/ks_wlan_net.c
> > @@ -2561,7 +2561,7 @@ static int ks_wlan_data_write(struct net_device *dev,
> >  	if (priv->sleep_mode == SLP_SLEEP)
> >  		return -EPERM;
> >  	/* for SLEEP MODE */
> > -	wbuff = (unsigned char *)kmalloc(dwrq->length, GFP_ATOMIC);
> > +	wbuff = kmalloc(dwrq->length, GFP_ATOMIC);
> >  	if (!wbuff)
> >  		return -EFAULT;
> 
> This should also return -ENOMEM, but that's a separate fix :)

Good catch. I'll make a note of this and when/if the patch set gets
merged do a separate patch with this fix since it is not checkpatch
related.

thanks,
Tobin.
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH 03/12] staging: ks7010: convert comments to kernel doc format
  2017-03-14  1:39     ` Tobin C. Harding
@ 2017-03-14  1:41       ` Greg Kroah-Hartman
  0 siblings, 0 replies; 27+ messages in thread
From: Greg Kroah-Hartman @ 2017-03-14  1:41 UTC (permalink / raw)
  To: Tobin C. Harding; +Cc: driverdev-devel, Wolfram Sang

On Tue, Mar 14, 2017 at 12:39:46PM +1100, Tobin C. Harding wrote:
> On Tue, Mar 14, 2017 at 08:06:18AM +0800, Greg Kroah-Hartman wrote:
> > On Tue, Mar 14, 2017 at 09:54:01AM +1100, Tobin C. Harding wrote:
> > > Function comments use a custom format. We have a standard function
> > > comment format, kernel doc format. Using the standard format aids
> > > readability and allows documentation to be produced using kernel
> > > tools.
> > > 
> > > Convert function comments to use kernel doc format.
> > > 
> > > Signed-off-by: Tobin C. Harding <me@tobin.cc>
> > > ---
> > >  drivers/staging/ks7010/ks_wlan_net.c | 554 +++++++++++++++++++++++++----------
> > >  1 file changed, 395 insertions(+), 159 deletions(-)
> > > 
> > > diff --git a/drivers/staging/ks7010/ks_wlan_net.c b/drivers/staging/ks7010/ks_wlan_net.c
> > > index 1ff1948..c6f891e 100644
> > > --- a/drivers/staging/ks7010/ks_wlan_net.c
> > > +++ b/drivers/staging/ks7010/ks_wlan_net.c
> > > @@ -163,8 +163,7 @@ int ks_wlan_setup_parameter(struct ks_wlan_private *priv,
> > >  	return 0;
> > >  }
> > >  
> > > -/*
> > > - * Initial Wireless Extension code for Ks_Wlannet driver by :
> > > +/* Initial Wireless Extension code for Ks_Wlannet driver by :
> > >   *	Jean Tourrilhes <jt@hpl.hp.com> - HPL - 17 November 00
> > >   * Conversion to new driver API by :
> > >   *	Jean Tourrilhes <jt@hpl.hp.com> - HPL - 26 March 02
> > > @@ -173,8 +172,11 @@ int ks_wlan_setup_parameter(struct ks_wlan_private *priv,
> > >   * would not work at all... - Jean II
> > >   */
> > >  
> > > -/*------------------------------------------------------------------*/
> > > -/* Wireless Handler : get protocol name */
> > > +/**
> > > + * ks_wlan_get_name() - Get protocol name.
> > > + *
> > > + * Wireless Handler
> > > + */
> > >  static int ks_wlan_get_name(struct net_device *dev,
> > 
> > static functions never need to be converted to kerneldoc, as no
> > documentation would need to be created for them.
> > 
> > All that needs to be done here is, at the most:
> > /* get protocol name */
> > 
> > But really, given that the function name is pretty good, there's no need
> > for a comment about it at all, right?
> > 
> > Same for lots of other ones in this patch.
> 
> Righto. What about the 'Wireless Handler' and 'Private Handler'. If we
> remove the comment won't that be some loss of information?

Do they actually make any sense?  Not to me...
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH 07/12] staging: ks7010: move comparison to right hand side
  2017-03-13 22:54 ` [PATCH 07/12] staging: ks7010: move comparison to right hand side Tobin C. Harding
@ 2017-03-14  9:17   ` Dan Carpenter
  2017-03-14 10:42     ` Tobin C. Harding
  0 siblings, 1 reply; 27+ messages in thread
From: Dan Carpenter @ 2017-03-14  9:17 UTC (permalink / raw)
  To: Tobin C. Harding; +Cc: Greg Kroah-Hartman, driverdev-devel, Wolfram Sang

On Tue, Mar 14, 2017 at 09:54:05AM +1100, Tobin C. Harding wrote:
> Checkpatch emits WARNING: Comparisons should place the constant on the
> right side of the test.
> 
> Move constant to right hand side of test, modify operator to ensure
> logic is maintained.
> 
> Signed-off-by: Tobin C. Harding <me@tobin.cc>
> ---
>  drivers/staging/ks7010/ks_wlan_net.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/ks7010/ks_wlan_net.c b/drivers/staging/ks7010/ks_wlan_net.c
> index 59eabb9..cee3971 100644
> --- a/drivers/staging/ks7010/ks_wlan_net.c
> +++ b/drivers/staging/ks7010/ks_wlan_net.c
> @@ -2164,7 +2164,7 @@ static int ks_wlan_set_pmksa(struct net_device *dev,
>  				}
>  			}
>  			if (ptr == &priv->pmklist.head) {	/* not find address. */
> -				if (PMK_LIST_MAX > priv->pmklist.size) {	/* new cache data */
> +				if (priv->pmklist.size <= PMK_LIST_MAX) {	/* new cache data */

Nope.

regards,
dan carpenter

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH 08/12] staging: ks7010: remove unnecessary else statement
  2017-03-13 22:54 ` [PATCH 08/12] staging: ks7010: remove unnecessary else statement Tobin C. Harding
@ 2017-03-14  9:23   ` Dan Carpenter
  2017-03-14 10:54     ` Tobin C. Harding
  0 siblings, 1 reply; 27+ messages in thread
From: Dan Carpenter @ 2017-03-14  9:23 UTC (permalink / raw)
  To: Tobin C. Harding; +Cc: Greg Kroah-Hartman, driverdev-devel, Wolfram Sang

On Tue, Mar 14, 2017 at 09:54:06AM +1100, Tobin C. Harding wrote:
> @@ -2196,20 +2195,21 @@ static int ks_wlan_set_pmksa(struct net_device *dev,
>  	case IW_PMKSA_REMOVE:
>  		if (list_empty(&priv->pmklist.head)) {	/* list empty */
>  			return -EINVAL;
> -		} else {	/* search cache data */

We no longer need curly braces around the "return -EINVAL;".

> -			list_for_each(ptr, &priv->pmklist.head) {
> -				pmk = list_entry(ptr, struct pmk_t, list);
> -				if (!memcmp(pmksa->bssid.sa_data, pmk->bssid, ETH_ALEN)) {	/* match address! list del. */
> -					eth_zero_addr(pmk->bssid);
> -					memset(pmk->pmkid, 0, IW_PMKID_LEN);
> -					list_del_init(&pmk->list);
> -					break;
> -				}
> -			}
> -			if (ptr == &priv->pmklist.head) {	/* not find address. */
> -				return 0;
> +		}
> +		/* search cache data */
> +		list_for_each(ptr, &priv->pmklist.head) {
> +			pmk = list_entry(ptr, struct pmk_t, list);
> +			if (!memcmp(pmksa->bssid.sa_data, pmk->bssid, ETH_ALEN)) {	/* match address! list del. */
> +				eth_zero_addr(pmk->bssid);
> +				memset(pmk->pmkid, 0, IW_PMKID_LEN);
> +				list_del_init(&pmk->list);
> +				break;
>  			}
>  		}
> +		if (ptr == &priv->pmklist.head) {	/* not find address. */
> +			return 0;
> +		}

You can keep them here because the original had curly braces so it's
not like you're introducing a new warning.

Hopefully this example explains what "one thing per patch" means a bit
more clearly.  Removing the else means you are sort of required to
remove the curly braces so that's part of the "one thing" but fixing all
the curly braces issues is not required even if they are on lines that
you're modifying.

regards,
dan carpenter

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH 10/12] staging: ks7010: fix checkpatch memset warning
  2017-03-13 22:54 ` [PATCH 10/12] staging: ks7010: fix checkpatch memset warning Tobin C. Harding
@ 2017-03-14  9:27   ` Dan Carpenter
  2017-03-14 10:44     ` Tobin C. Harding
  0 siblings, 1 reply; 27+ messages in thread
From: Dan Carpenter @ 2017-03-14  9:27 UTC (permalink / raw)
  To: Tobin C. Harding; +Cc: Greg Kroah-Hartman, driverdev-devel, Wolfram Sang

This code is #ifdeffed out so you should just delete it instead of
fixing it.

regards,
dan carpenter

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH 07/12] staging: ks7010: move comparison to right hand side
  2017-03-14  9:17   ` Dan Carpenter
@ 2017-03-14 10:42     ` Tobin C. Harding
  0 siblings, 0 replies; 27+ messages in thread
From: Tobin C. Harding @ 2017-03-14 10:42 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: Greg Kroah-Hartman, driverdev-devel, Wolfram Sang

On Tue, Mar 14, 2017 at 12:17:49PM +0300, Dan Carpenter wrote:
> On Tue, Mar 14, 2017 at 09:54:05AM +1100, Tobin C. Harding wrote:
> > Checkpatch emits WARNING: Comparisons should place the constant on the
> > right side of the test.
> > 
> > Move constant to right hand side of test, modify operator to ensure
> > logic is maintained.
> > 
> > Signed-off-by: Tobin C. Harding <me@tobin.cc>
> > ---
> >  drivers/staging/ks7010/ks_wlan_net.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/drivers/staging/ks7010/ks_wlan_net.c b/drivers/staging/ks7010/ks_wlan_net.c
> > index 59eabb9..cee3971 100644
> > --- a/drivers/staging/ks7010/ks_wlan_net.c
> > +++ b/drivers/staging/ks7010/ks_wlan_net.c
> > @@ -2164,7 +2164,7 @@ static int ks_wlan_set_pmksa(struct net_device *dev,
> >  				}
> >  			}
> >  			if (ptr == &priv->pmklist.head) {	/* not find address. */
> > -				if (PMK_LIST_MAX > priv->pmklist.size) {	/* new cache data */
> > +				if (priv->pmklist.size <= PMK_LIST_MAX) {	/* new cache data */
> 
> Nope.

Well now, that is embarrassing. Good catch, thanks. This has been
merged but I'll put another patch in tomorrow to fix it.

thanks,
Tobin.
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH 10/12] staging: ks7010: fix checkpatch memset warning
  2017-03-14  9:27   ` Dan Carpenter
@ 2017-03-14 10:44     ` Tobin C. Harding
  2017-03-14 11:08       ` Dan Carpenter
  0 siblings, 1 reply; 27+ messages in thread
From: Tobin C. Harding @ 2017-03-14 10:44 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: Greg Kroah-Hartman, driverdev-devel, Wolfram Sang

On Tue, Mar 14, 2017 at 12:27:07PM +0300, Dan Carpenter wrote:
> This code is #ifdeffed out so you should just delete it instead of
> fixing it.

The TODO file specifically asks for ifdeffed code not to be removed unless
one knows exactly what is going on. I hope to get to that level but am
not there yet.

thanks,
Tobin.
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH 08/12] staging: ks7010: remove unnecessary else statement
  2017-03-14  9:23   ` Dan Carpenter
@ 2017-03-14 10:54     ` Tobin C. Harding
  2017-03-14 11:18       ` Dan Carpenter
  0 siblings, 1 reply; 27+ messages in thread
From: Tobin C. Harding @ 2017-03-14 10:54 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: Greg Kroah-Hartman, driverdev-devel, Wolfram Sang

On Tue, Mar 14, 2017 at 12:23:14PM +0300, Dan Carpenter wrote:
> On Tue, Mar 14, 2017 at 09:54:06AM +1100, Tobin C. Harding wrote:
> > @@ -2196,20 +2195,21 @@ static int ks_wlan_set_pmksa(struct net_device *dev,
> >  	case IW_PMKSA_REMOVE:
> >  		if (list_empty(&priv->pmklist.head)) {	/* list empty */
> >  			return -EINVAL;
> > -		} else {	/* search cache data */
> 
> We no longer need curly braces around the "return -EINVAL;".
> 
> > -			list_for_each(ptr, &priv->pmklist.head) {
> > -				pmk = list_entry(ptr, struct pmk_t, list);
> > -				if (!memcmp(pmksa->bssid.sa_data, pmk->bssid, ETH_ALEN)) {	/* match address! list del. */
> > -					eth_zero_addr(pmk->bssid);
> > -					memset(pmk->pmkid, 0, IW_PMKID_LEN);
> > -					list_del_init(&pmk->list);
> > -					break;
> > -				}
> > -			}
> > -			if (ptr == &priv->pmklist.head) {	/* not find address. */
> > -				return 0;
> > +		}
> > +		/* search cache data */
> > +		list_for_each(ptr, &priv->pmklist.head) {
> > +			pmk = list_entry(ptr, struct pmk_t, list);
> > +			if (!memcmp(pmksa->bssid.sa_data, pmk->bssid, ETH_ALEN)) {	/* match address! list del. */
> > +				eth_zero_addr(pmk->bssid);
> > +				memset(pmk->pmkid, 0, IW_PMKID_LEN);
> > +				list_del_init(&pmk->list);
> > +				break;
> >  			}
> >  		}
> > +		if (ptr == &priv->pmklist.head) {	/* not find address. */
> > +			return 0;
> > +		}
> 
> You can keep them here because the original had curly braces so it's
> not like you're introducing a new warning.
> 
> Hopefully this example explains what "one thing per patch" means a bit
> more clearly.  Removing the else means you are sort of required to
> remove the curly braces so that's part of the "one thing" but fixing all
> the curly braces issues is not required even if they are on lines that
> you're modifying.

Awesome thanks. That took me three goes to work out which
braces we could do without by just looking at the diff, that is some
good diff reading skills you all have.

On the topic of "one thing per patch", so we are aiming to do one
thing per patch so it is easier to locate bugs if they get introduced
but also, and more importantly, to make review easier. So from this
patch am I right in thinking if the one thing is going to expose an
error that the reviewer is going to comment on then best to do it at
the same time so the diff is more clean? But don't do extra things
that are going to make the reviewer have to context switch?

thanks,
Tobin.
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH 10/12] staging: ks7010: fix checkpatch memset warning
  2017-03-14 10:44     ` Tobin C. Harding
@ 2017-03-14 11:08       ` Dan Carpenter
  0 siblings, 0 replies; 27+ messages in thread
From: Dan Carpenter @ 2017-03-14 11:08 UTC (permalink / raw)
  To: Tobin C. Harding; +Cc: Greg Kroah-Hartman, driverdev-devel, Wolfram Sang

On Tue, Mar 14, 2017 at 09:44:07PM +1100, Tobin C. Harding wrote:
> On Tue, Mar 14, 2017 at 12:27:07PM +0300, Dan Carpenter wrote:
> > This code is #ifdeffed out so you should just delete it instead of
> > fixing it.
> 
> The TODO file specifically asks for ifdeffed code not to be removed unless
> one knows exactly what is going on. I hope to get to that level but am
> not there yet.

Normally we just delete it.  I've never yet regretted doing that.  It's
still in the git log if people need it.

Don't be a hoarder.

regards,
dan carpenter

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH 08/12] staging: ks7010: remove unnecessary else statement
  2017-03-14 10:54     ` Tobin C. Harding
@ 2017-03-14 11:18       ` Dan Carpenter
  2017-03-14 20:34         ` Tobin C. Harding
  0 siblings, 1 reply; 27+ messages in thread
From: Dan Carpenter @ 2017-03-14 11:18 UTC (permalink / raw)
  To: Tobin C. Harding; +Cc: Greg Kroah-Hartman, driverdev-devel, Wolfram Sang

On Tue, Mar 14, 2017 at 09:54:22PM +1100, Tobin C. Harding wrote:
> On the topic of "one thing per patch", so we are aiming to do one
> thing per patch so it is easier to locate bugs if they get introduced
> but also, and more importantly, to make review easier. So from this
> patch am I right in thinking if the one thing is going to expose an
> error that the reviewer is going to comment on then best to do it at
> the same time so the diff is more clean?

I'm not sure I understand the question.  If you're writing a cleanup
patch and you spot a bug, the proper thing to do is to stop the cleanup,
fix the bug and send it as a separate patch, then restart the cleanup.
But this is staging and the code is so buggy so we don't care.  Just
finish the cleanup and then fix the bug.  Don't ever mix bug fixes with
cleanups.

regards,
dan carpenter
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH 08/12] staging: ks7010: remove unnecessary else statement
  2017-03-14 11:18       ` Dan Carpenter
@ 2017-03-14 20:34         ` Tobin C. Harding
  0 siblings, 0 replies; 27+ messages in thread
From: Tobin C. Harding @ 2017-03-14 20:34 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: Greg Kroah-Hartman, driverdev-devel, Wolfram Sang

On Tue, Mar 14, 2017 at 02:18:46PM +0300, Dan Carpenter wrote:
> On Tue, Mar 14, 2017 at 09:54:22PM +1100, Tobin C. Harding wrote:
> > On the topic of "one thing per patch", so we are aiming to do one
> > thing per patch so it is easier to locate bugs if they get introduced
> > but also, and more importantly, to make review easier. So from this
> > patch am I right in thinking if the one thing is going to expose an
> > error that the reviewer is going to comment on then best to do it at
> > the same time so the diff is more clean?
> 
> I'm not sure I understand the question.  If you're writing a cleanup
> patch and you spot a bug, the proper thing to do is to stop the cleanup,
> fix the bug and send it as a separate patch, then restart the cleanup.
> But this is staging and the code is so buggy so we don't care.  Just
> finish the cleanup and then fix the bug.  Don't ever mix bug fixes with
> cleanups.

Got  it, thanks.

Tobin.
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

^ permalink raw reply	[flat|nested] 27+ messages in thread

end of thread, other threads:[~2017-03-14 20:34 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-13 22:53 [PATCH 00/12] staging: ks7010: fix checkpatch ks_wlan_net.c Tobin C. Harding
2017-03-13 22:53 ` [PATCH 01/12] staging: ks7010: fix checkpatch SPACING Tobin C. Harding
2017-03-13 22:54 ` [PATCH 02/12] staging: ks7010: fix checkpatch BLOCK_COMMENT_STYLE Tobin C. Harding
2017-03-13 22:54 ` [PATCH 03/12] staging: ks7010: convert comments to kernel doc format Tobin C. Harding
2017-03-14  0:06   ` Greg Kroah-Hartman
2017-03-14  1:39     ` Tobin C. Harding
2017-03-14  1:41       ` Greg Kroah-Hartman
2017-03-13 22:54 ` [PATCH 04/12] staging: ks7010: fix logical line continuation Tobin C. Harding
2017-03-13 22:54 ` [PATCH 05/12] staging: ks7010: remove dead code Tobin C. Harding
2017-03-13 22:54 ` [PATCH 06/12] staging: ks7010: remove multiple assignment Tobin C. Harding
2017-03-13 22:54 ` [PATCH 07/12] staging: ks7010: move comparison to right hand side Tobin C. Harding
2017-03-14  9:17   ` Dan Carpenter
2017-03-14 10:42     ` Tobin C. Harding
2017-03-13 22:54 ` [PATCH 08/12] staging: ks7010: remove unnecessary else statement Tobin C. Harding
2017-03-14  9:23   ` Dan Carpenter
2017-03-14 10:54     ` Tobin C. Harding
2017-03-14 11:18       ` Dan Carpenter
2017-03-14 20:34         ` Tobin C. Harding
2017-03-13 22:54 ` [PATCH 09/12] staging: ks7010: remove unnecessary cast Tobin C. Harding
2017-03-14  0:07   ` Greg Kroah-Hartman
2017-03-14  1:41     ` Tobin C. Harding
2017-03-13 22:54 ` [PATCH 10/12] staging: ks7010: fix checkpatch memset warning Tobin C. Harding
2017-03-14  9:27   ` Dan Carpenter
2017-03-14 10:44     ` Tobin C. Harding
2017-03-14 11:08       ` Dan Carpenter
2017-03-13 22:54 ` [PATCH 11/12] staging: ks7010: reduce level of indentation Tobin C. Harding
2017-03-13 22:54 ` [PATCH 12/12] staging: ks7010: refactor, whitespace only Tobin C. Harding

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.