Commit acf75376 authored by YAMANE Toshiaki's avatar YAMANE Toshiaki Committed by Greg Kroah-Hartman
Browse files

staging/rtl8187se: Fix spacing coding style in ieee80211/dot11d.c



The following errors and warnings fixed.
- WARNING: braces {} are not necessary for single statement blocks
- ERROR: that open brace { should be on the previous line
- ERROR: space required before the open parenthesis '('
- ERROR: space prohibited after that open parenthesis '('

Signed-off-by: default avatarYAMANE Toshiaki <yamanetoshi@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 201e7893
Loading
Loading
Loading
Loading
+23 −34
Original line number Original line Diff line number Diff line
@@ -39,12 +39,11 @@ Dot11d_Reset(struct ieee80211_device *ieee)
	memset(pDot11dInfo->channel_map, 0, MAX_CHANNEL_NUMBER+1);
	memset(pDot11dInfo->channel_map, 0, MAX_CHANNEL_NUMBER+1);
	memset(pDot11dInfo->MaxTxPwrDbmList, 0xFF, MAX_CHANNEL_NUMBER+1);
	memset(pDot11dInfo->MaxTxPwrDbmList, 0xFF, MAX_CHANNEL_NUMBER+1);
	// Set new channel map
	// Set new channel map
	for (i = 1; i <= 11; i++) {
	for (i = 1; i <= 11; i++)
		(pDot11dInfo->channel_map)[i] = 1;
		(pDot11dInfo->channel_map)[i] = 1;
	}

	for (i = 12; i <= 14; i++) {
	for (i = 12; i <= 14; i++)
		(pDot11dInfo->channel_map)[i] = 2;
		(pDot11dInfo->channel_map)[i] = 2;
	}


	pDot11dInfo->State = DOT11D_STATE_NONE;
	pDot11dInfo->State = DOT11D_STATE_NONE;
	pDot11dInfo->CountryIeLen = 0;
	pDot11dInfo->CountryIeLen = 0;
@@ -77,8 +76,7 @@ Dot11d_UpdateCountryIe(
	u8 i, j, NumTriples, MaxChnlNum;
	u8 i, j, NumTriples, MaxChnlNum;
	PCHNL_TXPOWER_TRIPLE pTriple;
	PCHNL_TXPOWER_TRIPLE pTriple;


	if((CoutryIeLen - 3)%3 != 0)
	if ((CoutryIeLen - 3)%3 != 0) {
	{
		printk("Dot11d_UpdateCountryIe(): Invalid country IE, skip it........1\n");
		printk("Dot11d_UpdateCountryIe(): Invalid country IE, skip it........1\n");
		Dot11d_Reset(dev);
		Dot11d_Reset(dev);
		return;
		return;
@@ -89,23 +87,21 @@ Dot11d_UpdateCountryIe(
	MaxChnlNum = 0;
	MaxChnlNum = 0;
	NumTriples = (CoutryIeLen - 3) / 3; // skip 3-byte country string.
	NumTriples = (CoutryIeLen - 3) / 3; // skip 3-byte country string.
	pTriple = (PCHNL_TXPOWER_TRIPLE)(pCoutryIe + 3);
	pTriple = (PCHNL_TXPOWER_TRIPLE)(pCoutryIe + 3);
	for(i = 0; i < NumTriples; i++)
	for (i = 0; i < NumTriples; i++) {
	{
		if (MaxChnlNum >= pTriple->FirstChnl) {
		if(MaxChnlNum >= pTriple->FirstChnl)
		// It is not in a monotonically increasing order, so stop processing.
		{ // It is not in a monotonically increasing order, so stop processing.
			printk("Dot11d_UpdateCountryIe(): Invalid country IE, skip it........1\n");
			printk("Dot11d_UpdateCountryIe(): Invalid country IE, skip it........1\n");
			Dot11d_Reset(dev);
			Dot11d_Reset(dev);
			return;
			return;
		}
		}
		if(MAX_CHANNEL_NUMBER < (pTriple->FirstChnl + pTriple->NumChnls))
		if (MAX_CHANNEL_NUMBER < (pTriple->FirstChnl + pTriple->NumChnls)) {
		{ // It is not a valid set of channel id, so stop processing.
		// It is not a valid set of channel id, so stop processing.
			printk("Dot11d_UpdateCountryIe(): Invalid country IE, skip it........2\n");
			printk("Dot11d_UpdateCountryIe(): Invalid country IE, skip it........2\n");
			Dot11d_Reset(dev);
			Dot11d_Reset(dev);
			return;
			return;
		}
		}


		for(j = 0 ; j < pTriple->NumChnls; j++)
		for (j = 0 ; j < pTriple->NumChnls; j++) {
		{
			pDot11dInfo->channel_map[pTriple->FirstChnl + j] = 1;
			pDot11dInfo->channel_map[pTriple->FirstChnl + j] = 1;
			pDot11dInfo->MaxTxPwrDbmList[pTriple->FirstChnl + j] = pTriple->MaxTxPowerInDbm;
			pDot11dInfo->MaxTxPwrDbmList[pTriple->FirstChnl + j] = pTriple->MaxTxPowerInDbm;
			MaxChnlNum = pTriple->FirstChnl + j;
			MaxChnlNum = pTriple->FirstChnl + j;
@@ -138,13 +134,11 @@ DOT11D_GetMaxTxPwrInDbm(
	PRT_DOT11D_INFO pDot11dInfo = GET_DOT11D_INFO(dev);
	PRT_DOT11D_INFO pDot11dInfo = GET_DOT11D_INFO(dev);
	u8 MaxTxPwrInDbm = 255;
	u8 MaxTxPwrInDbm = 255;


	if(MAX_CHANNEL_NUMBER < Channel)
	if (MAX_CHANNEL_NUMBER < Channel) {
	{
		printk("DOT11D_GetMaxTxPwrInDbm(): Invalid Channel\n");
		printk("DOT11D_GetMaxTxPwrInDbm(): Invalid Channel\n");
		return MaxTxPwrInDbm;
		return MaxTxPwrInDbm;
	}
	}
	if(pDot11dInfo->channel_map[Channel])
	if (pDot11dInfo->channel_map[Channel]) {
	{
		MaxTxPwrInDbm = pDot11dInfo->MaxTxPwrDbmList[Channel];
		MaxTxPwrInDbm = pDot11dInfo->MaxTxPwrDbmList[Channel];
	}
	}


@@ -159,15 +153,14 @@ DOT11D_ScanComplete(
{
{
	PRT_DOT11D_INFO pDot11dInfo = GET_DOT11D_INFO(dev);
	PRT_DOT11D_INFO pDot11dInfo = GET_DOT11D_INFO(dev);


	switch(pDot11dInfo->State)
	switch (pDot11dInfo->State) {
	{
	case DOT11D_STATE_LEARNED:
	case DOT11D_STATE_LEARNED:
		pDot11dInfo->State = DOT11D_STATE_DONE;
		pDot11dInfo->State = DOT11D_STATE_DONE;
		break;
		break;


	case DOT11D_STATE_DONE:
	case DOT11D_STATE_DONE:
		if( GET_CIE_WATCHDOG(dev) == 0 )
		if (GET_CIE_WATCHDOG(dev) == 0) {
		{ // Reset country IE if previous one is gone.
		// Reset country IE if previous one is gone.
			Dot11d_Reset(dev);
			Dot11d_Reset(dev);
		}
		}
		break;
		break;
@@ -183,8 +176,7 @@ int IsLegalChannel(
{
{
	PRT_DOT11D_INFO pDot11dInfo = GET_DOT11D_INFO(dev);
	PRT_DOT11D_INFO pDot11dInfo = GET_DOT11D_INFO(dev);


	if(MAX_CHANNEL_NUMBER < channel)
	if (MAX_CHANNEL_NUMBER < channel) {
	{
		printk("IsLegalChannel(): Invalid Channel\n");
		printk("IsLegalChannel(): Invalid Channel\n");
		return 0;
		return 0;
	}
	}
@@ -202,17 +194,14 @@ int ToLegalChannel(
	u8 default_chn = 0;
	u8 default_chn = 0;
	u32 i = 0;
	u32 i = 0;


	for (i = 1; i <= MAX_CHANNEL_NUMBER; i++)
	for (i = 1; i <= MAX_CHANNEL_NUMBER; i++) {
	{
		if (pDot11dInfo->channel_map[i] > 0) {
		if(pDot11dInfo->channel_map[i] > 0)
		{
			default_chn = i;
			default_chn = i;
			break;
			break;
		}
		}
	}
	}


	if(MAX_CHANNEL_NUMBER < channel)
	if (MAX_CHANNEL_NUMBER < channel) {
	{
		printk("IsLegalChannel(): Invalid Channel\n");
		printk("IsLegalChannel(): Invalid Channel\n");
		return default_chn;
		return default_chn;
	}
	}