[edk2] [platforms: PATCH 02/10] Marvell/Drivers: MvSpiDxe: Log and return correct error

Marcin Wojtas posted 10 patches 7 years, 3 months ago
[edk2] [platforms: PATCH 02/10] Marvell/Drivers: 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..0c6b624 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, "%s: Timeout\n", __FUNCTION__));
+      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/10] Marvell/Drivers: MvSpiDxe: Log and return correct error
Posted by Leif Lindholm 7 years, 2 months ago
On Mon, Sep 25, 2017 at 03:51:51AM +0200, Marcin Wojtas 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..0c6b624 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, "%s: Timeout\n", __FUNCTION__));

Should this not be %a as per Ard's suggestion, lest the output become
"MSirnfr: ..."? (I can fold in on commit if you can confirm.)

/
    Leif

> +      return EFI_TIMEOUT;
>      }
>    }
>  
> -- 
> 1.8.3.1
> 
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel