From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2a00:1450:4864:20::444; helo=mail-wr1-x444.google.com; envelope-from=leif.lindholm@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-wr1-x444.google.com (mail-wr1-x444.google.com [IPv6:2a00:1450:4864:20::444]) (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 F1F562119358F for ; Tue, 4 Dec 2018 09:19:29 -0800 (PST) Received: by mail-wr1-x444.google.com with SMTP id c14so16820738wrr.0 for ; Tue, 04 Dec 2018 09:19:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=VJuiZHFjS2i6nYXqogukz2i1GalOwgPzoReK3Bzow00=; b=H/bnwFAzW/2hJOpYi9UvbXbPgTrQdHa58XYwpofp5GrKbyjsbchr2zULrMdnOfAIu5 +2E5dOGIWYrxvOiJim0RLCke/YAmXQLxi+CAzdAOS76Kz1hHZEIXPAIJekjwTtDZDD3T uW0Iy5SCcYwsdHtLAXdM2Y3pEZ/jQ3FaMiLbM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=VJuiZHFjS2i6nYXqogukz2i1GalOwgPzoReK3Bzow00=; b=Kq9BjqE66Qd6HqL7E/UuKJSlbiozLEEPrkc4gVCjIBXx6LB9wtuLlUbu1qCDSbe7/f ++j2G/9NN2JnscO3i35YrwneDqe/y2B99pufZ4yN2GiaQ1tjJBdNOiW+6N4zNy/rCjLW ILlxzWpwbNIHCMDXkziWXA9NShlGv31rJRN+twiFoZyKcAI9R2BJXU7k4hX/ruAonoTd SfLAchrjOvZjfXoB0uGMWc7yj3L9N8dL9tMPQRCHhMrOfUv6Z2MON7n/hmtA1nmDkzH3 +rRiV9trh2WD+1DV+YjtjsjTLWoLU/G4xwQz18JjVlhxagZ1aK48LMyANUFlqyx+uNci kYVA== X-Gm-Message-State: AA+aEWYAm9lNSkiAt/a2/qPUeVnr6mCvqrHFc7htqaz+lbejRffKdDAS djyoJJFoY6UjIS6xJleYadck/g== X-Google-Smtp-Source: AFSGD/UCzhsUMQtMYjzCNm+9DMV5X2YKJkbJnnSxmApO+LaVrwfITOPKJVD4kTnJwYiNAVsKgUdtGg== X-Received: by 2002:adf:bc87:: with SMTP id g7mr18199632wrh.250.1543943968479; Tue, 04 Dec 2018 09:19:28 -0800 (PST) Received: from bivouac.eciton.net (bivouac.eciton.net. [2a00:1098:0:86:1000:23:0:2]) by smtp.gmail.com with ESMTPSA id d8sm16009864wrw.70.2018.12.04.09.19.27 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 04 Dec 2018 09:19:27 -0800 (PST) Date: Tue, 4 Dec 2018 17:19:26 +0000 From: Leif Lindholm To: Ard Biesheuvel Cc: Marcin Wojtas , "edk2-devel@lists.01.org" , Nadav Haklai , Jan =?utf-8?B?RMSFYnJvxZs=?= , Grzegorz Jaszczyk , Kostya Porotchkin , Hua Jing Message-ID: <20181204171926.3wvtowpzvnrbhvh2@bivouac.eciton.net> References: <1540000661-1956-1-git-send-email-mw@semihalf.com> <1540000661-1956-9-git-send-email-mw@semihalf.com> <20181204163726.4j5pm4cbwlmb5oea@bivouac.eciton.net> MIME-Version: 1.0 In-Reply-To: User-Agent: NeoMutt/20170113 (1.7.2) 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:19:30 -0000 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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 :/ / Leif