[edk2] [platforms: PATCH 02/11] Drivers/Spi/MvSpiDxe: Log and return correct error

Marcin Wojtas posted 11 patches 7 years, 3 months ago
[edk2] [platforms: PATCH 02/11] Drivers/Spi/MvSpiDxe: Log and return correct error
Posted by Marcin Wojtas 7 years, 3 months ago
From: Piotr Król <piotr.krol@3mdeb.com>

Make log information clear where it came from and return correct code to
be interpreted by caller.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Piotr Król <piotr.krol@3mdeb.com>
Signed-off-by: Marcin Wojtas <mw@semihalf.com>
---
 Platform/Marvell/Drivers/Spi/MvSpiDxe.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/Platform/Marvell/Drivers/Spi/MvSpiDxe.c b/Platform/Marvell/Drivers/Spi/MvSpiDxe.c
index aab20fc..0872f61 100755
--- a/Platform/Marvell/Drivers/Spi/MvSpiDxe.c
+++ b/Platform/Marvell/Drivers/Spi/MvSpiDxe.c
@@ -240,7 +240,8 @@ MvSpiTransfer (
     }
 
     if (Iterator >= SPI_TIMEOUT) {
-      DEBUG ((DEBUG_ERROR, "Timeout\n"));
+      DEBUG ((DEBUG_ERROR, "EfiSpiTransfer: Timeout\n"));
+      return EFI_TIMEOUT;
     }
   }
 
-- 
1.8.3.1

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
Re: [edk2] [platforms: PATCH 02/11] Drivers/Spi/MvSpiDxe: Log and return correct error
Posted by Ard Biesheuvel 7 years, 3 months ago
On 1 September 2017 at 14:08, Marcin Wojtas <mw@semihalf.com> wrote:
> From: Piotr Król <piotr.krol@3mdeb.com>
>
> Make log information clear where it came from and return correct code to
> be interpreted by caller.
>
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Piotr Król <piotr.krol@3mdeb.com>
> Signed-off-by: Marcin Wojtas <mw@semihalf.com>
> ---
>  Platform/Marvell/Drivers/Spi/MvSpiDxe.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/Platform/Marvell/Drivers/Spi/MvSpiDxe.c b/Platform/Marvell/Drivers/Spi/MvSpiDxe.c
> index aab20fc..0872f61 100755
> --- a/Platform/Marvell/Drivers/Spi/MvSpiDxe.c
> +++ b/Platform/Marvell/Drivers/Spi/MvSpiDxe.c
> @@ -240,7 +240,8 @@ MvSpiTransfer (
>      }
>
>      if (Iterator >= SPI_TIMEOUT) {
> -      DEBUG ((DEBUG_ERROR, "Timeout\n"));
> +      DEBUG ((DEBUG_ERROR, "EfiSpiTransfer: Timeout\n"));


Please don't use EFI prefixes for things that are not defined in the UEFI spec.

Also, you may want to use %a here, and pass __FUNCTION__ as the argument.
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel