[PATCH 7/7] vt6655: Fixed most of the checkpatch warnings in wmgr

Dan Carpenter dan.carpenter at oracle.com
Thu Jan 2 14:57:01 UTC 2014


On Mon, Dec 30, 2013 at 03:52:37PM +0100, Michael Gunselmann wrote:
> wmgr.h: Fixed checkpatch errors.
> 	Four typedef warnings remain.
> 		line 85: This typedef increases understandability
> 			 so this warning is not touched.
> 		line 196, 203 and 214:
> 			 These typedef-errors might be fixed in a
> 			 later commit. Fixing them makes it necessary
> 			 to touch many other files of the driver
> 			 using this typedef.
> 
> wmgr.c: Fixed checkpatch errors (mostly comments and braces)
> 	Long lines were ignored and will be fixed in a later commit.
> 	Seven warnings remain:
> 		line 562, 770 and 921:
> 			When removing the braces checkpatch complains
> 			about the compiler is running into trouble.
> 			So these lines are not touched.
> 		line 713, 865, 1618 and 2163:
> 			Checkpatch complains about not using netdev_dbg
> 			instead of printk.
> 			These warnings will be fixed in a later commit.
> 

Don't list the things which you don't change.  We're not interested in
that.

This patch does too many changes at once.  If you want to fix all all
the "checkpatch warnings" and your diff is around 20 lines long then
that counts as doing one thing per patch.  If the diffstat is over a
thousand lines long like in this patch then it can't be a grab bag of
random things all munged together in one gigantor patch.

This patch mindlessly updates comment style.  If we wanted that we
could script it.

> -//2008-8-4 <add> by chester
> +/* 2008-8-4 <add> by chester */

Delete these.  We have proper version control now.

> -		DBG_PRT(MSG_LEVEL_INFO, KERN_INFO "Max Support rate = %d \n",
> +		DBG_PRT(MSG_LEVEL_INFO, KERN_INFO "Max Support rate = %d\n",
>  			pMgmt->sNodeDBTable[uNodeIndex].wMaxSuppRate);
> -	}//else { TODO: received STA under state1 handle }
> -	else {
> -		return;
>  	}
> +	/* else { TODO: received STA under state1 handle } */
> +	else
> +		return;

This isn't right.  The correct style is:

	} else {
		return;
	}

But even better would be to reverse the condition and pull everything
in one indent level.

	if (pMgmt->sNodeDBTable[uNodeIndex].eNodeState < NODE_AUTH)
		return;

	pMgmt->sNodeDBTable[uNodeIndex].eNodeState = NODE_ASSOC;
	pMgmt->sNodeDBTable[uNodeIndex].wCapInfo = cpu_to_le16(*sFrame.pwCapInfo);

	etc...


> @@ -1384,11 +1369,12 @@ s_vMgrRxAuthenSequence_2(
>  			s_vMgrLogStatus(pMgmt, cpu_to_le16((*(pFrame->pwStatus))));
>  			pMgmt->eCurrState = WMAC_STATE_IDLE;
>  		}
> -		if (pDevice->eCommandState == WLAN_AUTHENTICATE_WAIT) {
> -//                spin_unlock_irq(&pDevice->lock);
> -//                vCommandTimerWait((void *)pDevice, 0);
> -//                spin_lock_irq(&pDevice->lock);
> -		}
> +/*		if (pDevice->eCommandState == WLAN_AUTHENTICATE_WAIT) {
> + *                spin_unlock_irq(&pDevice->lock);
> + *                vCommandTimerWait((void *)pDevice, 0);
> + *                spin_lock_irq(&pDevice->lock);
> + *		}
> + */
>  

Just delete this sort of thing instead of updating the comment style.
There are a couple other examples of this as well.  Please redo this
patch.

regards,
dan carpenter


More information about the devel mailing list