[dpdk-dev] net/octeontx/base: fix icc build

Message ID 20171010043702.36498-1-pablo.de.lara.guarch@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation fail Compilation issues

Commit Message

De Lara Guarch, Pablo Oct. 10, 2017, 4:37 a.m. UTC
  drivers/net/octeontx/base/octeontx_pkovf.c(527):
error #592: variable "i" is used before its value is set
        RTE_SET_USED(i);

Fixes: ab4f789560c4 ("net/octeontx/base: probe PKI and PKO PCIe VF devices")

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
---
 drivers/net/octeontx/base/octeontx_pkovf.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
  

Comments

Santosh Shukla Oct. 10, 2017, 1:33 p.m. UTC | #1
On Tuesday 10 October 2017 10:07 AM, Pablo de Lara wrote:
> drivers/net/octeontx/base/octeontx_pkovf.c(527):
> error #592: variable "i" is used before its value is set
>         RTE_SET_USED(i);
>
> Fixes: ab4f789560c4 ("net/octeontx/base: probe PKI and PKO PCIe VF devices")
>
> Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
> ---

Acked-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
  
Ferruh Yigit Oct. 10, 2017, 7:24 p.m. UTC | #2
On 10/10/2017 2:33 PM, santosh wrote:
> 
> On Tuesday 10 October 2017 10:07 AM, Pablo de Lara wrote:
>> drivers/net/octeontx/base/octeontx_pkovf.c(527):
>> error #592: variable "i" is used before its value is set
>>         RTE_SET_USED(i);
>>
>> Fixes: ab4f789560c4 ("net/octeontx/base: probe PKI and PKO PCIe VF devices")
>>
>> Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
>> ---
> 
> Acked-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>

Squashed into relevant commit in next-net, thanks.
  

Patch

diff --git a/drivers/net/octeontx/base/octeontx_pkovf.c b/drivers/net/octeontx/base/octeontx_pkovf.c
index cbcc006..f0fb930 100644
--- a/drivers/net/octeontx/base/octeontx_pkovf.c
+++ b/drivers/net/octeontx/base/octeontx_pkovf.c
@@ -522,10 +522,10 @@  static void
 octeontx_pkovf_setup(void)
 {
 	static bool init_once;
-	int i;
 
-	RTE_SET_USED(i);
 	if (!init_once) {
+		unsigned int i;
+
 		rte_spinlock_init(&pko_vf_ctl.lock);
 
 		pko_vf_ctl.fc_iomem = PKO_IOMEM_NULL;