From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f179.google.com (mail-pl1-f179.google.com [209.85.214.179]) by mx.groups.io with SMTP id smtpd.web10.22651.1684848773036031828 for ; Tue, 23 May 2023 06:32:53 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="signature has expired" header.i=@gmail.com header.s=20221208 header.b=hA3rfdtW; spf=pass (domain: gmail.com, ip: 209.85.214.179, mailfrom: pedro.falcato@gmail.com) Received: by mail-pl1-f179.google.com with SMTP id d9443c01a7336-1ae557aaf1dso63751265ad.2 for ; Tue, 23 May 2023 06:32:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1684848772; x=1687440772; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=4izTtlIuTfdgkmQLi1afC/RPIgDRkK35h9KUPGAIvnM=; b=hA3rfdtW5DhSX5PfmPOM0ZPwiNKU6ygMsghxLyCXZz81KKb9DXeEVUGRDg/0Epi8rA R5TB7KYDS6MTV3hBJcuzt9eSPbOULWVDJDRlwLLLdF0KKdDuyrsTYTK28NyHT8MgK6st U56jf2VKoYX0/rWLsJA9947Vf/w8utykrH1W1wJDjB7een+ofxGbJfuXsvlv2IOu6gWY 41RMiAYlgO8O88WmxTfUTN531KNFH25YQRVCDTxVc1vW3R4ozn8rzFHBXvN/uRFBRDHQ krUxvYruvbQm7HpfNghbN4lfbSfJYP8ECEjOxY6VJoiNi2MW2meVLGvO6vNYETA5Rr34 2Jrg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684848772; x=1687440772; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=4izTtlIuTfdgkmQLi1afC/RPIgDRkK35h9KUPGAIvnM=; b=efkzIwc2GUpWjghKBU0ieluPsg/yjMPNTfHjXl7n0oRZ83of9XPx8o1655NAgsE1Pk 6znhr/3HvBge8pPWtc38uwfzSawaTon2k/ajLIp5fpYYvLU2oKZkrk2TlXNd1i/ymPSe egSu5Feyh+pwpUepviyVY0gcY6LYdLb21mrE5eVose0au/Y/IcSZwBaRQ3SOeVRx3Awe ZWT97j2PNyguNVxaQxEjIZy7yekWWH4zO9iXEFQgrEhqRRfk1m4DL30FgeJP5qXuBUP9 BLHjUQFuzK9waHK9b8VpxZy5SL+NqMu1HixXp3kfR2iAdG7G5ZvLPe1b8PHbRwf+ta6R /b4A== X-Gm-Message-State: AC+VfDzQOxvKBOwm91dBqkS2rp9jbP3J190P4p4b2+6a3gv7J/1CmN0k Kq7iuwk2UpPZ59e6OXyhIhqNnX7rz956/mUU3oo= X-Google-Smtp-Source: ACHHUZ6RKceYYaFy+qoOyJmU4r2Nk4jMqtz0V1rUSNo7FeMvF9OqDfzIBXhVqPaX4c5laCIFJu5kQ6wVhBNlmjBsta4= X-Received: by 2002:a17:902:680d:b0:1a5:5e7:a1cc with SMTP id h13-20020a170902680d00b001a505e7a1ccmr10978731plk.58.1684848772426; Tue, 23 May 2023 06:32:52 -0700 (PDT) MIME-Version: 1.0 References: <20230523130421.10804-1-sami.mujawar@arm.com> <20230523130421.10804-8-sami.mujawar@arm.com> In-Reply-To: <20230523130421.10804-8-sami.mujawar@arm.com> From: "Pedro Falcato" Date: Tue, 23 May 2023 14:32:40 +0100 Message-ID: Subject: Re: [PATCH v1 07/12] ArmPkg: Fix return value for ArmGicV2AcknowledgeInterrupt To: Sami Mujawar Cc: devel@edk2.groups.io, ardb+tianocore@kernel.org, quic_llindhol@quicinc.com, neil.jones@blaize.com, pierre.gondois@arm.com, Matteo.Carlini@arm.com, Akanksha.Jain2@arm.com, Ben.Adderson@arm.com, Sibel.Allinson@arm.com, nd@arm.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, May 23, 2023 at 2:04=E2=80=AFPM Sami Mujawar = wrote: > > The IAR register of the Gic CPU interface is 32 bit, while > the value returned by ArmGicV2AcknowledgeInterrupt() is > UINTN. Therefore, typecast the return value to UINTN before > returning. Since IAR is 32-bit, doesn't it make sense to return UINT32 here? Is this for compatibility with GICv3 or...? > > Signed-off-by: Sami Mujawar > --- > ArmPkg/Drivers/ArmGic/GicV2/ArmGicV2Lib.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/ArmPkg/Drivers/ArmGic/GicV2/ArmGicV2Lib.c b/ArmPkg/Drivers/A= rmGic/GicV2/ArmGicV2Lib.c > index f403bec367b5254c248e620e56471904e520f9f2..80115b243afabd5e4faad8808= 9af738b19ce4cd1 100644 > --- a/ArmPkg/Drivers/ArmGic/GicV2/ArmGicV2Lib.c > +++ b/ArmPkg/Drivers/ArmGic/GicV2/ArmGicV2Lib.c > @@ -16,7 +16,7 @@ ArmGicV2AcknowledgeInterrupt ( > ) > { > // Read the Interrupt Acknowledge Register > - return MmioRead32 (GicInterruptInterfaceBase + ARM_GIC_ICCIAR); > + return (UINTN)MmioRead32 (GicInterruptInterfaceBase + ARM_GIC_ICCIAR); > } You don't need to cast from UINT32 to UINTN IMO. UINTN is, as far as I know, always going to be at least 32-bits, so casting makes little sense here, in my view, as UINTN >=3D UINT32. --=20 Pedro