From mboxrd@z Thu Jan 1 00:00:00 1970 From: Albert ARIBAUD Date: Thu, 09 Dec 2010 07:59:25 +0100 Subject: [U-Boot] [PATCH v4 2/7] gpio: Add Multi-Function-Pin configuration driver for Marvell SoCs In-Reply-To: <4D00730F.1030807@free.fr> References: <4CFE713A.4050203@free.fr> <4D00730F.1030807@free.fr> Message-ID: <4D007E4D.3070601@free.fr> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi Chris, Le 09/12/2010 07:11, Chris Moore a ?crit : > Hi, > > Le 07/12/2010 18:39, Albert ARIBAUD a ?crit : >> Le 07/12/2010 18:10, Prafulla Wadaskar a ?crit : >> >>>>> + val&= ~MFP_AF_MASK; >>>> Do we need to do this& here? For val is only 0 here... >>> This can be removed. >> OTOH, with the&, this line makes no assumption about val, and thus will >> work regardless of it. If the& is removed, and if later val is set to >> non-zero before reaching this instruction, it will cause a bug. >> >> IOW, the& makes the statement more resilient. >> > > If val really is zero then the result will always be zero :( > Simply removing the & would give a different result. > It would be better to remove the whole bloody line ;-) > > I haven't followed this thread but I suspect the original code was wrong. Good point as to the removal if the removal must be done :) I still think that the original is functionally more correct *if we are not sure that val will always be zero. I'll have a second look tonight. > Cheers, > Chris Amicalement, -- Albert.