From: Chi Pham Date: Tue, 18 Mar 2014 22:10:50 +0000 (+0100) Subject: staging: rtl8188eu: Reduced nesting and improved coding style. X-Git-Tag: MMI-PSA29.97-13-9~12500^2~55 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=792f32ac6495e168521182ab96d7816c927b7413;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git staging: rtl8188eu: Reduced nesting and improved coding style. Signed-off-by: Chi Pham Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/rtl8188eu/core/rtw_cmd.c b/drivers/staging/rtl8188eu/core/rtw_cmd.c index 016e55be33e4..c2fb050337d5 100644 --- a/drivers/staging/rtl8188eu/core/rtw_cmd.c +++ b/drivers/staging/rtl8188eu/core/rtw_cmd.c @@ -1974,17 +1974,17 @@ static void c2h_wk_callback(struct work_struct *work) evtpriv->c2h_wk_alive = true; while (!rtw_cbuf_empty(evtpriv->c2h_queue)) { - c2h_evt = (struct c2h_evt_hdr *)rtw_cbuf_pop(evtpriv->c2h_queue); - if (c2h_evt != NULL) { + c2h_evt = (struct c2h_evt_hdr *) + rtw_cbuf_pop(evtpriv->c2h_queue); + if (c2h_evt != NULL) /* This C2H event is read, clear it */ c2h_evt_clear(adapter); - } else { + else { c2h_evt = (struct c2h_evt_hdr *)rtw_malloc(16); - if (c2h_evt != NULL) { /* This C2H event is not read, read & clear now */ - if (c2h_evt_read(adapter, (u8 *)c2h_evt) != _SUCCESS) - continue; - } + if (c2h_evt != NULL && + c2h_evt_read(adapter, (u8 *)c2h_evt) != _SUCCESS) + continue; } /* Special pointer to trigger c2h_evt_clear only */