Re: [PATCH] staging: rtl8188eu: core: switch with redundant cases

From: Rasmus Villemoes
Date: Wed Feb 04 2015 - 07:08:11 EST


On Wed, Feb 04 2015, Nicholas Mc Guire <hofrat@xxxxxxxxx> wrote:

> A few redundant switch cases as well as a redundant if/else
> within one of the cases was consolidated to a single call.
> The cases are intentionally retained for documentation purposes.
>
[...]
> diff --git a/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c b/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
> index 28918201..cd12dd7 100644
> --- a/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
> +++ b/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
> @@ -484,17 +484,8 @@ void mgt_dispatcher(struct adapter *padapter, struct recv_frame *precv_frame)
> /* fall through */
> case WIFI_ASSOCREQ:
> case WIFI_REASSOCREQ:
> - _mgt_dispatcher(padapter, ptable, precv_frame);
> - break;
> case WIFI_PROBEREQ:
> - if (check_fwstate(pmlmepriv, WIFI_AP_STATE))
> - _mgt_dispatcher(padapter, ptable, precv_frame);
> - else
> - _mgt_dispatcher(padapter, ptable, precv_frame);

It is highly unlikely that a function called check_fwstate has side
effects, but it might be nice checking that and making a note in the
commit log.

Rasmus
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/