Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751659AbbFNGTu (ORCPT ); Sun, 14 Jun 2015 02:19:50 -0400 Received: from hofr.at ([212.69.189.236]:43332 "EHLO mail.hofr.at" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751129AbbFNGTo (ORCPT ); Sun, 14 Jun 2015 02:19:44 -0400 Date: Sun, 14 Jun 2015 08:19:41 +0200 From: Nicholas Mc Guire To: Jes Sorensen Cc: Nicholas Mc Guire , Larry Finger , Greg Kroah-Hartman , Roberta Dobrescu , Joe Perches , Daniele Alessandrelli , Aleh Suprunovich , linux-wireless@vger.kernel.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: Re: [BUG ?] staging: rtl8723au: condition with no effect Message-ID: <20150614061941.GA27959@opentech.at> References: <1434191497-5611-1-git-send-email-hofrat@osadl.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.18 (2008-05-17) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2052 Lines: 43 On Sat, 13 Jun 2015, Jes Sorensen wrote: > Nicholas Mc Guire writes: > > scanning for trivial bug-patters with coccinelle spatches returned: > > ./drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c:1395 > > WARNING: condition with no effect (if branch == else) > > > > drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c - line numbers from 4.1-rc7 > > 1395 if (bWithoutHWSM) { > > 1396 /* value16 |= (APDM_HOST | FSM_HSUS |/PFM_ALDN); */ > > 1397 /* 2010/08/31 According to Filen description, we need to > > 1398 use HW to shut down 8051 automatically. */ > > 1399 /* Because suspend operation need the asistance of 8051 > > 1400 to wait for 3ms. */ > > 1401 value16 = APDM_HOST | AFSM_HSUS | PFM_ALDN; > > 1402 } else { > > 1403 value16 = APDM_HOST | AFSM_HSUS | PFM_ALDN; > > 1404 } > > 1405 > > 1406 rtl8723au_write16(padapter, REG_APS_FSMCO, value16); /* 0x4802 */ > > > > Not clear what the intent is but this looks like a typo/bug in the assigment > > of value16 as the condition here has no effect. > > Doesn't look like a typo, looks like someone at some point had commented > out PFM_ALDN in the bWithoutHWSM case. Why they did that and then later > overrode it, I have no idea. > as far as its traceable in git log if == else was in there from the very beginning (including that comment) - both the if and else were updated in commit cffca68d7b2f ("staging: rtl8723au: _DisableAnalog(): Avoid zero-init variables unnecessaril") but without changing PFM_ALDN - as there are no comments to the meaning of these bits in the header file there is no way to really come up with a resonable patch. anyway its either wrong settings or the condition should be removed. thx! hofrat -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/