From: Andre Przywara Date: Mon, 1 Mar 2021 23:04:26 +0000 Subject: [PATCH v3 5/6] mmc: actions: add MMC driver for Actions OWL S700/S900 In-Reply-To: References: <1610821939-20130-1-git-send-email-atomar25opensource@gmail.com> <1610821939-20130-6-git-send-email-atomar25opensource@gmail.com> <51c9844c-a376-701e-97c7-2a2f8be57ebd@arm.com> <20210301142542.1106ba22@slackpad.fritz.box> Message-ID: <20210301230426.71c7ee55@slackpad.fritz.box> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Tue, 2 Mar 2021 07:11:54 +0900 Jaehoon Chung wrote: > On 3/1/21 11:25 PM, Andre Przywara wrote: > > On Mon, 1 Mar 2021 18:47:26 +0530 > > Amit Tomar wrote: > > > > Hi, > > > >>> So this whole mode handling here looks dodgy. Below you mix "assignments > >>> to mode" with "ORing in values", without actually ever initialising mode > >>> explicitly. I wonder why the compiler doesn't warn about this, I can see > >>> paths were you OR into an uninitialised value. > >>> > >>> But the compiler already has initialized mode to 0, > > > > Why? Where? I just see a local, non-static definition of mode, > > meaning it won't be initialised. > > It seems that it doesn't initialize in this function. > I think that resp_type may be always matched one of condition. Possibly, but the problem is that the MMC_RSP_R1 clause also uses "|=", so it's the same issue here. One a first glance into the assembly it looks like the compiler optimises this whole clause away? Undefined behaviour? Anyway, I am not really sure we need to argue here, when the fix is dead easy ... Cheers, Andre > I think that's why the compiler doesn't warn. > > Best Regards, > Jaehoon Chung > > > > >> that is why there is no warning. > >> In order to test , printed out mode value which suggests this variable is > >> initialized. > > > > To what? Just because you printed 0(?) in your test doesn't mean that > > this will always be the case. > > > > Cheers, > > Andre > > >