[dpdk-dev] ethdev: fix missing parenthesis

Message ID 1420815925-7988-1-git-send-email-michalx.k.jastrzebski@intel.com (mailing list archive)
State Accepted, archived
Headers

Commit Message

Michal Jastrzebski Jan. 9, 2015, 3:05 p.m. UTC
  From: Pawel Wodkowski <pawelx.wodkowski@intel.com>


Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
---
 lib/librte_ether/rte_ethdev.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Thomas Monjalon Jan. 15, 2015, 1:16 p.m. UTC | #1
2015-01-09 16:05, Michal Jastrzebski:
> Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>

Good catch!
Was introduced in commit 4bdefaade6d1 (VMDQ enhancements).
Note that quite often, when a patch contains too much things,
we miss this kind of bugs. That's a reason to well split patches.

Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>

Applied

Thanks
  
Wodkowski, PawelX Jan. 16, 2015, 9:40 a.m. UTC | #2
> Good catch!
> Was introduced in commit 4bdefaade6d1 (VMDQ enhancements).
> Note that quite often, when a patch contains too much things,
> we miss this kind of bugs. That's a reason to well split patches.
> 

What is most surprising I did not spotted this, neither  the compiler
what I think it should. It was my IDE which pointed possible bug.

Are we using '-Wparentheses' switch? If not, we should consider
to use this switch?

Pawel
  
Thomas Monjalon Jan. 16, 2015, 5:04 p.m. UTC | #3
2015-01-16 09:40, Wodkowski, PawelX:
> > Good catch!
> > Was introduced in commit 4bdefaade6d1 (VMDQ enhancements).
> > Note that quite often, when a patch contains too much things,
> > we miss this kind of bugs. That's a reason to well split patches.
> 
> What is most surprising I did not spotted this, neither  the compiler
> what I think it should. It was my IDE which pointed possible bug.
> 
> Are we using '-Wparentheses' switch? If not, we should consider
> to use this switch?

It's already included in -Wall which is set in WERROR_FLAGS.
  

Patch

diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c
index 4c1a494..d13301a 100644
--- a/lib/librte_ether/rte_ethdev.c
+++ b/lib/librte_ether/rte_ethdev.c
@@ -848,7 +848,7 @@  rte_eth_dev_config_restore(uint8_t port_id)
 
 		/* add address to the hardware */
 		if  (*dev->dev_ops->mac_addr_add &&
-			dev->data->mac_pool_sel[i] & (1ULL << pool))
+			(dev->data->mac_pool_sel[i] & (1ULL << pool)))
 			(*dev->dev_ops->mac_addr_add)(dev, &addr, i, pool);
 		else {
 			PMD_DEBUG_TRACE("port %d: MAC address array not supported\n",