[v2,4/5] test-ipmi-hiomap: Fix lpc-read-success
diff mbox series

Message ID 20190408060541.11246-4-hegdevasant@linux.vnet.ibm.com
State Accepted
Delegated to: Vasant Hegde
Headers show
Series
  • [v2,1/5] libflash/ipmi-hiomap: Fix blocks count issue
Related show

Commit Message

Vasant Hegde April 8, 2019, 6:05 a.m. UTC
Cc: Andrew Jeffery <andrew@aj.id.au>
Cc: skiboot-stable@lists.ozlabs.org
Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
---
 libflash/test/test-ipmi-hiomap.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Andrew Jeffery April 9, 2019, 12:57 a.m. UTC | #1
On Mon, 8 Apr 2019, at 15:36, Vasant Hegde wrote:
> Cc: Andrew Jeffery <andrew@aj.id.au>
> Cc: skiboot-stable@lists.ozlabs.org
> Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>

Reviewed-by: Andrew Jeffery <andrew@aj.id.au>

> ---
>  libflash/test/test-ipmi-hiomap.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/libflash/test/test-ipmi-hiomap.c 
> b/libflash/test/test-ipmi-hiomap.c
> index b8f24a9b0..abc97779c 100644
> --- a/libflash/test/test-ipmi-hiomap.c
> +++ b/libflash/test/test-ipmi-hiomap.c
> @@ -222,10 +222,12 @@ int64_t lpc_read(enum OpalLPCAddressType 
> addr_type __attribute__((unused)),
>  
>  static bool lpc_read_success(const uint8_t *buf, size_t len)
>  {
> -	if (len < 64)
> +	if (len < 64) {
>  		while (len--)
>  			if (*buf++ != 0xaa)
>  				return false;
> +		return true;
> +	}
>  
>  	for (int i = 0; i < 64; i++)
>  		if (buf[i] != 0xaa)
> -- 
> 2.14.3
> 
>

Patch
diff mbox series

diff --git a/libflash/test/test-ipmi-hiomap.c b/libflash/test/test-ipmi-hiomap.c
index b8f24a9b0..abc97779c 100644
--- a/libflash/test/test-ipmi-hiomap.c
+++ b/libflash/test/test-ipmi-hiomap.c
@@ -222,10 +222,12 @@  int64_t lpc_read(enum OpalLPCAddressType addr_type __attribute__((unused)),
 
 static bool lpc_read_success(const uint8_t *buf, size_t len)
 {
-	if (len < 64)
+	if (len < 64) {
 		while (len--)
 			if (*buf++ != 0xaa)
 				return false;
+		return true;
+	}
 
 	for (int i = 0; i < 64; i++)
 		if (buf[i] != 0xaa)