[quagga-dev,15660] zebra: Change bitwise operations to purpose-built macros

Message ID 1466445485-33906-1-git-send-email-qlyoung@cumulusnetworks.com
State Under Review
Headers show

Commit Message

Quentin Young June 20, 2016, 5:58 p.m.
Some bitfields for zebra_debug_* flags were being modified
with bitwise operators instead of the purpose-built macros
in lib/zebra.h. Changed such instances to use the macros.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
---
 zebra/debug.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

Comments

Jafar Al-Gharaibeh June 20, 2016, 6:54 p.m. | #1
Acked-by: Jafar Al-Gharaibeh <jafar@atcorp.com>

On 6/20/2016 12:58 PM, Quentin Young wrote:
> Some bitfields for zebra_debug_* flags were being modified
> with bitwise operators instead of the purpose-built macros
> in lib/zebra.h. Changed such instances to use the macros.
>
> Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
> ---
>   zebra/debug.c | 20 ++++++++++----------
>   1 file changed, 10 insertions(+), 10 deletions(-)
>
> diff --git a/zebra/debug.c b/zebra/debug.c
> index 537c476..1004c95 100644
> --- a/zebra/debug.c
> +++ b/zebra/debug.c
> @@ -97,8 +97,8 @@ DEFUN (debug_zebra_packet,
>          "Debug option set for zebra packet\n")
>   {
>     zebra_debug_packet = ZEBRA_DEBUG_PACKET;
> -  zebra_debug_packet |= ZEBRA_DEBUG_SEND;
> -  zebra_debug_packet |= ZEBRA_DEBUG_RECV;
> +  SET_FLAG(zebra_debug_packet, ZEBRA_DEBUG_SEND);
> +  SET_FLAG(zebra_debug_packet, ZEBRA_DEBUG_RECV);
>     return CMD_SUCCESS;
>   }
>   
> @@ -113,11 +113,11 @@ DEFUN (debug_zebra_packet_direct,
>   {
>     zebra_debug_packet = ZEBRA_DEBUG_PACKET;
>     if (strncmp ("send", argv[0], strlen (argv[0])) == 0)
> -    zebra_debug_packet |= ZEBRA_DEBUG_SEND;
> +    SET_FLAG(zebra_debug_packet, ZEBRA_DEBUG_SEND);
>     if (strncmp ("recv", argv[0], strlen (argv[0])) == 0)
> -    zebra_debug_packet |= ZEBRA_DEBUG_RECV;
> +    SET_FLAG(zebra_debug_packet, ZEBRA_DEBUG_RECV);
>     if (strncmp ("detail", argv[0], strlen (argv[0])) == 0)
> -    zebra_debug_packet |= ZEBRA_DEBUG_DETAIL;
> +    SET_FLAG(zebra_debug_packet, ZEBRA_DEBUG_DETAIL);
>     return CMD_SUCCESS;
>   }
>   
> @@ -133,10 +133,10 @@ DEFUN (debug_zebra_packet_detail,
>   {
>     zebra_debug_packet = ZEBRA_DEBUG_PACKET;
>     if (strncmp ("send", argv[0], strlen (argv[0])) == 0)
> -    zebra_debug_packet |= ZEBRA_DEBUG_SEND;
> +    SET_FLAG(zebra_debug_packet, ZEBRA_DEBUG_SEND);
>     if (strncmp ("recv", argv[0], strlen (argv[0])) == 0)
> -    zebra_debug_packet |= ZEBRA_DEBUG_RECV;
> -  zebra_debug_packet |= ZEBRA_DEBUG_DETAIL;
> +    SET_FLAG(zebra_debug_packet, ZEBRA_DEBUG_RECV);
> +  SET_FLAG(zebra_debug_packet, ZEBRA_DEBUG_DETAIL);
>     return CMD_SUCCESS;
>   }
>   
> @@ -220,9 +220,9 @@ DEFUN (no_debug_zebra_packet_direct,
>          "Debug option set for send packet\n")
>   {
>     if (strncmp ("send", argv[0], strlen (argv[0])) == 0)
> -    zebra_debug_packet &= ~ZEBRA_DEBUG_SEND;
> +    UNSET_FLAG(zebra_debug_packet, ZEBRA_DEBUG_SEND);
>     if (strncmp ("recv", argv[0], strlen (argv[0])) == 0)
> -    zebra_debug_packet &= ~ZEBRA_DEBUG_RECV;
> +    UNSET_FLAG(zebra_debug_packet, ZEBRA_DEBUG_RECV);
>     return CMD_SUCCESS;
>   }
>
cisystem@netdef.org June 20, 2016, 7:20 p.m. | #2
Continous Integration Result: SUCCESSFUL

Congratulations, this patch passed basic tests

Tested-by: NetDEF CI System <cisystem@netdef.org>

This is an EXPERIMENTAL automated CI system.
For questions and feedback, feel free to email
Martin Winter <mwinter@opensourcerouting.org>.

Patches applied :
  Patchwork 2009: http://patchwork.quagga.net/patch/2009
       [quagga-dev,15660] zebra: Change bitwise operations to purpose-built macros
Tested on top of Git : 5f67888 (as of 20160429.234845 UTC)
CI System Testrun URL: https://ci1.netdef.org/browse/QUAGGA-QPWORK-322/


Regards,
  NetDEF/OpenSourceRouting Continous Integration (CI) System

---
OpenSourceRouting.org is a project of the Network Device Education Foundation,
For more information, see www.netdef.org and www.opensourcerouting.org
For questions in regards to this CI System, contact Martin Winter, mwinter@netdef.org

Patch hide | download patch | download mbox

diff --git a/zebra/debug.c b/zebra/debug.c
index 537c476..1004c95 100644
--- a/zebra/debug.c
+++ b/zebra/debug.c
@@ -97,8 +97,8 @@  DEFUN (debug_zebra_packet,
        "Debug option set for zebra packet\n")
 {
   zebra_debug_packet = ZEBRA_DEBUG_PACKET;
-  zebra_debug_packet |= ZEBRA_DEBUG_SEND;
-  zebra_debug_packet |= ZEBRA_DEBUG_RECV;
+  SET_FLAG(zebra_debug_packet, ZEBRA_DEBUG_SEND);
+  SET_FLAG(zebra_debug_packet, ZEBRA_DEBUG_RECV);
   return CMD_SUCCESS;
 }
 
@@ -113,11 +113,11 @@  DEFUN (debug_zebra_packet_direct,
 {
   zebra_debug_packet = ZEBRA_DEBUG_PACKET;
   if (strncmp ("send", argv[0], strlen (argv[0])) == 0)
-    zebra_debug_packet |= ZEBRA_DEBUG_SEND;
+    SET_FLAG(zebra_debug_packet, ZEBRA_DEBUG_SEND);
   if (strncmp ("recv", argv[0], strlen (argv[0])) == 0)
-    zebra_debug_packet |= ZEBRA_DEBUG_RECV;
+    SET_FLAG(zebra_debug_packet, ZEBRA_DEBUG_RECV);
   if (strncmp ("detail", argv[0], strlen (argv[0])) == 0)
-    zebra_debug_packet |= ZEBRA_DEBUG_DETAIL;
+    SET_FLAG(zebra_debug_packet, ZEBRA_DEBUG_DETAIL);
   return CMD_SUCCESS;
 }
 
@@ -133,10 +133,10 @@  DEFUN (debug_zebra_packet_detail,
 {
   zebra_debug_packet = ZEBRA_DEBUG_PACKET;
   if (strncmp ("send", argv[0], strlen (argv[0])) == 0)
-    zebra_debug_packet |= ZEBRA_DEBUG_SEND;
+    SET_FLAG(zebra_debug_packet, ZEBRA_DEBUG_SEND);
   if (strncmp ("recv", argv[0], strlen (argv[0])) == 0)
-    zebra_debug_packet |= ZEBRA_DEBUG_RECV;
-  zebra_debug_packet |= ZEBRA_DEBUG_DETAIL;
+    SET_FLAG(zebra_debug_packet, ZEBRA_DEBUG_RECV);
+  SET_FLAG(zebra_debug_packet, ZEBRA_DEBUG_DETAIL);
   return CMD_SUCCESS;
 }
 
@@ -220,9 +220,9 @@  DEFUN (no_debug_zebra_packet_direct,
        "Debug option set for send packet\n")
 {
   if (strncmp ("send", argv[0], strlen (argv[0])) == 0)
-    zebra_debug_packet &= ~ZEBRA_DEBUG_SEND;
+    UNSET_FLAG(zebra_debug_packet, ZEBRA_DEBUG_SEND);
   if (strncmp ("recv", argv[0], strlen (argv[0])) == 0)
-    zebra_debug_packet &= ~ZEBRA_DEBUG_RECV;
+    UNSET_FLAG(zebra_debug_packet, ZEBRA_DEBUG_RECV);
   return CMD_SUCCESS;
 }