diff mbox series

[2/3] test-ipmi-hiomap: Assert if size is zero

Message ID 20190404133306.27317-2-hegdevasant@linux.vnet.ibm.com
State Superseded
Headers show
Series [1/3] libflash/ipmi-hiomap: Fix blocks count issue | expand

Commit Message

Vasant Hegde April 4, 2019, 1:33 p.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 | 1 +
 1 file changed, 1 insertion(+)

Comments

Andrew Jeffery April 8, 2019, 2:05 a.m. UTC | #1
On Fri, 5 Apr 2019, at 00:03, 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>
> ---
>  libflash/test/test-ipmi-hiomap.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/libflash/test/test-ipmi-hiomap.c 
> b/libflash/test/test-ipmi-hiomap.c
> index dc855c5a1..c4cc76d8c 100644
> --- a/libflash/test/test-ipmi-hiomap.c
> +++ b/libflash/test/test-ipmi-hiomap.c
> @@ -207,6 +207,7 @@ int64_t lpc_write(enum OpalLPCAddressType addr_type 
> __attribute__((unused)),
>  		  uint32_t data __attribute__((unused)),
>  		  uint32_t sz __attribute__((unused)))
>  {
> +	assert(sz != 0);

Need to drop the __attribute__((unused)) from sz, otherwise it's misleading.

>  	return 0;
>  }
>  
> -- 
> 2.14.3
> 
>
Vasant Hegde April 8, 2019, 5:30 a.m. UTC | #2
On 04/08/2019 07:35 AM, Andrew Jeffery wrote:
> 
> 
> On Fri, 5 Apr 2019, at 00:03, 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>
>> ---
>>   libflash/test/test-ipmi-hiomap.c | 1 +
>>   1 file changed, 1 insertion(+)
>>
>> diff --git a/libflash/test/test-ipmi-hiomap.c
>> b/libflash/test/test-ipmi-hiomap.c
>> index dc855c5a1..c4cc76d8c 100644
>> --- a/libflash/test/test-ipmi-hiomap.c
>> +++ b/libflash/test/test-ipmi-hiomap.c
>> @@ -207,6 +207,7 @@ int64_t lpc_write(enum OpalLPCAddressType addr_type
>> __attribute__((unused)),
>>   		  uint32_t data __attribute__((unused)),
>>   		  uint32_t sz __attribute__((unused)))
>>   {
>> +	assert(sz != 0);
> 
> Need to drop the __attribute__((unused)) from sz, otherwise it's misleading.

Ah! I missed to remove attribute. Will fix it in v2.

Thanks!

-Vasant
diff mbox series

Patch

diff --git a/libflash/test/test-ipmi-hiomap.c b/libflash/test/test-ipmi-hiomap.c
index dc855c5a1..c4cc76d8c 100644
--- a/libflash/test/test-ipmi-hiomap.c
+++ b/libflash/test/test-ipmi-hiomap.c
@@ -207,6 +207,7 @@  int64_t lpc_write(enum OpalLPCAddressType addr_type __attribute__((unused)),
 		  uint32_t data __attribute__((unused)),
 		  uint32_t sz __attribute__((unused)))
 {
+	assert(sz != 0);
 	return 0;
 }