From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2607:f8b0:4864:20::142; helo=mail-it1-x142.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-it1-x142.google.com (mail-it1-x142.google.com [IPv6:2607:f8b0:4864:20::142]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id C1CD42119623E for ; Tue, 4 Dec 2018 09:20:34 -0800 (PST) Received: by mail-it1-x142.google.com with SMTP id p197so15668705itp.0 for ; Tue, 04 Dec 2018 09:20:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=ep7GbdNC6mxBDJ6rtGq+esJHmBtw5QyNsHxOH4zCXl0=; b=cmYNTrbS55x+acsvlfK3qVOcUvvoYUFeSp1t07fKMZD7FcSza4UeXBhdJoh3XzuaLu OjLXq8MeAbSsmn/8M2ytqBzn9WyIxidXHpAadAE1QFNhVleyZY7xniE+cgoi3ziQAkvY qd8Rfmjes+vyJ1awZmd7vZJHstQxgbSe6acZo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=ep7GbdNC6mxBDJ6rtGq+esJHmBtw5QyNsHxOH4zCXl0=; b=OWj8ukPTwHYF/0mxXBbkK6EWcX4Vz++5AedGYn6NZIQWm5tULajawJLKGt9rmgF7lZ rLKu6iHyRQXTc6lZb+ooqK3KLPwZSEEWrD5uNGpZahNwYhKNV6NmO+2GdZdU38OCEsr1 NqpIrsoYEL+7X0uwU7Dvo7dtWb2hVONe6aclJrJvJCvpB8stRwP/WWKKqvs0yAgnV6is mjLDAlzAfcLtSPaLkiWiU/IVmHHEQouJXWeK7YMtsKPxphK7kaz2W9Naa3TNDCeXXa7F Tt1SHTzuEOii2+nVLj/danUiOhQSfVdjYIduXcitL9AY3SVD6lXJxucCYN9s2caD4Vdu 6yfQ== X-Gm-Message-State: AA+aEWZbi0w9CVw1hILFJyerYmRgoI1j64KLzB4/RtmMQneXPrxrout7 o1s4O+IsfLAYrc3QmCSCyGaFUUsbEmoFjujpT8AoeQ== X-Google-Smtp-Source: AFSGD/VV8RAQZ6Cucngw54lv+yExBNnFKLbzxKwZ77nVxLkN+3UkEa/oxmyzV493qz9/yka0mhl1eX/rwlZ0TNW+Ero= X-Received: by 2002:a02:734b:: with SMTP id a11mr18017018jae.62.1543944033723; Tue, 04 Dec 2018 09:20:33 -0800 (PST) MIME-Version: 1.0 References: <1540000661-1956-1-git-send-email-mw@semihalf.com> <1540000661-1956-9-git-send-email-mw@semihalf.com> <20181204163726.4j5pm4cbwlmb5oea@bivouac.eciton.net> <20181204171926.3wvtowpzvnrbhvh2@bivouac.eciton.net> In-Reply-To: <20181204171926.3wvtowpzvnrbhvh2@bivouac.eciton.net> From: Ard Biesheuvel Date: Tue, 4 Dec 2018 18:20:21 +0100 Message-ID: To: Leif Lindholm Cc: Marcin Wojtas , "edk2-devel@lists.01.org" , Nadav Haklai , =?UTF-8?B?SmFuIETEhWJyb8Wb?= , Grzegorz Jaszczyk , Kostya Porotchkin , Hua Jing Subject: Re: [platforms: PATCH 08/12] Marvell/Drivers: MvGpioDxe: Introduce platform GPIO driver X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Dec 2018 17:20:35 -0000 Content-Type: text/plain; charset="UTF-8" On Tue, 4 Dec 2018 at 18:19, Leif Lindholm wrote: > > On Tue, Dec 04, 2018 at 05:40:14PM +0100, Ard Biesheuvel wrote: > > > > +STATIC > > > > +EFI_STATUS > > > > +MvGpioGetValue ( > > > > + IN MARVELL_GPIO_PROTOCOL *This, > > > > + IN UINTN ControllerIndex, > > > > + IN UINTN GpioPin, > > > > + IN OUT BOOLEAN *Value > > > > + ) > > > > +{ > > > > + UINTN BaseAddress; > > > > + EFI_STATUS Status; > > > > + > > > > + Status = MvGpioValidate (ControllerIndex, GpioPin); > > > > + if (EFI_ERROR (Status)) { > > > > + DEBUG ((DEBUG_ERROR, > > > > + "%a: Fail to get value of pin #%d\n", > > > > + __FUNCTION__, > > > > + GpioPin)); > > > > + return Status; > > > > + } > > > > + > > > > + BaseAddress = mGpioInstance->Desc->SoC[ControllerIndex].GpioBaseAddress; > > > > + > > > > + *Value = !!(MmioRead32 (BaseAddress + GPIO_DATA_IN_REG) & BIT (GpioPin)); > > > > > > Please don't !!. > > > If necessary, please shift. > > > > Or cast to (BOOLEAN) > > Would be ideal if BOOLEAN wasn't just a typedef for unsigned char :/ > Ugh.