# Suggest improvement to ar5416_ani.c on adaptive noise immunity



## lion (Sep 27, 2013)

I was reading the source code in the ar5416_ani.c file and I would like to suggest an improvement.

http://svnweb.freebsd.org/base/projects/bmake/sys/dev/ath/ath_hal/ar5416/ar5416_ani.c?view=markup


```
966    params = aniState->params;
967    if (aniState->listenTime > 5*params->period) {
968            /* 
969            * Check to see if need to lower immunity if
970            * 5 aniPeriods have passed
971            */
972            updateMIBStats(ah, aniState);
973            if (aniState->ofdmPhyErrCount <= aniState->listenTime *
974                params->ofdmTrigLow/1000 &&
975                aniState->cckPhyErrCount <= aniState->listenTime *
976                params->cckTrigLow/1000)
977                    ar5416AniLowerImmunity(ah);
978            HALDEBUG(ah, HAL_DEBUG_ANI, "%s: lower immunity\n",
979                __func__);
980            ar5416AniRestart(ah, aniState);
981    } else if (aniState->listenTime > params->period) {
```

I think lines 977 to 979 should be grouped together by curly braces.

The reason is that currently line 978 is outside of the "if" block starting in line 973.

Link to Atheros HAL: Ambient Noise Immunity (ANI):
https://wiki.freebsd.org/dev/ath_hal(4)/AutomaticNoiseImmunity


----------



## wblock@ (Sep 27, 2013)

I think you're right.  Please post this to the freebsd-wireless mailing list.


----------

