From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965127AbbBDLJF (ORCPT ); Wed, 4 Feb 2015 06:09:05 -0500 Received: from www.osadl.org ([62.245.132.105]:41266 "EHLO www.osadl.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932833AbbBDLJD (ORCPT ); Wed, 4 Feb 2015 06:09:03 -0500 From: Nicholas Mc Guire To: Greg Kroah-Hartman Cc: navin patidar , Larry Finger , Abel Moyo , devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, Nicholas Mc Guire Subject: [PATCH] staging: rtl8188eu: core: switch with redundant cases Date: Wed, 4 Feb 2015 06:04:38 -0500 Message-Id: <1423047878-5783-1-git-send-email-hofrat@osadl.org> X-Mailer: git-send-email 1.7.10.4 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Signed-off-by: Nicholas Mc Guire --- case WIFI_REASSOCREQ,WIFI_PROBEREQ,WIFI_BEACON,WIFI_ACTION all have the same effect - notably the also for WIFI_PROBEREQ where the if/else is executing the same function. These redundant cases could all be dropped and consolidated into the default but probably it is better for documentation/readability to leave them in the switch/case explicitly. Patch was only compile-tested for x86_64_defconfig + CONFIG_STAGING=y CONFIG_R8188EU=m Patch is against 3.19.0-rc7 (localversion-next is -next-20150204) drivers/staging/rtl8188eu/core/rtw_mlme_ext.c | 9 --------- 1 file changed, 9 deletions(-) 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); - break; case WIFI_BEACON: - _mgt_dispatcher(padapter, ptable, precv_frame); - break; case WIFI_ACTION: _mgt_dispatcher(padapter, ptable, precv_frame); break; -- 1.7.10.4